UNPKG

@n1k1t/mock-server

Version:

Powerful util to setup mocks over HTTP APIs

27 lines 977 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const operator_1 = require("../models/operator"); class OrExpectationOperator extends operator_1.ExpectationOperator { constructor() { super(...arguments); this.compiled = this.command .map((schema) => this.extractNestedSchema(schema)) .filter(Boolean) .map((extracted) => { const Operator = this.operators[extracted.key]; return new Operator(this.operators, extracted.nested); }); } get tags() { return this.compiled.reduce((acc, operator) => acc.concat(operator.tags), []); } match(context) { return this.compiled.some((operator) => operator.match(context)); } manipulate(context) { this.compiled.forEach((operator) => operator.manipulate(context)); return context; } } exports.default = OrExpectationOperator; //# sourceMappingURL=or.operator.js.map