main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
import type { FormatDistanceFn } from "../../types.js";
export declare const formatDistance: FormatDistanceFn;

View File

@@ -0,0 +1,2 @@
import type { FormatDistanceFn } from "../../types.js";
export declare const formatDistance: FormatDistanceFn;

105
node_modules/date-fns/locale/oc/_lib/formatDistance.js generated vendored Normal file
View File

@@ -0,0 +1,105 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "mens duna segonda",
other: "mens de {{count}} segondas",
},
xSeconds: {
one: "1 segonda",
other: "{{count}} segondas",
},
halfAMinute: "30 segondas",
lessThanXMinutes: {
one: "mens duna minuta",
other: "mens de {{count}} minutas",
},
xMinutes: {
one: "1 minuta",
other: "{{count}} minutas",
},
aboutXHours: {
one: "environ 1 ora",
other: "environ {{count}} oras",
},
xHours: {
one: "1 ora",
other: "{{count}} oras",
},
xDays: {
one: "1 jorn",
other: "{{count}} jorns",
},
aboutXWeeks: {
one: "environ 1 setmana",
other: "environ {{count}} setmanas",
},
xWeeks: {
one: "1 setmana",
other: "{{count}} setmanas",
},
aboutXMonths: {
one: "environ 1 mes",
other: "environ {{count}} meses",
},
xMonths: {
one: "1 mes",
other: "{{count}} meses",
},
aboutXYears: {
one: "environ 1 an",
other: "environ {{count}} ans",
},
xYears: {
one: "1 an",
other: "{{count}} ans",
},
overXYears: {
one: "mai dun an",
other: "mai de {{count}} ans",
},
almostXYears: {
one: "gaireben un an",
other: "gaireben {{count}} ans",
},
};
const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "daquí " + result;
} else {
return "fa " + result;
}
}
return result;
};
exports.formatDistance = formatDistance;

101
node_modules/date-fns/locale/oc/_lib/formatDistance.mjs generated vendored Normal file
View File

@@ -0,0 +1,101 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: "mens duna segonda",
other: "mens de {{count}} segondas",
},
xSeconds: {
one: "1 segonda",
other: "{{count}} segondas",
},
halfAMinute: "30 segondas",
lessThanXMinutes: {
one: "mens duna minuta",
other: "mens de {{count}} minutas",
},
xMinutes: {
one: "1 minuta",
other: "{{count}} minutas",
},
aboutXHours: {
one: "environ 1 ora",
other: "environ {{count}} oras",
},
xHours: {
one: "1 ora",
other: "{{count}} oras",
},
xDays: {
one: "1 jorn",
other: "{{count}} jorns",
},
aboutXWeeks: {
one: "environ 1 setmana",
other: "environ {{count}} setmanas",
},
xWeeks: {
one: "1 setmana",
other: "{{count}} setmanas",
},
aboutXMonths: {
one: "environ 1 mes",
other: "environ {{count}} meses",
},
xMonths: {
one: "1 mes",
other: "{{count}} meses",
},
aboutXYears: {
one: "environ 1 an",
other: "environ {{count}} ans",
},
xYears: {
one: "1 an",
other: "{{count}} ans",
},
overXYears: {
one: "mai dun an",
other: "mai de {{count}} ans",
},
almostXYears: {
one: "gaireben un an",
other: "gaireben {{count}} ans",
},
};
export const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "daquí " + result;
} else {
return "fa " + result;
}
}
return result;
};

View File

@@ -0,0 +1,2 @@
import type { FormatLong } from "../../types.js";
export declare const formatLong: FormatLong;

2
node_modules/date-fns/locale/oc/_lib/formatLong.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { FormatLong } from "../../types.js";
export declare const formatLong: FormatLong;

