surrogate
Version:
Object method hooks made easy
28 lines (21 loc) • 807 B
JavaScript
var $4twxF$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, "RecoverableRule", () => $25bd728115842876$export$77a30a1c4c68ceb);
class $25bd728115842876$export$77a30a1c4c68ceb {
constructor(nextOptions){
this.nextOptions = nextOptions;
}
attemptRecovery(provider, recoverable, context) {
(0, $4twxF$jfrazxasarray.asArray)(recoverable).forEach((recover)=>recover.call(context, provider));
return provider.shouldRecover;
}
recover(node, overrideOptions) {
node.next({
...this.nextOptions,
...overrideOptions
});
}
}
//# sourceMappingURL=surrogate.1f809ae8.js.map