surrogate
Version:
Object method hooks made easy
80 lines (70 loc) • 3.99 kB
JavaScript
var $3e0684a3e4432a28$exports = require("./surrogate.de4acfe1.js");
var $5da807cc202126ea$exports = require("./surrogate.68dbcc9f.js");
var $173529f42333421b$exports = require("./surrogate.014ad084.js");
var $9nZ7L$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, "NextFor", () => $c7384fc238b55cad$export$eedf49b4b69a5ead);
$parcel$export(module.exports, "NextAsyncPre", () => $c7384fc238b55cad$export$b39ca5382585ee21);
$parcel$export(module.exports, "NextAsyncPost", () => $c7384fc238b55cad$export$dd29c1f31c33eedb);
$parcel$export(module.exports, "NextAsyncPreAndPost", () => $c7384fc238b55cad$export$e8c7dd766f8d180a);
$parcel$export(module.exports, "NextPre", () => $c7384fc238b55cad$export$1e4ceaa741849ed7);
$parcel$export(module.exports, "NextPost", () => $c7384fc238b55cad$export$d40ee6255ee433dd);
$parcel$export(module.exports, "NextPreAndPost", () => $c7384fc238b55cad$export$c11bc0137fa2c80f);
const $c7384fc238b55cad$export$eedf49b4b69a5ead = (nextOptions)=>(target, event)=>(0, $9nZ7L$jfrazxasarray.asArray)(nextOptions).forEach((nextOption)=>{
const { type: type, action: action, options: options = {} } = nextOption;
const which = (0, $3e0684a3e4432a28$exports.determineWhich)(type);
const actions = (0, $9nZ7L$jfrazxasarray.asArray)(action);
which.forEach((type)=>actions.forEach((action)=>(0, $3e0684a3e4432a28$exports.manageDecorator)(type, {
handler: event,
options: options
})(target, action)));
});
const $c7384fc238b55cad$export$b39ca5382585ee21 = (nextOptions)=>{
return $c7384fc238b55cad$var$nextAsyncHelper(nextOptions, (0, $173529f42333421b$exports.PRE));
};
const $c7384fc238b55cad$export$dd29c1f31c33eedb = (nextOptions)=>{
return $c7384fc238b55cad$var$nextAsyncHelper(nextOptions, (0, $173529f42333421b$exports.POST));
};
const $c7384fc238b55cad$export$e8c7dd766f8d180a = (nextOptions)=>{
const which = [
(0, $173529f42333421b$exports.PRE),
(0, $173529f42333421b$exports.POST)
];
return (target, event, descriptor)=>{
which.forEach((type)=>$c7384fc238b55cad$var$nextAsyncHelper(nextOptions, type)(target, event, descriptor));
};
};
const $c7384fc238b55cad$var$nextAsyncHelper = (nextOptions, type)=>{
return (target, event, descriptor)=>(0, $9nZ7L$jfrazxasarray.asArray)(nextOptions).forEach(({ action: action, options: options })=>$c7384fc238b55cad$var$nextHelper({
action: action,
options: {
...options,
wrapper: (0, $5da807cc202126ea$exports.MethodWrapper).Async
}
}, type)(target, event, descriptor));
};
const $c7384fc238b55cad$export$1e4ceaa741849ed7 = (nextOptions)=>{
return $c7384fc238b55cad$var$nextHelper(nextOptions, (0, $173529f42333421b$exports.PRE));
};
const $c7384fc238b55cad$export$d40ee6255ee433dd = (nextOptions)=>{
return $c7384fc238b55cad$var$nextHelper(nextOptions, (0, $173529f42333421b$exports.POST));
};
const $c7384fc238b55cad$export$c11bc0137fa2c80f = (nextOptions)=>{
const which = [
(0, $173529f42333421b$exports.PRE),
(0, $173529f42333421b$exports.POST)
];
return (target, event, descriptor)=>{
which.forEach((type)=>$c7384fc238b55cad$var$nextHelper(nextOptions, type)(target, event, descriptor));
};
};
const $c7384fc238b55cad$var$nextHelper = (hookOptions, type)=>{
return (target, event, descriptor)=>(0, $9nZ7L$jfrazxasarray.asArray)(hookOptions).forEach(({ action: action, options: options = {} })=>$c7384fc238b55cad$export$eedf49b4b69a5ead({
action: action,
type: type,
options: options
})(target, event, descriptor));
};
//# sourceMappingURL=surrogate.e7c8f145.js.map