UNPKG

@prizemates/http-firewall

Version:

HTTP Firewall based on Spring Security HttpFirewall

17 lines 778 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Predicate = void 0; class Predicate { constructor(condition) { this.condition = condition; this.and = (input) => Predicate.of((x) => this.test(x) && Predicate.isInstance(input).test(x)); this.or = (input) => Predicate.of((x) => this.test(x) || Predicate.isInstance(input).test(x)); // noinspection JSUnusedGlobalSymbols this.not = () => Predicate.of((x) => !this.test(x)); this.test = (x) => this.condition(x); } } exports.Predicate = Predicate; Predicate.of = (condition) => new Predicate(condition); Predicate.isInstance = (input) => input instanceof Predicate ? input : Predicate.of(input); //# sourceMappingURL=firewall.models.js.map