UNPKG

surrogate

Version:

Object method hooks made easy

29 lines (21 loc) 1.05 kB
var $cad375f6cfe6fa82$exports = require("./surrogate.f983ed05.js"); var $25bd728115842876$exports = require("./surrogate.1f809ae8.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); } $parcel$export(module.exports, "BailRule", () => $1f16791af4a7434c$export$f08e3b44b0faa4e6); class $1f16791af4a7434c$export$f08e3b44b0faa4e6 extends (0, $25bd728115842876$exports.RecoverableRule) { shouldRun() { return Boolean(this.nextOptions.bail); } run(node) { const { options: options } = node.container; const { using: using, bailWith: bailWith } = this.nextOptions; const provider = new (0, $cad375f6cfe6fa82$exports.BailProvider)(node, using, bailWith); const shouldRecover = this.attemptRecovery(provider, options.runOnBail, node.useContext); shouldRecover ? this.recover(node, { bail: false }) : node.controller.bail(provider.bailUsing); } } //# sourceMappingURL=surrogate.945f16bb.js.map