UNPKG

698 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.isRouteExcluded = exports.isRequestMethodAll = void 0;
4const common_1 = require("@nestjs/common");
5const isRequestMethodAll = (method) => {
6 return common_1.RequestMethod.ALL === method || method === -1;
7};
8exports.isRequestMethodAll = isRequestMethodAll;
9function isRouteExcluded(excludedRoutes, path, requestMethod) {
10 return excludedRoutes.some(route => {
11 if (exports.isRequestMethodAll(route.requestMethod) ||
12 route.requestMethod === requestMethod) {
13 return route.pathRegex.exec(path);
14 }
15 return false;
16 });
17}
18exports.isRouteExcluded = isRouteExcluded;