UNPKG

surrogate

Version:

Object method hooks made easy

27 lines 729 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HandlerBaseRule = void 0; class HandlerBaseRule { constructor(node) { this.node = node; } shouldRunWithoutArgs() { return this.options.noArgs; } shouldRunWithArgs() { return !this.shouldRunWithoutArgs(); } get options() { return this.node.container.options; } get handler() { const { container, context } = this.node; return container.getHandler(context); } get context() { const { context } = this.node; return context.determineContext(this.options); } } exports.HandlerBaseRule = HandlerBaseRule; //# sourceMappingURL=index.js.map