41
node_modules/date-fns/locale/oc/_lib/formatLong.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
const dateFormats = {
full: "EEEE d 'de' MMMM y",
long: "d 'de' MMMM y",
medium: "d MMM y",
short: "dd/MM/y",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'a' {{time}}",
long: "{{date}} 'a' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
const formatLong = (exports.formatLong = {
date: (0, _index.buildFormatLongFn)({
formats: dateFormats,
defaultWidth: "full",
}),
time: (0, _index.buildFormatLongFn)({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: (0, _index.buildFormatLongFn)({
formats: dateTimeFormats,
defaultWidth: "full",
}),
});

39
node_modules/date-fns/locale/oc/_lib/formatLong.mjs generated vendored Normal file
View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE d 'de' MMMM y",
long: "d 'de' MMMM y",
medium: "d MMM y",
short: "dd/MM/y",
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'a' {{time}}",
long: "{{date}} 'a' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};

View File

@@ -0,0 +1,2 @@
import type { FormatRelativeFn } from "../../types.js";
export declare const formatRelative: FormatRelativeFn;

View File

@@ -0,0 +1,2 @@
import type { FormatRelativeFn } from "../../types.js";
export declare const formatRelative: FormatRelativeFn;

15
node_modules/date-fns/locale/oc/_lib/formatRelative.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "eeee 'passat a' p",
yesterday: "'ièr a' p",
today: "'uèi a' p",
tomorrow: "'deman a' p",
nextWeek: "eeee 'a' p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,11 @@
const formatRelativeLocale = {
lastWeek: "eeee 'passat a' p",
yesterday: "'ièr a' p",
today: "'uèi a' p",
tomorrow: "'deman a' p",
nextWeek: "eeee 'a' p",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];

2
node_modules/date-fns/locale/oc/_lib/localize.d.mts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { Localize } from "../../types.js";
export declare const localize: Localize;

2
node_modules/date-fns/locale/oc/_lib/localize.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { Localize } from "../../types.js";
export declare const localize: Localize;

205
node_modules/date-fns/locale/oc/_lib/localize.js generated vendored Normal file
View File

@@ -0,0 +1,205 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["ab. J.C.", "apr. J.C."],
abbreviated: ["ab. J.C.", "apr. J.C."],
wide: ["abans Jèsus-Crist", "après Jèsus-Crist"],
};
const quarterValues = {
narrow: ["T1", "T2", "T3", "T4"],
abbreviated: ["1èr trim.", "2nd trim.", "3en trim.", "4en trim."],
wide: ["1èr trimèstre", "2nd trimèstre", "3en trimèstre", "4en trimèstre"],
};
const monthValues = {
narrow: [
"GN",
"FB",
"MÇ",
"AB",
"MA",
"JN",
"JL",
"AG",
"ST",
"OC",
"NV",
"DC",
],
abbreviated: [
"gen.",
"febr.",
"març",
"abr.",
"mai",
"junh",
"jul.",
"ag.",
"set.",
"oct.",
"nov.",
"dec.",
],
wide: [
"genièr",
"febrièr",
"març",
"abril",
"mai",
"junh",
"julhet",
"agost",
"setembre",
"octòbre",
"novembre",
"decembre",
],
};
const dayValues = {
narrow: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
short: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
abbreviated: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
wide: [
"dimenge",
"diluns",
"dimars",
"dimècres",
"dijòus",
"divendres",
"dissabte",
],
};
const dayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
abbreviated: {
am: "a.m.",
pm: "p.m.",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
wide: {
am: "ante meridiem",
pm: "post meridiem",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
let ordinal;
switch (number) {
case 1:
ordinal = "èr";
break;
case 2:
ordinal = "nd";
break;
default:
ordinal = "en";
}
// feminine for year, week, hour, minute, second
if (
unit === "year" ||
unit === "week" ||
unit === "hour" ||
unit === "minute" ||
unit === "second"
) {
ordinal += "a";
}
return number + ordinal;
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

203
node_modules/date-fns/locale/oc/_lib/localize.mjs generated vendored Normal file
View File

@@ -0,0 +1,203 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["ab. J.C.", "apr. J.C."],
abbreviated: ["ab. J.C.", "apr. J.C."],
wide: ["abans Jèsus-Crist", "après Jèsus-Crist"],
};
const quarterValues = {
narrow: ["T1", "T2", "T3", "T4"],
abbreviated: ["1èr trim.", "2nd trim.", "3en trim.", "4en trim."],
wide: ["1èr trimèstre", "2nd trimèstre", "3en trimèstre", "4en trimèstre"],
};
const monthValues = {
narrow: [
"GN",
"FB",
"MÇ",
"AB",
"MA",
"JN",
"JL",
"AG",
"ST",
"OC",
"NV",
"DC",
],
abbreviated: [
"gen.",
"febr.",
"març",
"abr.",
"mai",
"junh",
"jul.",
"ag.",
"set.",
"oct.",
"nov.",
"dec.",
],
wide: [
"genièr",
"febrièr",
"març",
"abril",
"mai",
"junh",
"julhet",
"agost",
"setembre",
"octòbre",
"novembre",
"decembre",
],
};
const dayValues = {
narrow: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
short: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
abbreviated: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
wide: [
"dimenge",
"diluns",
"dimars",
"dimècres",
"dijòus",
"divendres",
"dissabte",
],
};
const dayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
abbreviated: {
am: "a.m.",
pm: "p.m.",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
wide: {
am: "ante meridiem",
pm: "post meridiem",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
let ordinal;
switch (number) {
case 1:
ordinal = "èr";
break;
case 2:
ordinal = "nd";
break;
default:
ordinal = "en";
}
// feminine for year, week, hour, minute, second
if (
unit === "year" ||
unit === "week" ||
unit === "hour" ||
unit === "minute" ||
unit === "second"
) {
ordinal += "a";
}
return number + ordinal;
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

2
node_modules/date-fns/locale/oc/_lib/match.d.mts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { Match } from "../../types.js";
export declare const match: Match;

2
node_modules/date-fns/locale/oc/_lib/match.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import type { Match } from "../../types.js";
export declare const match: Match;

130
node_modules/date-fns/locale/oc/_lib/match.js generated vendored Normal file
View File

@@ -0,0 +1,130 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(\d+)(èr|nd|en)?[a]?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ab\.J\.C|apr\.J\.C|apr\.J\.-C)/i,
abbreviated: /^(ab\.J\.-C|ab\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
wide: /^(abans Jèsus-Crist|après Jèsus-Crist)/i,
};
const parseEraPatterns = {
any: [/^ab/i, /^ap/i],
};
const matchQuarterPatterns = {
narrow: /^T[1234]/i,
abbreviated: /^[1234](èr|nd|en)? trim\.?/i,
wide: /^[1234](èr|nd|en)? trimèstre/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(GN|FB|MÇ|AB|MA|JN|JL|AG|ST|OC|NV|DC)/i,
abbreviated: /^(gen|febr|març|abr|mai|junh|jul|ag|set|oct|nov|dec)\.?/i,
wide: /^(genièr|febrièr|març|abril|mai|junh|julhet|agost|setembre|octòbre|novembre|decembre)/i,
};
const parseMonthPatterns = {
any: [
/^g/i,
/^f/i,
/^ma[r?]|MÇ/i,
/^ab/i,
/^ma[i?]/i,
/^ju[n?]|JN/i,
/^ju[l?]|JL/i,
/^ag/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^d[glmcjvs]\.?/i,
short: /^d[glmcjvs]\.?/i,
abbreviated: /^d[glmcjvs]\.?/i,
wide: /^(dimenge|diluns|dimars|dimècres|dijòus|divendres|dissabte)/i,
};
const parseDayPatterns = {
narrow: [/^dg/i, /^dl/i, /^dm/i, /^dc/i, /^dj/i, /^dv/i, /^ds/i],
short: [/^dg/i, /^dl/i, /^dm/i, /^dc/i, /^dj/i, /^dv/i, /^ds/i],
abbreviated: [/^dg/i, /^dl/i, /^dm/i, /^dc/i, /^dj/i, /^dv/i, /^ds/i],
any: [
/^dg|dime/i,
/^dl|dil/i,
/^dm|dima/i,
/^dc|dimè/i,
/^dj|dij/i,
/^dv|div/i,
/^ds|dis/i,
],
};
const matchDayPeriodPatterns = {
any: /(^(a\.?m|p\.?m))|(ante meridiem|post meridiem)|((del |de la |de l)(matin|aprèp-miègjorn|vèspre|ser|nuèch))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /(^a)|ante meridiem/i,
pm: /(^p)|post meridiem/i,
midnight: /^mièj/i,
noon: /^mièg/i,
morning: /matin/i,
afternoon: /aprèp-miègjorn/i,
evening: /vèspre|ser/i,
night: /nuèch/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

127
node_modules/date-fns/locale/oc/_lib/match.mjs generated vendored Normal file
View File

@@ -0,0 +1,127 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)(èr|nd|en)?[a]?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ab\.J\.C|apr\.J\.C|apr\.J\.-C)/i,
abbreviated: /^(ab\.J\.-C|ab\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
wide: /^(abans Jèsus-Crist|après Jèsus-Crist)/i,
};
const parseEraPatterns = {
any: [/^ab/i, /^ap/i],
};
const matchQuarterPatterns = {
narrow: /^T[1234]/i,
abbreviated: /^[1234](èr|nd|en)? trim\.?/i,
wide: /^[1234](èr|nd|en)? trimèstre/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(GN|FB|MÇ|AB|MA|JN|JL|AG|ST|OC|NV|DC)/i,
abbreviated: /^(gen|febr|març|abr|mai|junh|jul|ag|set|oct|nov|dec)\.?/i,
wide: /^(genièr|febrièr|març|abril|mai|junh|julhet|agost|setembre|octòbre|novembre|decembre)/i,
};
const parseMonthPatterns = {
any: [
/^g/i,
/^f/i,
/^ma[r?]|MÇ/i,
/^ab/i,
/^ma[i?]/i,
/^ju[n?]|JN/i,
/^ju[l?]|JL/i,
/^ag/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^d[glmcjvs]\.?/i,
short: /^d[glmcjvs]\.?/i,
abbreviated: /^d[glmcjvs]\.?/i,
wide: /^(dimenge|diluns|dimars|dimècres|dijòus|divendres|dissabte)/i,
};
const parseDayPatterns = {
narrow: [/^dg/i, /^dl/i, /^dm/i, /^dc/i, /^dj/i, /^dv/i, /^ds/i],
short: [/^dg/i, /^dl/i, /^dm/i, /^dc/i, /^dj/i, /^dv/i, /^ds/i],
abbreviated: [/^dg/i, /^dl/i, /^dm/i, /^dc/i, /^dj/i, /^dv/i, /^ds/i],
any: [
/^dg|dime/i,
/^dl|dil/i,
/^dm|dima/i,
/^dc|dimè/i,
/^dj|dij/i,
/^dv|div/i,
/^ds|dis/i,
],
};
const matchDayPeriodPatterns = {
any: /(^(a\.?m|p\.?m))|(ante meridiem|post meridiem)|((del |de la |de l)(matin|aprèp-miègjorn|vèspre|ser|nuèch))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /(^a)|ante meridiem/i,
pm: /(^p)|post meridiem/i,
midnight: /^mièj/i,
noon: /^mièg/i,
morning: /matin/i,
afternoon: /aprèp-miègjorn/i,
evening: /vèspre|ser/i,
night: /nuèch/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",
}),
};