Files
klz-cables.com/.pnpm-store/v10/files/2f/42fee47cb1c250f5a324f3ec92fbad8ac8aed9a5443e45ffc4b4babaf3bf8c0b8cb76b79c8565911d73347c19828d88ea48a0d943bf51c94b8e411b4e50bd8
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
628 B
Plaintext

import { BestAvailableLocale } from "./BestAvailableLocale.js";
import { UNICODE_EXTENSION_SEQUENCE_REGEX } from "./utils.js";
/**
* https://tc39.es/ecma402/#sec-lookupsupportedlocales
* @param availableLocales
* @param requestedLocales
*/
export function LookupSupportedLocales(availableLocales, requestedLocales) {
const subset = [];
for (const locale of requestedLocales) {
const noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
const availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);
if (availableLocale) {
subset.push(availableLocale);
}
}
return subset;
}