Files
klz-cables.com/.pnpm-store/v10/files/9b/0ec94aa78371e8318a8370bf97787752196e86402514059271c5f7d2698d51c535ba3adc6f1c465e311dd3b6b0bad3a46e5f48e95ecb10ccd7afd2a2f5e357
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,"file":"format-fields.cjs","names":["fields"],"sources":["../../src/utils/format-fields.ts"],"sourcesContent":["export const formatFields = (fields: (string | Record<string, any>)[]) => {\n\ttype FieldItem = (typeof fields)[number];\n\n\tconst walkFields = (value: FieldItem, chain: string[] = []): string | string[] => {\n\t\tif (typeof value === 'object') {\n\t\t\tconst result = [];\n\n\t\t\tfor (const key in value) {\n\t\t\t\tconst nestedField = value[key as keyof typeof value] ?? [];\n\n\t\t\t\tif (Array.isArray(nestedField)) {\n\t\t\t\t\t// regular nested fields\n\t\t\t\t\tfor (const item of nestedField) {\n\t\t\t\t\t\tresult.push(walkFields(item as FieldItem, [...chain, key]));\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof nestedField === 'object') {\n\t\t\t\t\t// many to any nested\n\t\t\t\t\tfor (const scope of Object.keys(nestedField)) {\n\t\t\t\t\t\tconst fields = (nestedField as Record<string, FieldItem[]>)[scope]!;\n\n\t\t\t\t\t\tfor (const item of fields) {\n\t\t\t\t\t\t\tresult.push(walkFields(item as FieldItem, [...chain, `${key}:${scope}`]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result.flatMap((items) => items);\n\t\t}\n\n\t\treturn [...chain, String(value)].join('.');\n\t};\n\n\treturn fields.flatMap((value) => walkFields(value));\n};\n"],"mappings":"AAAA,MAAa,EAAgB,GAA6C,CAGzE,IAAM,GAAc,EAAkB,EAAkB,EAAE,GAAwB,CACjF,GAAI,OAAO,GAAU,SAAU,CAC9B,IAAM,EAAS,EAAE,CAEjB,IAAK,IAAM,KAAO,EAAO,CACxB,IAAM,EAAc,EAAM,IAA8B,EAAE,CAE1D,GAAI,MAAM,QAAQ,EAAY,CAE7B,IAAK,IAAM,KAAQ,EAClB,EAAO,KAAK,EAAW,EAAmB,CAAC,GAAG,EAAO,EAAI,CAAC,CAAC,SAElD,OAAO,GAAgB,SAEjC,IAAK,IAAM,KAAS,OAAO,KAAK,EAAY,CAAE,CAC7C,IAAMA,EAAU,EAA4C,GAE5D,IAAK,IAAM,KAAQA,EAClB,EAAO,KAAK,EAAW,EAAmB,CAAC,GAAG,EAAO,GAAG,EAAI,GAAG,IAAQ,CAAC,CAAC,EAM7E,OAAO,EAAO,QAAS,GAAU,EAAM,CAGxC,MAAO,CAAC,GAAG,EAAO,OAAO,EAAM,CAAC,CAAC,KAAK,IAAI,EAG3C,OAAO,EAAO,QAAS,GAAU,EAAW,EAAM,CAAC"}