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/az/_lib/formatDistance.js generated vendored Normal file
View File

@@ -0,0 +1,105 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
one: "bir saniyədən az",
other: "{{count}} bir saniyədən az",
},
xSeconds: {
one: "1 saniyə",
other: "{{count}} saniyə",
},
halfAMinute: "yarım dəqiqə",
lessThanXMinutes: {
one: "bir dəqiqədən az",
other: "{{count}} bir dəqiqədən az",
},
xMinutes: {
one: "bir dəqiqə",
other: "{{count}} dəqiqə",
},
aboutXHours: {
one: "təxminən 1 saat",
other: "təxminən {{count}} saat",
},
xHours: {
one: "1 saat",
other: "{{count}} saat",
},
xDays: {
one: "1 gün",
other: "{{count}} gün",
},
aboutXWeeks: {
one: "təxminən 1 həftə",
other: "təxminən {{count}} həftə",
},
xWeeks: {
one: "1 həftə",
other: "{{count}} həftə",
},
aboutXMonths: {
one: "təxminən 1 ay",
other: "təxminən {{count}} ay",
},
xMonths: {
one: "1 ay",
other: "{{count}} ay",
},
aboutXYears: {
one: "təxminən 1 il",
other: "təxminən {{count}} il",
},
xYears: {
one: "1 il",
other: "{{count}} il",
},
overXYears: {
one: "1 ildən çox",
other: "{{count}} ildən çox",
},
almostXYears: {
one: "demək olar ki 1 il",
other: "demək olar ki {{count}} il",
},
};
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 result + " sonra";
} else {
return result + " əvvəl";
}
}
return result;
};
exports.formatDistance = formatDistance;

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

@@ -0,0 +1,101 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: "bir saniyədən az",
other: "{{count}} bir saniyədən az",
},
xSeconds: {
one: "1 saniyə",
other: "{{count}} saniyə",
},
halfAMinute: "yarım dəqiqə",
lessThanXMinutes: {
one: "bir dəqiqədən az",
other: "{{count}} bir dəqiqədən az",
},
xMinutes: {
one: "bir dəqiqə",
other: "{{count}} dəqiqə",
},
aboutXHours: {
one: "təxminən 1 saat",
other: "təxminən {{count}} saat",
},
xHours: {
one: "1 saat",
other: "{{count}} saat",
},
xDays: {
one: "1 gün",
other: "{{count}} gün",
},
aboutXWeeks: {
one: "təxminən 1 həftə",
other: "təxminən {{count}} həftə",
},
xWeeks: {
one: "1 həftə",
other: "{{count}} həftə",
},
aboutXMonths: {
one: "təxminən 1 ay",
other: "təxminən {{count}} ay",
},
xMonths: {
one: "1 ay",
other: "{{count}} ay",
},
aboutXYears: {
one: "təxminən 1 il",
other: "təxminən {{count}} il",
},
xYears: {
one: "1 il",
other: "{{count}} il",
},
overXYears: {
one: "1 ildən çox",
other: "{{count}} ildən çox",
},
almostXYears: {
one: "demək olar ki 1 il",
other: "demək olar ki {{count}} il",
},
};
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 result + " sonra";
} else {
return result + " əvvəl";
}
}
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/az/_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/az/_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, do MMMM y 'il'",
long: "do MMMM y 'il'",
medium: "d MMM y 'il'",
short: "dd.MM.yyyy",
};
const timeFormats = {
full: "H:mm:ss zzzz",
long: "H:mm:ss z",
medium: "H:mm:ss",
short: "H:mm",
};
const dateTimeFormats = {
full: "{{date}} {{time}} - 'də'",
long: "{{date}} {{time}} - 'də'",
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/az/_lib/formatLong.mjs generated vendored Normal file
View File

@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
const dateFormats = {
full: "EEEE, do MMMM y 'il'",
long: "do MMMM y 'il'",
medium: "d MMM y 'il'",
short: "dd.MM.yyyy",
};
const timeFormats = {
full: "H:mm:ss zzzz",
long: "H:mm:ss z",
medium: "H:mm:ss",
short: "H:mm",
};
const dateTimeFormats = {
full: "{{date}} {{time}} - 'də'",
long: "{{date}} {{time}} - 'də'",
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/az/_lib/formatRelative.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "'sonuncu' eeee p -'də'",
yesterday: "'dünən' p -'də'",
today: "'bugün' p -'də'",
tomorrow: "'sabah' p -'də'",
nextWeek: "eeee p -'də'",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,11 @@
const formatRelativeLocale = {
lastWeek: "'sonuncu' eeee p -'də'",
yesterday: "'dünən' p -'də'",
today: "'bugün' p -'də'",
tomorrow: "'sabah' p -'də'",
nextWeek: "eeee p -'də'",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];

2
node_modules/date-fns/locale/az/_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/az/_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;

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

@@ -0,0 +1,208 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["e.ə", "b.e"],
abbreviated: ["e.ə", "b.e"],
wide: ["eramızdan əvvəl", "bizim era"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["K1", "K2", "K3", "K4"],
wide: ["1ci kvartal", "2ci kvartal", "3cü kvartal", "4cü kvartal"],
};
const monthValues = {
narrow: ["Y", "F", "M", "A", "M", "İ", "İ", "A", "S", "O", "N", "D"],
abbreviated: [
"Yan",
"Fev",
"Mar",
"Apr",
"May",
"İyun",
"İyul",
"Avq",
"Sen",
"Okt",
"Noy",
"Dek",
],
wide: [
"Yanvar",
"Fevral",
"Mart",
"Aprel",
"May",
"İyun",
"İyul",
"Avqust",
"Sentyabr",
"Oktyabr",
"Noyabr",
"Dekabr",
],
};
const dayValues = {
narrow: ["B.", "B.e", "Ç.a", "Ç.", "C.a", "C.", "Ş."],
short: ["B.", "B.e", "Ç.a", "Ç.", "C.a", "C.", "Ş."],
abbreviated: ["Baz", "Baz.e", "Çər.a", "Çər", "Cüm.a", "Cüm", "Şə"],
wide: [
"Bazar",
"Bazar ertəsi",
"Çərşənbə axşamı",
"Çərşənbə",
"Cümə axşamı",
"Cümə",
"Şənbə",
],
};
const dayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
};
const suffixes = {
1: "-inci",
5: "-inci",
8: "-inci",
70: "-inci",
80: "-inci",
2: "-nci",
7: "-nci",
20: "-nci",
50: "-nci",
3: "-üncü",
4: "-üncü",
100: "-üncü",
6: "-ncı",
9: "-uncu",
10: "-uncu",
30: "-uncu",
60: "-ıncı",
90: "-ıncı",
};
const getSuffix = (number) => {
if (number === 0) {
// special case for zero
return number + "-ıncı";
}
const a = number % 10;
const b = (number % 100) - a;
const c = number >= 100 ? 100 : null;
if (suffixes[a]) {
return suffixes[a];
} else if (suffixes[b]) {
return suffixes[b];
} else if (c !== null) {
return suffixes[c];
}
return "";
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
const suffix = getSuffix(number);
return number + suffix;
};
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",
}),
});

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

