| Server IP : 159.203.156.69 / Your IP : 216.73.217.172 Web Server : nginx/1.24.0 System : Linux main-ubuntu 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/tanviranik.com/node_modules/vinext/dist/utils/ |
Upload File : |
{"version":3,"file":"base-path.js","names":[],"sources":["../../src/utils/base-path.ts"],"sourcesContent":["/**\n * Shared basePath helpers.\n *\n * Next.js only treats a pathname as being under basePath when it is an exact\n * match (\"/app\") or starts with the basePath followed by a path separator\n * (\"/app/...\"). Prefix-only matches like \"/application\" must be left intact.\n */\n\n/**\n * Check whether a pathname is inside the configured basePath.\n */\nexport function hasBasePath(pathname: string, basePath: string): boolean {\n if (!basePath) return false;\n return pathname === basePath || pathname.startsWith(basePath + \"/\");\n}\n\n/**\n * Strip the basePath prefix from a pathname when it matches on a segment\n * boundary. Returns the original pathname when it is outside the basePath.\n */\nexport function stripBasePath(pathname: string, basePath: string): string {\n if (!hasBasePath(pathname, basePath)) return pathname;\n return pathname.slice(basePath.length) || \"/\";\n}\n\n/**\n * Remove trailing slashes from a pathname while preserving the root \"/\".\n * Collapses any number of trailing slashes (\"/a//\" → \"/a\"). Used by the\n * trailing-slash redirect path and route pattern normalization.\n */\nexport function removeTrailingSlash(pathname: string): string {\n if (pathname === \"/\") return \"/\";\n let end = pathname.length;\n while (end > 0 && pathname.charCodeAt(end - 1) === 47 /* \"/\" */) end--;\n return end === 0 ? \"/\" : pathname.slice(0, end);\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,YAAY,UAAkB,UAA2B;CACvE,IAAI,CAAC,UAAU,OAAO;CACtB,OAAO,aAAa,YAAY,SAAS,WAAW,WAAW,IAAI;;;;;;AAOrE,SAAgB,cAAc,UAAkB,UAA0B;CACxE,IAAI,CAAC,YAAY,UAAU,SAAS,EAAE,OAAO;CAC7C,OAAO,SAAS,MAAM,SAAS,OAAO,IAAI;;;;;;;AAQ5C,SAAgB,oBAAoB,UAA0B;CAC5D,IAAI,aAAa,KAAK,OAAO;CAC7B,IAAI,MAAM,SAAS;CACnB,OAAO,MAAM,KAAK,SAAS,WAAW,MAAM,EAAE,KAAK,IAAc;CACjE,OAAO,QAAQ,IAAI,MAAM,SAAS,MAAM,GAAG,IAAI"}