Server IP : 92.205.26.207 / Your IP : 216.73.216.16 Web Server : Apache System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64 User : zikryat ( 1002) PHP Version : 8.3.23 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/zikryat/public_html/node_modules/@nestjs/core/middleware/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RouteInfoPathExtractor = void 0; const common_1 = require("@nestjs/common"); const shared_utils_1 = require("@nestjs/common/utils/shared.utils"); const utils_1 = require("../router/utils"); const route_path_factory_1 = require("./../router/route-path-factory"); class RouteInfoPathExtractor { constructor(applicationConfig) { this.applicationConfig = applicationConfig; this.routePathFactory = new route_path_factory_1.RoutePathFactory(applicationConfig); this.prefixPath = (0, shared_utils_1.stripEndSlash)((0, shared_utils_1.addLeadingSlash)(this.applicationConfig.getGlobalPrefix())); this.excludedGlobalPrefixRoutes = this.applicationConfig.getGlobalPrefixOptions().exclude; this.versioningConfig = this.applicationConfig.getVersioning(); } extractPathsFrom({ path, method, version }) { const versionPath = this.extractVersionPathFrom(version); if (this.isAWildcard(path)) { return Array.isArray(this.excludedGlobalPrefixRoutes) ? [ this.prefixPath + versionPath + (0, shared_utils_1.addLeadingSlash)(path), ...this.excludedGlobalPrefixRoutes.map(route => versionPath + (0, shared_utils_1.addLeadingSlash)(route.path)), ] : [this.prefixPath + versionPath + (0, shared_utils_1.addLeadingSlash)(path)]; } return [this.extractNonWildcardPathFrom({ path, method, version })]; } extractPathFrom(route) { if (this.isAWildcard(route.path) && !route.version) { return (0, shared_utils_1.addLeadingSlash)(route.path); } return this.extractNonWildcardPathFrom(route); } isAWildcard(path) { return ['*', '/*', '/*/', '(.*)', '/(.*)'].includes(path); } extractNonWildcardPathFrom({ path, method, version, }) { const versionPath = this.extractVersionPathFrom(version); if (Array.isArray(this.excludedGlobalPrefixRoutes) && (0, utils_1.isRouteExcluded)(this.excludedGlobalPrefixRoutes, path, method)) { return versionPath + (0, shared_utils_1.addLeadingSlash)(path); } return this.prefixPath + versionPath + (0, shared_utils_1.addLeadingSlash)(path); } extractVersionPathFrom(version) { var _a; if (!version || ((_a = this.versioningConfig) === null || _a === void 0 ? void 0 : _a.type) !== common_1.VersioningType.URI) return ''; const versionPrefix = this.routePathFactory.getVersionPrefix(this.versioningConfig); return (0, shared_utils_1.addLeadingSlash)(versionPrefix + version.toString()); } } exports.RouteInfoPathExtractor = RouteInfoPathExtractor;