@@ -0,0 +1,206 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["e.ə", "b.e"],
abbreviated: ["e.ə", "b.e"],
wide: ["eramızdan əvvəl", "bizim era"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["K1", "K2", "K3", "K4"],
wide: ["1ci kvartal", "2ci kvartal", "3cü kvartal", "4cü kvartal"],
};
const monthValues = {
narrow: ["Y", "F", "M", "A", "M", "İ", "İ", "A", "S", "O", "N", "D"],
abbreviated: [
"Yan",
"Fev",
"Mar",
"Apr",
"May",
"İyun",
"İyul",
"Avq",
"Sen",
"Okt",
"Noy",
"Dek",
],
wide: [
"Yanvar",
"Fevral",
"Mart",
"Aprel",
"May",
"İyun",
"İyul",
"Avqust",
"Sentyabr",
"Oktyabr",
"Noyabr",
"Dekabr",
],
};
const dayValues = {
narrow: ["B.", "B.e", "Ç.a", "Ç.", "C.a", "C.", "Ş."],
short: ["B.", "B.e", "Ç.a", "Ç.", "C.a", "C.", "Ş."],
abbreviated: ["Baz", "Baz.e", "Çər.a", "Çər", "Cüm.a", "Cüm", "Şə"],
wide: [
"Bazar",
"Bazar ertəsi",
"Çərşənbə axşamı",
"Çərşənbə",
"Cümə axşamı",
"Cümə",
"Şənbə",
],
};
const dayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "gecəyarı",
noon: "gün",
morning: "səhər",
afternoon: "gündüz",
evening: "axşam",
night: "gecə",
},
};
const suffixes = {
1: "-inci",
5: "-inci",
8: "-inci",
70: "-inci",
80: "-inci",
2: "-nci",
7: "-nci",
20: "-nci",
50: "-nci",
3: "-üncü",
4: "-üncü",
100: "-üncü",
6: "-ncı",
9: "-uncu",
10: "-uncu",
30: "-uncu",
60: "-ıncı",
90: "-ıncı",
};
const getSuffix = (number) => {
if (number === 0) {
// special case for zero
return number + "-ıncı";
}
const a = number % 10;
const b = (number % 100) - a;
const c = number >= 100 ? 100 : null;
if (suffixes[a]) {
return suffixes[a];
} else if (suffixes[b]) {
return suffixes[b];
} else if (c !== null) {
return suffixes[c];
}
return "";
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
const suffix = getSuffix(number);
return number + suffix;
};
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/az/_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/az/_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;

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

