Files
klz-cables.com/.pnpm-store/v10/files/4d/5a7a1882c0bebcb09ef0227ff1cd1e20d07012e6ba46ae863571110e33d4b68b0c01bd75111cdc13b66d2947616648f0b47f48fdcd20041a698b92c9d0bdca
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

134 lines
3.5 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ب|ك)/i,
wide: /^(مىيلادىدىن بۇرۇن|مىيلادىدىن كىيىن)/i,
};
const parseEraPatterns = {
any: [/^بۇرۇن/i, /^كىيىن/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^چ[1234]/i,
wide: /^چارەك [1234]/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
// eslint-disable-next-line no-misleading-character-class
narrow: /^[يفمئامئ‍ئاسۆند]/i,
abbreviated:
/^(يانۋار|فېۋىرال|مارت|ئاپرىل|ماي|ئىيۇن|ئىيول|ئاۋغۇست|سىنتەبىر|ئۆكتەبىر|نويابىر|دىكابىر)/i,
wide: /^(يانۋار|فېۋىرال|مارت|ئاپرىل|ماي|ئىيۇن|ئىيول|ئاۋغۇست|سىنتەبىر|ئۆكتەبىر|نويابىر|دىكابىر)/i,
};
const parseMonthPatterns = {
narrow: [
/^ي/i,
/^ف/i,
/^م/i,
/^ا/i,
/^م/i,
/^ى‍/i,
/^ى‍/i,
/^ا/i,
/^س/i,
/^ۆ/i,
/^ن/i,
/^د/i,
],
any: [
/^يان/i,
/^فېۋ/i,
/^مار/i,
/^ئاپ/i,
/^ماي/i,
/^ئىيۇن/i,
/^ئىيول/i,
/^ئاۋ/i,
/^سىن/i,
/^ئۆك/i,
/^نوي/i,
/^دىك/i,
],
};
const matchDayPatterns = {
narrow: /^[دسچپجشي]/i,
short: /^(يە|دۈ|سە|چا|پە|جۈ|شە)/i,
abbreviated: /^(يە|دۈ|سە|چا|پە|جۈ|شە)/i,
wide: /^(يەكشەنبە|دۈشەنبە|سەيشەنبە|چارشەنبە|پەيشەنبە|جۈمە|شەنبە)/i,
};
const parseDayPatterns = {
narrow: [/^ي/i, /^د/i, /^س/i, /^چ/i, /^پ/i, /^ج/i, /^ش/i],
any: [/^ي/i, /^د/i, /^س/i, /^چ/i, /^پ/i, /^ج/i, /^ش/i],
};
const matchDayPeriodPatterns = {
narrow: /^(ئە|چ|ك|چ|(دە|ئەتىگەن) ( ئە‍|چۈشتىن كىيىن|ئاخشىم|كىچە))/i,
any: /^(ئە|چ|ك|چ|(دە|ئەتىگەن) ( ئە‍|چۈشتىن كىيىن|ئاخشىم|كىچە))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^ئە/i,
pm: /^چ/i,
midnight: /^ك/i,
noon: /^چ/i,
morning: /ئەتىگەن/i,
afternoon: /چۈشتىن كىيىن/i,
evening: /ئاخشىم/i,
night: /كىچە/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};