Files
klz-cables.com/.pnpm-store/v10/files/30/8afbf228c3f8442f72e0e0650510d6a9baa39e1a9adb6684c98a132fbdda990af45f2a730c9343fa0043df817947143f677cc3cc3b3c3706943016fcc727ec
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

1 line
1.8 KiB
Plaintext

{"version":3,"sources":["../../../../src/bin/generateImportMap/utilities/getImportMapToBaseDirPath.ts"],"sourcesContent":["import path from 'path'\n\n/**\n * Returns the path that navigates from the import map file to the base directory.\n * This can then be prepended to relative paths in the import map to get the full, absolute path.\n */\nexport function getImportMapToBaseDirPath({\n baseDir,\n importMapPath,\n}: {\n /**\n * Absolute path to the base directory\n */\n baseDir: string\n /**\n * Absolute path to the import map file\n */\n importMapPath: string\n}): string {\n const importMapDir = path.dirname(importMapPath)\n\n // 1. Direct relative path from `importMapDir` -> `baseDir`\n let relativePath = path.relative(importMapDir, baseDir).replace(/\\\\/g, '/')\n\n // 2. If they're the same directory, path.relative will be \"\", so use \"./\"\n if (!relativePath) {\n relativePath = './'\n } // Add ./ prefix for subdirectories of the current directory\n else if (!relativePath.startsWith('.') && !relativePath.startsWith('/')) {\n relativePath = `./${relativePath}`\n }\n\n // 3. For consistency ensure a trailing slash\n if (!relativePath.endsWith('/')) {\n relativePath += '/'\n }\n\n return relativePath\n}\n"],"names":["path","getImportMapToBaseDirPath","baseDir","importMapPath","importMapDir","dirname","relativePath","relative","replace","startsWith","endsWith"],"mappings":"AAAA,OAAOA,UAAU,OAAM;AAEvB;;;CAGC,GACD,OAAO,SAASC,0BAA0B,EACxCC,OAAO,EACPC,aAAa,EAUd;IACC,MAAMC,eAAeJ,KAAKK,OAAO,CAACF;IAElC,2DAA2D;IAC3D,IAAIG,eAAeN,KAAKO,QAAQ,CAACH,cAAcF,SAASM,OAAO,CAAC,OAAO;IAEvE,0EAA0E;IAC1E,IAAI,CAACF,cAAc;QACjBA,eAAe;IACjB,OACK,IAAI,CAACA,aAAaG,UAAU,CAAC,QAAQ,CAACH,aAAaG,UAAU,CAAC,MAAM;QACvEH,eAAe,CAAC,EAAE,EAAEA,cAAc;IACpC;IAEA,6CAA6C;IAC7C,IAAI,CAACA,aAAaI,QAAQ,CAAC,MAAM;QAC/BJ,gBAAgB;IAClB;IAEA,OAAOA;AACT"}