Files
klz-cables.com/.pnpm-store/v10/files/92/4e56b2cd71f4a2a227c96d8463075b614cd27b6a84e6867a7fbac01f8b51a4ebf60809493e3b85fcf6d66e0cdd5d413e73418d138e321a68fac94fb73936c3
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

19 lines
435 B
Plaintext

/**
* https://tc39.es/ecma402/#sec-defaultnumberoption
* @param val
* @param min
* @param max
* @param fallback
*/
export function DefaultNumberOption(inputVal, min, max, fallback) {
if (inputVal === undefined) {
// @ts-expect-error
return fallback;
}
const val = Number(inputVal);
if (isNaN(val) || val < min || val > max) {
throw new RangeError(`${val} is outside of range [${min}, ${max}]`);
}
return Math.floor(val);
}