UNPKG

request-mocking-protocol

Version:
18 lines 569 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MethodMatcher = void 0; class MethodMatcher { schema; constructor(schema) { this.schema = schema; } match(ctx) { const expectedMethod = this.schema.method; const actualMethod = ctx.req.method; const result = !expectedMethod || expectedMethod === actualMethod; ctx.log(result, `method`, expectedMethod || '*', actualMethod); return result; } } exports.MethodMatcher = MethodMatcher; //# sourceMappingURL=method.js.map