UNPKG

tethysfaceid

Version:

1 lines 914 B
{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.removePathTrailingSlash = removePathTrailingSlash;\nexports.normalizePathTrailingSlash = void 0;\n/**\n* Removes the trailing slash of a path if there is one. Preserves the root path `/`.\n*/\n\nfunction removePathTrailingSlash(path) {\n return path.endsWith('/') && path !== '/' ? path.slice(0, -1) : path;\n}\n/**\n* Normalizes the trailing slash of a path according to the `trailingSlash` option\n* in `next.config.js`.\n*/\n\n\nvar normalizePathTrailingSlash = process.env.__NEXT_TRAILING_SLASH ? function (path) {\n if (/\\.[^/]+\\/?$/.test(path)) {\n return removePathTrailingSlash(path);\n } else if (path.endsWith('/')) {\n return path;\n } else {\n return path + '/';\n }\n} : removePathTrailingSlash;\nexports.normalizePathTrailingSlash = normalizePathTrailingSlash;","map":null,"metadata":{},"sourceType":"script"}