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