Files
klz-cables.com/.pnpm-store/v10/files/09/067ed6b772812a9a0ae8f2a400000cb6edf6d5ba6a2276048bb28f1ac390ce21c96b40a26475ab59c1f697867badf269d3f3a2b11bc7a8b6b4e2f453cf1716
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":"request.js","names":["result: { response: unknown; message: string; errors: any; data?: any }"],"sources":["../../src/utils/request.ts"],"sourcesContent":["import type { FetchInterface } from '../index.js';\nimport { extractData } from './extract-data.js';\n\n/**\n * Request helper providing default settings\n *\n * @param url The request URL\n * @param options The request options\n *\n * @returns The API result if successful\n */\nexport const request = async <Output = any>(\n\turl: string,\n\toptions: RequestInit,\n\tfetcher: FetchInterface = globalThis.fetch,\n): Promise<Output> => {\n\toptions.headers =\n\t\ttypeof options.headers === 'object' && !Array.isArray(options.headers)\n\t\t\t? (options.headers as Record<string, string>)\n\t\t\t: {};\n\n\treturn fetcher(url, options).then((response) => {\n\t\treturn extractData(response).catch((reason) => {\n\t\t\tconst result: { response: unknown; message: string; errors: any; data?: any } = {\n\t\t\t\tmessage: '',\n\t\t\t\terrors: reason && typeof reason === 'object' && 'errors' in reason ? reason.errors : reason,\n\t\t\t\tresponse,\n\t\t\t};\n\n\t\t\tif (reason && typeof reason === 'object' && 'data' in reason) result.data = reason.data;\n\n\t\t\tif (Array.isArray(result.errors) && result.errors[0]?.message) {\n\t\t\t\tresult.message = result.errors[0].message;\n\t\t\t}\n\n\t\t\treturn Promise.reject(result);\n\t\t});\n\t});\n};\n"],"mappings":"gDAWA,MAAa,EAAU,MACtB,EACA,EACA,EAA0B,WAAW,SAErC,EAAQ,QACP,OAAO,EAAQ,SAAY,UAAY,CAAC,MAAM,QAAQ,EAAQ,QAAQ,CAClE,EAAQ,QACT,EAAE,CAEC,EAAQ,EAAK,EAAQ,CAAC,KAAM,GAC3B,EAAY,EAAS,CAAC,MAAO,GAAW,CAC9C,IAAMA,EAA0E,CAC/E,QAAS,GACT,OAAQ,GAAU,OAAO,GAAW,UAAY,WAAY,EAAS,EAAO,OAAS,EACrF,WACA,CAQD,OANI,GAAU,OAAO,GAAW,UAAY,SAAU,IAAQ,EAAO,KAAO,EAAO,MAE/E,MAAM,QAAQ,EAAO,OAAO,EAAI,EAAO,OAAO,IAAI,UACrD,EAAO,QAAU,EAAO,OAAO,GAAG,SAG5B,QAAQ,OAAO,EAAO,EAC5B,CACD"}