Files
klz-cables.com/.pnpm-store/v10/files/a9/5770419f555c1b2250a638458f1e811bea0c61eb205a35c95d1185ce12b4d33172a63a14bd3215f057d410e17e65b86147567007f7a2f0a8a6104fdebada63
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

/**
* Replaces constructor functions in module exports, handling read-only properties,
* and both default and named exports by wrapping them with the constructor.
*
* @param exports The module exports object to modify
* @param exportName The name of the export to replace (e.g., 'GoogleGenAI', 'Anthropic', 'OpenAI')
* @param wrappedConstructor The wrapped constructor function to replace the original with
* @returns void
*/
function replaceExports(
exports$1,
exportName,
wrappedConstructor,
) {
const original = exports$1[exportName];
if (typeof original !== 'function') {
return;
}
// Replace the named export - handle read-only properties
try {
exports$1[exportName] = wrappedConstructor;
} catch (error) {
// If direct assignment fails, override the property descriptor
Object.defineProperty(exports$1, exportName, {
value: wrappedConstructor,
writable: true,
configurable: true,
enumerable: true,
});
}
// Replace the default export if it points to the original constructor
if (exports$1.default === original) {
try {
exports$1.default = wrappedConstructor;
} catch (error) {
Object.defineProperty(exports$1, 'default', {
value: wrappedConstructor,
writable: true,
configurable: true,
enumerable: true,
});
}
}
}
export { replaceExports };
//# sourceMappingURL=exports.js.map