decorator-wrap
Version:
A decorator (@wrap) for wrapping class or methods with your custom code
1 lines • 624 B
JavaScript
;function wrap(r){return function(n,t,e){if("function"==typeof n){var u=function(){for(var t=arguments.length,e=Array(t),u=0;t>u;u++)e[u]=arguments[u];var a=this;return function(){var t=function(){return new n(e)};return r.call(a,t,e,n.name,"class")}()};return u}var a=function(){var n=e.value;return e.value=function(){for(var e=arguments.length,u=Array(e),a=0;e>a;a++)u[a]=arguments[a];var o=this;return function(){var e=function(){return n.apply(o,u)};return r.call(o,e,u,t,"function")}()},{v:e}}();return"object"==typeof a?a.v:void 0}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.wrap=wrap;