Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
1 line
No EOL
1.5 KiB
Text
1 line
No EOL
1.5 KiB
Text
{"version":3,"sources":["../../../../src/shared/lib/page-path/remove-page-path-tail.ts"],"sourcesContent":["import { normalizePathSep } from './normalize-path-sep'\n\n/**\n * Removes the file extension for a page and the trailing `index` if it exists\n * making sure to not return an empty string. The page head is not touched\n * and returned as it is passed. Examples:\n * - `/foo/bar/baz/index.js` -> `/foo/bar/baz`\n * - `/foo/bar/baz.js` -> `/foo/bar/baz`\n *\n * @param pagePath A page to a page file (absolute or relative)\n * @param options.extensions Extensions allowed for the page.\n * @param options.keepIndex When true the trailing `index` is _not_ removed.\n */\nexport function removePagePathTail(\n pagePath: string,\n options: {\n extensions: ReadonlyArray<string>\n keepIndex?: boolean\n }\n) {\n pagePath = normalizePathSep(pagePath).replace(\n new RegExp(`\\\\.+(?:${options.extensions.join('|')})$`),\n ''\n )\n\n if (options.keepIndex !== true) {\n pagePath = pagePath.replace(/\\/index$/, '') || '/'\n }\n\n return pagePath\n}\n"],"names":["normalizePathSep","removePagePathTail","pagePath","options","replace","RegExp","extensions","join","keepIndex"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,uBAAsB;AAEvD;;;;;;;;;;CAUC,GACD,OAAO,SAASC,mBACdC,QAAgB,EAChBC,OAGC;IAEDD,WAAWF,iBAAiBE,UAAUE,OAAO,CAC3C,IAAIC,OAAO,CAAC,OAAO,EAAEF,QAAQG,UAAU,CAACC,IAAI,CAAC,KAAK,EAAE,CAAC,GACrD;IAGF,IAAIJ,QAAQK,SAAS,KAAK,MAAM;QAC9BN,WAAWA,SAASE,OAAO,CAAC,YAAY,OAAO;IACjD;IAEA,OAAOF;AACT","ignoreList":[0]} |