Files
klz-cables.com/.pnpm-store/v10/files/18/9f7e2e37badca9c3755755688ddeb3f00e3a57dec32ad5721f4e846795841d6c11e290ad73bde9e2133151d20b4101ba0f5917094b0a2f1e6c14ae6cd74c30
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

64 lines
1.5 KiB
Plaintext

/**
* https://tc39.es/ecma402/#table-sanctioned-simple-unit-identifiers
*/
export const SANCTIONED_UNITS = [
"angle-degree",
"area-acre",
"area-hectare",
"concentr-percent",
"digital-bit",
"digital-byte",
"digital-gigabit",
"digital-gigabyte",
"digital-kilobit",
"digital-kilobyte",
"digital-megabit",
"digital-megabyte",
"digital-petabyte",
"digital-terabit",
"digital-terabyte",
"duration-day",
"duration-hour",
"duration-millisecond",
"duration-minute",
"duration-month",
"duration-second",
"duration-week",
"duration-year",
"length-centimeter",
"length-foot",
"length-inch",
"length-kilometer",
"length-meter",
"length-mile-scandinavian",
"length-mile",
"length-millimeter",
"length-yard",
"mass-gram",
"mass-kilogram",
"mass-ounce",
"mass-pound",
"mass-stone",
"temperature-celsius",
"temperature-fahrenheit",
"volume-fluid-ounce",
"volume-gallon",
"volume-liter",
"volume-milliliter"
];
// In CLDR, the unit name always follows the form `namespace-unit` pattern.
// For example: `digital-bit` instead of `bit`. This function removes the namespace prefix.
export function removeUnitNamespace(unit) {
return unit.slice(unit.indexOf("-") + 1);
}
/**
* https://tc39.es/ecma402/#table-sanctioned-simple-unit-identifiers
*/
export const SIMPLE_UNITS = SANCTIONED_UNITS.map(removeUnitNamespace);
/**
* https://tc39.es/ecma402/#sec-issanctionedsimpleunitidentifier
*/
export function IsSanctionedSimpleUnitIdentifier(unitIdentifier) {
return SIMPLE_UNITS.indexOf(unitIdentifier) > -1;
}