Files
klz-cables.com/.pnpm-store/v10/files/d1/8d99a26ab7a5b04fb325d6a2ecfd83b6085451e605a505056c33e188026eb628ad1b644fca62bca7f795945856cac492776a76120af32202d7d66e0baa91ac
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

35 lines
1022 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.link = void 0;
const JSONSchema_1 = require("./types/JSONSchema");
const lodash_1 = require("lodash");
/**
* Traverses over the schema, giving each node a reference to its
* parent node. We need this for downstream operations.
*/
function link(schema, parent = null) {
if (!Array.isArray(schema) && !(0, lodash_1.isPlainObject)(schema)) {
return schema;
}
// Handle cycles
if (schema.hasOwnProperty(JSONSchema_1.Parent)) {
return schema;
}
// Add a reference to this schema's parent
Object.defineProperty(schema, JSONSchema_1.Parent, {
enumerable: false,
value: parent,
writable: false,
});
// Arrays
if (Array.isArray(schema)) {
schema.forEach(child => link(child, schema));
}
// Objects
for (const key in schema) {
link(schema[key], schema);
}
return schema;
}
exports.link = link;
//# sourceMappingURL=linker.js.map