UNPKG

@n1k1t/mock-server

Version:

Powerful util to setup mocks over HTTP APIs

27 lines 981 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const operator_1 = require("../models/operator"); class AndExpectationOperator 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.every((operator) => operator.match(context)); } manipulate(context) { this.compiled.forEach((operator) => operator.manipulate(context)); return context; } } exports.default = AndExpectationOperator; //# sourceMappingURL=and.operator.js.map