ES5 Decorator
===============================
This package provides an compatible decorator maker with ES7 Decorators.
Installation
npm install es5-decorator
Examples
decorate(type, [args,] obj, key);
autobind
var decorator = ; { var fn = targetkey; targetkey = { return fn; } return targetkey;} var { thisx = x; thisy = y;};Pointprototype{ return Math;} var p = 1 1;var len = ;console; //1.414213562
deprecate
{ iftypeof target !== 'string' console; return targetkey; else console; return {}; } var myObj = { return 'hello world'; }; console;
decorate(type, [args,] obj);
doge & animal
{ targetisDoge = true;} { targetisAnimal = true;} var { } ;; var dog = ; console;
decorate(type, [args,] obj=null, func);
multicast
{ var fn = targetkey; targetkey = { var list = arguments0; if!Array return fn; else var ret = ; var args = slice; forvar i = 0; i < listlength; i++ args0 = listi; ret; return ret; } return targetkey;} {return x + y};inc = ; console
Test cases
npm run test