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 shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
6 | const isRequestMethodAll = (method) => {
|
7 | return common_1.RequestMethod.ALL === method || method === -1;
|
8 | };
|
9 | exports.isRequestMethodAll = isRequestMethodAll;
|
10 | function isRouteExcluded(excludedRoutes, path, requestMethod) {
|
11 | return excludedRoutes.some(route => {
|
12 | if ((0, exports.isRequestMethodAll)(route.requestMethod) ||
|
13 | route.requestMethod === requestMethod) {
|
14 | return route.pathRegex.exec((0, shared_utils_1.addLeadingSlash)(path));
|
15 | }
|
16 | return false;
|
17 | });
|
18 | }
|
19 | exports.isRouteExcluded = isRouteExcluded;
|