Files
klz-cables.com/.pnpm-store/v10/files/6f/603b2d8d7ac32d6837bc9a2e2ad326ff2cd0ca66b3a0b00cb5a02588e42aab563e20a11dad1e4636e6ca85e9e6ee1d72b9684834d82b689d95bcca986127fc
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
948 B
Plaintext

/**
* Extracts the value from an option-like object or string.
*/ const getOptionValue = (option)=>{
if (typeof option === 'string') {
return option;
}
return option.value;
};
/**
* Compares two arrays of options by their values.
* Returns true if both arrays contain the same values (order-independent).
*/ export const optionsAreEqual = (options1, options2)=>{
if (!options1 && !options2) {
return true;
}
if (!options1 || !options2) {
return false;
}
if (options1.length !== options2.length) {
return false;
}
const values1 = new Set(options1.map(getOptionValue));
const values2 = new Set(options2.map(getOptionValue));
if (values1.size !== values2.size) {
return false;
}
for (const value of values1){
if (!values2.has(value)) {
return false;
}
}
return true;
};
//# sourceMappingURL=optionsAreEqual.js.map