bridgets
Version:
<p align="center"> <a href="https://bridgets.co"> <img src="http://bridgets.co/assets/logo-short.svg" height="48" /> <h1 align="center">BridgeTS</h1> </a> </p>
19 lines • 659 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MethodValidator = void 0;
const handler_1 = require("../handler");
const Errors_1 = require("../../Errors");
class MethodValidator extends handler_1.AbstractHandler {
method;
constructor(method) {
super();
this.method = method;
}
handle = async (data) => {
if (!this.method || data.method === this.method)
return super.handle(data);
return (0, Errors_1.httpError)('Not Found', 'Wrong method', { method: this.method });
};
}
exports.MethodValidator = MethodValidator;
//# sourceMappingURL=methodValidator.js.map