Files
klz-cables.com/.pnpm-store/v10/files/aa/e3c6d22cde5ed29815bf9bd193561514dfe14411199b9dffd32cded83e2747f5b49bce8e0d24c5229d81f5c406f23603e9852ab23517af8c58788ecbe60a2a
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

51 lines
1.4 KiB
Plaintext

'use strict';
var plugin = require('./plugin-YzBhQjAo.cjs');
var ExtractorCodec = require('./ExtractorCodec-D9Tw618d.cjs');
require('fs/promises');
require('path');
require('@parcel/watcher');
require('fs');
require('module');
require('@swc/core');
var JSONCodec = ExtractorCodec.defineCodec(() => ({
decode(source) {
const json = JSON.parse(source);
const messages = [];
traverseMessages(json, (message, id) => {
messages.push({
id,
message
});
});
return messages;
},
encode(messages) {
const root = {};
for (const message of plugin.getSortedMessages(messages)) {
plugin.setNestedProperty(root, message.id, message.message);
}
return JSON.stringify(root, null, 2) + '\n';
},
toJSONString(source) {
return source;
}
}));
function traverseMessages(obj, callback, path = '') {
const NAMESPACE_SEPARATOR = '.';
for (const key of Object.keys(obj)) {
const newPath = path ? path + NAMESPACE_SEPARATOR + key : key;
const value = obj[key];
if (typeof value === 'string') {
callback(value, newPath);
} else if (Array.isArray(value)) {
throw new Error(`Message at \`${newPath}\` resolved to an array, but only strings are supported. See https://next-intl.dev/docs/usage/translations#arrays-of-messages`);
} else if (typeof value === 'object') {
traverseMessages(value, callback, newPath);
}
}
}
exports.default = JSONCodec;