UNPKG

surrogate

Version:

Object method hooks made easy

41 lines (32 loc) 1.32 kB
var $fcfa68ed0c91f741$exports = require("./surrogate.c2e9f688.js"); var $08ea7cd0e0c2c846$exports = require("./surrogate.e7f9b415.js"); var $6d0fe89abc51fb27$exports = require("./surrogate.71122426.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); } $parcel$export(module.exports, "Next", () => $4ed603774e6e90ac$export$b820fc49f2736e85); class $4ed603774e6e90ac$export$b820fc49f2736e85 extends (0, $6d0fe89abc51fb27$exports.BaseNext) { skipWith(times = 1, ...args) { if (times > 0) { this.controller.setNext(this.nextNode); return this.nextNode.skipWith(times - 1, ...args); } return this.nextNode.handleNext({ using: args }); } handleNext(nextOptions = {}) { const useNextOptions = { ...(0, $08ea7cd0e0c2c846$exports.nextOptionDefaults), ...nextOptions }; const { using: using } = useNextOptions; const rules = [ new (0, $fcfa68ed0c91f741$exports.HandlerRule)(this, using), new (0, $fcfa68ed0c91f741$exports.SkipRule)() ]; const rule = rules.find((runner)=>runner.shouldRun()); rule.run(this); } } //# sourceMappingURL=surrogate.2c1bc1cb.js.map