UNPKG

surrogate

Version:

Object method hooks made easy

80 lines (70 loc) 3.96 kB
var $3e0684a3e4432a28$exports = require("./surrogate.de4acfe1.js"); var $8f5bd6cc0f9bb93b$exports = require("./surrogate.1545c2f2.js"); var $173529f42333421b$exports = require("./surrogate.014ad084.js"); var $bkhup$jfrazxasarray = require("@jfrazx/asarray"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); } $parcel$export(module.exports, "SurrogateDelegate", () => $cf53c7e555cee885$export$77f5c3e0367f966c); $parcel$export(module.exports, "SurrogateFor", () => $cf53c7e555cee885$export$1f9b64d402a3fb21); $parcel$export(module.exports, "SurrogatePreAndPost", () => $cf53c7e555cee885$export$a8245ad049bb720d); $parcel$export(module.exports, "SurrogatePre", () => $cf53c7e555cee885$export$b5c512486cbae3c6); $parcel$export(module.exports, "SurrogatePost", () => $cf53c7e555cee885$export$93f947839a6a102); $parcel$export(module.exports, "SurrogateAsyncPreAndPost", () => $cf53c7e555cee885$export$3ad5cc69cb842db3); $parcel$export(module.exports, "SurrogateAsyncPost", () => $cf53c7e555cee885$export$ffe0d28f562faea6); $parcel$export(module.exports, "SurrogateAsyncPre", () => $cf53c7e555cee885$export$2953b6adc68fccd3); const $cf53c7e555cee885$export$77f5c3e0367f966c = (delegateOptions = {})=>(klass)=>(0, $8f5bd6cc0f9bb93b$exports.SurrogateClassWrapper).wrap(klass, delegateOptions); const $cf53c7e555cee885$export$1f9b64d402a3fb21 = (forOptions)=>{ return (target, event)=>{ (0, $bkhup$jfrazxasarray.asArray)(forOptions).forEach((forOption)=>{ const { type: type, options: options } = forOption; const which = (0, $3e0684a3e4432a28$exports.determineWhich)(type); which.forEach((type)=>(0, $3e0684a3e4432a28$exports.manageDecorator)(type, options)(target, event)); }); }; }; const $cf53c7e555cee885$export$a8245ad049bb720d = (decoratorOptions)=>{ return (target, event)=>{ (0, $bkhup$jfrazxasarray.asArray)(decoratorOptions).forEach((options)=>$cf53c7e555cee885$export$1f9b64d402a3fb21({ options: options, type: (0, $173529f42333421b$exports.HookType).BOTH })(target, event)); }; }; const $cf53c7e555cee885$export$b5c512486cbae3c6 = (decoratorOptions)=>{ const forOptions = (0, $bkhup$jfrazxasarray.asArray)(decoratorOptions).map((options)=>({ options: options, type: (0, $173529f42333421b$exports.HookType).PRE })); return $cf53c7e555cee885$export$1f9b64d402a3fb21(forOptions); }; const $cf53c7e555cee885$export$93f947839a6a102 = (decoratorOptions)=>{ const forOptions = (0, $bkhup$jfrazxasarray.asArray)(decoratorOptions).map((options)=>({ options: options, type: (0, $173529f42333421b$exports.HookType).POST })); return $cf53c7e555cee885$export$1f9b64d402a3fb21(forOptions); }; const $cf53c7e555cee885$export$3ad5cc69cb842db3 = (decoratorOptions)=>{ const which = [ (0, $173529f42333421b$exports.HookType).PRE, (0, $173529f42333421b$exports.HookType).POST ]; return (target, event)=>{ which.forEach((type)=>$cf53c7e555cee885$var$surrogateAsyncHelper(type, decoratorOptions)(target, event)); }; }; const $cf53c7e555cee885$export$ffe0d28f562faea6 = (decoratorOptions)=>{ return $cf53c7e555cee885$var$surrogateAsyncHelper((0, $173529f42333421b$exports.HookType).POST, decoratorOptions); }; const $cf53c7e555cee885$export$2953b6adc68fccd3 = (decoratorOptions)=>{ return $cf53c7e555cee885$var$surrogateAsyncHelper((0, $173529f42333421b$exports.HookType).PRE, decoratorOptions); }; const $cf53c7e555cee885$var$surrogateAsyncHelper = (type, asyncOptions)=>{ return (target, event)=>{ (0, $bkhup$jfrazxasarray.asArray)(asyncOptions).forEach((options)=>{ (0, $3e0684a3e4432a28$exports.manageAsyncDecorator)(type, options)(target, event); }); }; }; //# sourceMappingURL=surrogate.bf53d218.js.map