@@ -0,0 +1,187 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(\d+)(-?(ci|inci|nci|uncu|üncü|ncı))?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(b|a)$/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)$/i,
wide: /^(bizim eradan əvvəl|bizim era)$/i,
};
const parseEraPatterns = {
any: [/^b$/i, /^(a|c)$/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]$/i,
abbreviated: /^K[1234]$/i,
wide: /^[1234](ci)? kvartal$/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[(?-i)yfmaisond]$/i,
abbreviated: /^(Yan|Fev|Mar|Apr|May|İyun|İyul|Avq|Sen|Okt|Noy|Dek)$/i,
wide: /^(Yanvar|Fevral|Mart|Aprel|May|İyun|İyul|Avgust|Sentyabr|Oktyabr|Noyabr|Dekabr)$/i,
};
const parseMonthPatterns = {
narrow: [
/^[(?-i)y]$/i,
/^[(?-i)f]$/i,
/^[(?-i)m]$/i,
/^[(?-i)a]$/i,
/^[(?-i)m]$/i,
/^[(?-i)i]$/i,
/^[(?-i)i]$/i,
/^[(?-i)a]$/i,
/^[(?-i)s]$/i,
/^[(?-i)o]$/i,
/^[(?-i)n]$/i,
/^[(?-i)d]$/i,
],
abbreviated: [
/^Yan$/i,
/^Fev$/i,
/^Mar$/i,
/^Apr$/i,
/^May$/i,
/^İyun$/i,
/^İyul$/i,
/^Avg$/i,
/^Sen$/i,
/^Okt$/i,
/^Noy$/i,
/^Dek$/i,
],
wide: [
/^Yanvar$/i,
/^Fevral$/i,
/^Mart$/i,
/^Aprel$/i,
/^May$/i,
/^İyun$/i,
/^İyul$/i,
/^Avgust$/i,
/^Sentyabr$/i,
/^Oktyabr$/i,
/^Noyabr$/i,
/^Dekabr$/i,
],
};
const matchDayPatterns = {
narrow: /^(B\.|B\.e|Ç\.a|Ç\.|C\.a|C\.|Ş\.)$/i,
short: /^(B\.|B\.e|Ç\.a|Ç\.|C\.a|C\.|Ş\.)$/i,
abbreviated: /^(Baz\.e|Çər|Çər\.a|Cüm|Cüm\.a|Şə)$/i,
wide: /^(Bazar|Bazar ertəsi|Çərşənbə axşamı|Çərşənbə|Cümə axşamı|Cümə|Şənbə)$/i,
};
const parseDayPatterns = {
narrow: [
/^B\.$/i,
/^B\.e$/i,
/^Ç\.a$/i,
/^Ç\.$/i,
/^C\.a$/i,
/^C\.$/i,
/^Ş\.$/i,
],
abbreviated: [
/^Baz$/i,
/^Baz\.e$/i,
/^Çər\.a$/i,
/^Çər$/i,
/^Cüm\.a$/i,
/^Cüm$/i,
/^Şə$/i,
],
wide: [
/^Bazar$/i,
/^Bazar ertəsi$/i,
/^Çərşənbə axşamı$/i,
/^Çərşənbə$/i,
/^Cümə axşamı$/i,
/^Cümə$/i,
/^Şənbə$/i,
],
any: [
/^B\.$/i,
/^B\.e$/i,
/^Ç\.a$/i,
/^Ç\.$/i,
/^C\.a$/i,
/^C\.$/i,
/^Ş\.$/i,
],
};
const matchDayPeriodPatterns = {
narrow: /^(a|p|gecəyarı|gün|səhər|gündüz|axşam|gecə)$/i,
any: /^(am|pm|a\.m\.|p\.m\.|AM|PM|gecəyarı|gün|səhər|gündüz|axşam|gecə)$/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a$/i,
pm: /^p$/i,
midnight: /^gecəyarı$/i,
noon: /^gün$/i,
morning: /səhər$/i,
afternoon: /gündüz$/i,
evening: /axşam$/i,
night: /gecə$/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: "narrow",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

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

@@ -0,0 +1,184 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)(-?(ci|inci|nci|uncu|üncü|ncı))?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(b|a)$/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)$/i,
wide: /^(bizim eradan əvvəl|bizim era)$/i,
};
const parseEraPatterns = {
any: [/^b$/i, /^(a|c)$/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]$/i,
abbreviated: /^K[1234]$/i,
wide: /^[1234](ci)? kvartal$/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[(?-i)yfmaisond]$/i,
abbreviated: /^(Yan|Fev|Mar|Apr|May|İyun|İyul|Avq|Sen|Okt|Noy|Dek)$/i,
wide: /^(Yanvar|Fevral|Mart|Aprel|May|İyun|İyul|Avgust|Sentyabr|Oktyabr|Noyabr|Dekabr)$/i,
};
const parseMonthPatterns = {
narrow: [
/^[(?-i)y]$/i,
/^[(?-i)f]$/i,
/^[(?-i)m]$/i,
/^[(?-i)a]$/i,
/^[(?-i)m]$/i,
/^[(?-i)i]$/i,
/^[(?-i)i]$/i,
/^[(?-i)a]$/i,
/^[(?-i)s]$/i,
/^[(?-i)o]$/i,
/^[(?-i)n]$/i,
/^[(?-i)d]$/i,
],
abbreviated: [
/^Yan$/i,
/^Fev$/i,
/^Mar$/i,
/^Apr$/i,
/^May$/i,
/^İyun$/i,
/^İyul$/i,
/^Avg$/i,
/^Sen$/i,
/^Okt$/i,
/^Noy$/i,
/^Dek$/i,
],
wide: [
/^Yanvar$/i,
/^Fevral$/i,
/^Mart$/i,
/^Aprel$/i,
/^May$/i,
/^İyun$/i,
/^İyul$/i,
/^Avgust$/i,
/^Sentyabr$/i,
/^Oktyabr$/i,
/^Noyabr$/i,
/^Dekabr$/i,
],
};
const matchDayPatterns = {
narrow: /^(B\.|B\.e|Ç\.a|Ç\.|C\.a|C\.|Ş\.)$/i,
short: /^(B\.|B\.e|Ç\.a|Ç\.|C\.a|C\.|Ş\.)$/i,
abbreviated: /^(Baz\.e|Çər|Çər\.a|Cüm|Cüm\.a|Şə)$/i,
wide: /^(Bazar|Bazar ertəsi|Çərşənbə axşamı|Çərşənbə|Cümə axşamı|Cümə|Şənbə)$/i,
};
const parseDayPatterns = {
narrow: [
/^B\.$/i,
/^B\.e$/i,
/^Ç\.a$/i,
/^Ç\.$/i,
/^C\.a$/i,
/^C\.$/i,
/^Ş\.$/i,
],
abbreviated: [
/^Baz$/i,
/^Baz\.e$/i,
/^Çər\.a$/i,
/^Çər$/i,
/^Cüm\.a$/i,
/^Cüm$/i,
/^Şə$/i,
],
wide: [
/^Bazar$/i,
/^Bazar ertəsi$/i,
/^Çərşənbə axşamı$/i,
/^Çərşənbə$/i,
/^Cümə axşamı$/i,
/^Cümə$/i,
/^Şənbə$/i,
],
any: [
/^B\.$/i,
/^B\.e$/i,
/^Ç\.a$/i,
/^Ç\.$/i,
/^C\.a$/i,
/^C\.$/i,
/^Ş\.$/i,
],
};
const matchDayPeriodPatterns = {
narrow: /^(a|p|gecəyarı|gün|səhər|gündüz|axşam|gecə)$/i,
any: /^(am|pm|a\.m\.|p\.m\.|AM|PM|gecəyarı|gün|səhər|gündüz|axşam|gecə)$/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a$/i,
pm: /^p$/i,
midnight: /^gecəyarı$/i,
noon: /^gün$/i,
morning: /səhər$/i,
afternoon: /gündüz$/i,
evening: /axşam$/i,
night: /gecə$/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: "narrow",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};