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;

View File

@@ -0,0 +1,263 @@
"use strict";
exports.formatDistance = void 0;
function declension(scheme, count) {
// scheme for count=1 exists
if (scheme.one !== undefined && count === 1) {
return scheme.one;
}
const rem10 = count % 10;
const rem100 = count % 100;
// 1, 21, 31, ...
if (rem10 === 1 && rem100 !== 11) {
return scheme.singularNominative.replace("{{count}}", String(count));
// 2, 3, 4, 22, 23, 24, 32 ...
} else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) {
return scheme.singularGenitive.replace("{{count}}", String(count));
// 5, 6, 7, 8, 9, 10, 11, ...
} else {
return scheme.pluralGenitive.replace("{{count}}", String(count));
}
}
function buildLocalizeTokenFn(scheme) {
return (count, options) => {
if (options && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
if (scheme.future) {
return declension(scheme.future, count);
} else {
return "праз " + declension(scheme.regular, count);
}
} else {
if (scheme.past) {
return declension(scheme.past, count);
} else {
return declension(scheme.regular, count) + " таму";
}
}
} else {
return declension(scheme.regular, count);
}
};
}
const halfAMinute = (_, options) => {
if (options && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "праз паўхвіліны";
} else {
return "паўхвіліны таму";
}
}
return "паўхвіліны";
};
const formatDistanceLocale = {
lessThanXSeconds: buildLocalizeTokenFn({
regular: {
one: "менш за секунду",
singularNominative: "менш за {{count}} секунду",
singularGenitive: "менш за {{count}} секунды",
pluralGenitive: "менш за {{count}} секунд",
},
future: {
one: "менш, чым праз секунду",
singularNominative: "менш, чым праз {{count}} секунду",
singularGenitive: "менш, чым праз {{count}} секунды",
pluralGenitive: "менш, чым праз {{count}} секунд",
},
}),
xSeconds: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} секунда",
singularGenitive: "{{count}} секунды",
pluralGenitive: "{{count}} секунд",
},
past: {
singularNominative: "{{count}} секунду таму",
singularGenitive: "{{count}} секунды таму",
pluralGenitive: "{{count}} секунд таму",
},
future: {
singularNominative: "праз {{count}} секунду",
singularGenitive: "праз {{count}} секунды",
pluralGenitive: "праз {{count}} секунд",
},
}),
halfAMinute: halfAMinute,
lessThanXMinutes: buildLocalizeTokenFn({
regular: {
one: "менш за хвіліну",
singularNominative: "менш за {{count}} хвіліну",
singularGenitive: "менш за {{count}} хвіліны",
pluralGenitive: "менш за {{count}} хвілін",
},
future: {
one: "менш, чым праз хвіліну",
singularNominative: "менш, чым праз {{count}} хвіліну",
singularGenitive: "менш, чым праз {{count}} хвіліны",
pluralGenitive: "менш, чым праз {{count}} хвілін",
},
}),
xMinutes: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} хвіліна",
singularGenitive: "{{count}} хвіліны",
pluralGenitive: "{{count}} хвілін",
},
past: {
singularNominative: "{{count}} хвіліну таму",
singularGenitive: "{{count}} хвіліны таму",
pluralGenitive: "{{count}} хвілін таму",
},
future: {
singularNominative: "праз {{count}} хвіліну",
singularGenitive: "праз {{count}} хвіліны",
pluralGenitive: "праз {{count}} хвілін",
},
}),
aboutXHours: buildLocalizeTokenFn({
regular: {
singularNominative: "каля {{count}} гадзіны",
singularGenitive: "каля {{count}} гадзін",
pluralGenitive: "каля {{count}} гадзін",
},
future: {
singularNominative: "прыблізна праз {{count}} гадзіну",
singularGenitive: "прыблізна праз {{count}} гадзіны",
pluralGenitive: "прыблізна праз {{count}} гадзін",
},
}),
xHours: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} гадзіна",
singularGenitive: "{{count}} гадзіны",
pluralGenitive: "{{count}} гадзін",
},
past: {
singularNominative: "{{count}} гадзіну таму",
singularGenitive: "{{count}} гадзіны таму",
pluralGenitive: "{{count}} гадзін таму",
},
future: {
singularNominative: "праз {{count}} гадзіну",
singularGenitive: "праз {{count}} гадзіны",
pluralGenitive: "праз {{count}} гадзін",
},
}),
xDays: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} дзень",
singularGenitive: "{{count}} дні",
pluralGenitive: "{{count}} дзён",
},
}),
aboutXWeeks: buildLocalizeTokenFn({
regular: {
singularNominative: "каля {{count}} тыдні",
singularGenitive: "каля {{count}} тыдняў",
pluralGenitive: "каля {{count}} тыдняў",
},
future: {
singularNominative: "прыблізна праз {{count}} тыдзень",
singularGenitive: "прыблізна праз {{count}} тыдні",
pluralGenitive: "прыблізна праз {{count}} тыдняў",
},
}),
xWeeks: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} тыдзень",
singularGenitive: "{{count}} тыдні",
pluralGenitive: "{{count}} тыдняў",
},
}),
aboutXMonths: buildLocalizeTokenFn({
regular: {
singularNominative: "каля {{count}} месяца",
singularGenitive: "каля {{count}} месяцаў",
pluralGenitive: "каля {{count}} месяцаў",
},
future: {
singularNominative: "прыблізна праз {{count}} месяц",
singularGenitive: "прыблізна праз {{count}} месяцы",
pluralGenitive: "прыблізна праз {{count}} месяцаў",
},
}),
xMonths: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} месяц",
singularGenitive: "{{count}} месяцы",
pluralGenitive: "{{count}} месяцаў",
},
}),
aboutXYears: buildLocalizeTokenFn({
regular: {
singularNominative: "каля {{count}} года",
singularGenitive: "каля {{count}} гадоў",
pluralGenitive: "каля {{count}} гадоў",
},
future: {
singularNominative: "прыблізна праз {{count}} год",
singularGenitive: "прыблізна праз {{count}} гады",
pluralGenitive: "прыблізна праз {{count}} гадоў",
},
}),
xYears: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} год",
singularGenitive: "{{count}} гады",
pluralGenitive: "{{count}} гадоў",
},
}),
overXYears: buildLocalizeTokenFn({
regular: {
singularNominative: "больш за {{count}} год",
singularGenitive: "больш за {{count}} гады",
pluralGenitive: "больш за {{count}} гадоў",
},
future: {
singularNominative: "больш, чым праз {{count}} год",
singularGenitive: "больш, чым праз {{count}} гады",
pluralGenitive: "больш, чым праз {{count}} гадоў",
},
}),
almostXYears: buildLocalizeTokenFn({
regular: {
singularNominative: "амаль {{count}} год",
singularGenitive: "амаль {{count}} гады",
pluralGenitive: "амаль {{count}} гадоў",
},
future: {
singularNominative: "амаль праз {{count}} год",
singularGenitive: "амаль праз {{count}} гады",
pluralGenitive: "амаль праз {{count}} гадоў",
},
}),
};
const formatDistance = (token, count, options) => {
options = options || {};
return formatDistanceLocale[token](count, options);
};
exports.formatDistance = formatDistance;

View File

@@ -0,0 +1,259 @@
function declension(scheme, count) {
// scheme for count=1 exists
if (scheme.one !== undefined && count === 1) {
return scheme.one;
}
const rem10 = count % 10;
const rem100 = count % 100;
// 1, 21, 31, ...
if (rem10 === 1 && rem100 !== 11) {
return scheme.singularNominative.replace("{{count}}", String(count));
// 2, 3, 4, 22, 23, 24, 32 ...
} else if (rem10 >= 2 && rem10 <= 4 && (rem100 < 10 || rem100 > 20)) {
return scheme.singularGenitive.replace("{{count}}", String(count));
// 5, 6, 7, 8, 9, 10, 11, ...
} else {
return scheme.pluralGenitive.replace("{{count}}", String(count));
}
}
function buildLocalizeTokenFn(scheme) {
return (count, options) => {
if (options && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
if (scheme.future) {
return declension(scheme.future, count);
} else {
return "праз " + declension(scheme.regular, count);
}
} else {
if (scheme.past) {
return declension(scheme.past, count);
} else {
return declension(scheme.regular, count) + " таму";
}
}
} else {
return declension(scheme.regular, count);
}
};
}
const halfAMinute = (_, options) => {
if (options && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "праз паўхвіліны";
} else {
return "паўхвіліны таму";
}
}
return "паўхвіліны";
};
const formatDistanceLocale = {
lessThanXSeconds: buildLocalizeTokenFn({
regular: {
one: "менш за секунду",
singularNominative: "менш за {{count}} секунду",
singularGenitive: "менш за {{count}} секунды",
pluralGenitive: "менш за {{count}} секунд",
},
future: {
one: "менш, чым праз секунду",
singularNominative: "менш, чым праз {{count}} секунду",
singularGenitive: "менш, чым праз {{count}} секунды",
pluralGenitive: "менш, чым праз {{count}} секунд",
},
}),
xSeconds: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} секунда",
singularGenitive: "{{count}} секунды",
pluralGenitive: "{{count}} секунд",
},
past: {
singularNominative: "{{count}} секунду таму",
singularGenitive: "{{count}} секунды таму",
pluralGenitive: "{{count}} секунд таму",
},
future: {
singularNominative: "праз {{count}} секунду",
singularGenitive: "праз {{count}} секунды",
pluralGenitive: "праз {{count}} секунд",
},
}),
halfAMinute: halfAMinute,
lessThanXMinutes: buildLocalizeTokenFn({
regular: {
one: "менш за хвіліну",
singularNominative: "менш за {{count}} хвіліну",
singularGenitive: "менш за {{count}} хвіліны",
pluralGenitive: "менш за {{count}} хвілін",
},
future: {
one: "менш, чым праз хвіліну",
singularNominative: "менш, чым праз {{count}} хвіліну",
singularGenitive: "менш, чым праз {{count}} хвіліны",
pluralGenitive: "менш, чым праз {{count}} хвілін",
},
}),
xMinutes: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} хвіліна",
singularGenitive: "{{count}} хвіліны",
pluralGenitive: "{{count}} хвілін",
},
past: {
singularNominative: "{{count}} хвіліну таму",
singularGenitive: "{{count}} хвіліны таму",
pluralGenitive: "{{count}} хвілін таму",
},
future: {
singularNominative: "праз {{count}} хвіліну",
singularGenitive: "праз {{count}} хвіліны",
pluralGenitive: "праз {{count}} хвілін",
},
}),
aboutXHours: buildLocalizeTokenFn({
regular: {
singularNominative: "каля {{count}} гадзіны",
singularGenitive: "каля {{count}} гадзін",
pluralGenitive: "каля {{count}} гадзін",
},
future: {
singularNominative: "прыблізна праз {{count}} гадзіну",
singularGenitive: "прыблізна праз {{count}} гадзіны",
pluralGenitive: "прыблізна праз {{count}} гадзін",
},
}),
xHours: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} гадзіна",
singularGenitive: "{{count}} гадзіны",
pluralGenitive: "{{count}} гадзін",
},
past: {
singularNominative: "{{count}} гадзіну таму",
singularGenitive: "{{count}} гадзіны таму",
pluralGenitive: "{{count}} гадзін таму",
},
future: {
singularNominative: "праз {{count}} гадзіну",
singularGenitive: "праз {{count}} гадзіны",
pluralGenitive: "праз {{count}} гадзін",
},
}),
xDays: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} дзень",
singularGenitive: "{{count}} дні",
pluralGenitive: "{{count}} дзён",
},
}),
aboutXWeeks: buildLocalizeTokenFn({
regular: {
singularNominative: "каля {{count}} тыдні",
singularGenitive: "каля {{count}} тыдняў",
pluralGenitive: "каля {{count}} тыдняў",
},
future: {
singularNominative: "прыблізна праз {{count}} тыдзень",
singularGenitive: "прыблізна праз {{count}} тыдні",
pluralGenitive: "прыблізна праз {{count}} тыдняў",
},
}),
xWeeks: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} тыдзень",
singularGenitive: "{{count}} тыдні",
pluralGenitive: "{{count}} тыдняў",
},
}),
aboutXMonths: buildLocalizeTokenFn({
regular: {
singularNominative: "каля {{count}} месяца",
singularGenitive: "каля {{count}} месяцаў",
pluralGenitive: "каля {{count}} месяцаў",
},
future: {
singularNominative: "прыблізна праз {{count}} месяц",
singularGenitive: "прыблізна праз {{count}} месяцы",
pluralGenitive: "прыблізна праз {{count}} месяцаў",
},
}),
xMonths: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} месяц",
singularGenitive: "{{count}} месяцы",
pluralGenitive: "{{count}} месяцаў",
},
}),
aboutXYears: buildLocalizeTokenFn({
regular: {
singularNominative: "каля {{count}} года",
singularGenitive: "каля {{count}} гадоў",
pluralGenitive: "каля {{count}} гадоў",
},
future: {
singularNominative: "прыблізна праз {{count}} год",
singularGenitive: "прыблізна праз {{count}} гады",
pluralGenitive: "прыблізна праз {{count}} гадоў",
},
}),
xYears: buildLocalizeTokenFn({
regular: {
singularNominative: "{{count}} год",
singularGenitive: "{{count}} гады",
pluralGenitive: "{{count}} гадоў",
},
}),
overXYears: buildLocalizeTokenFn({
regular: {
singularNominative: "больш за {{count}} год",
singularGenitive: "больш за {{count}} гады",
pluralGenitive: "больш за {{count}} гадоў",
},
future: {
singularNominative: "больш, чым праз {{count}} год",
singularGenitive: "больш, чым праз {{count}} гады",
pluralGenitive: "больш, чым праз {{count}} гадоў",
},
}),
almostXYears: buildLocalizeTokenFn({
regular: {
singularNominative: "амаль {{count}} год",
singularGenitive: "амаль {{count}} гады",
pluralGenitive: "амаль {{count}} гадоў",
},
future: {
singularNominative: "амаль праз {{count}} год",
singularGenitive: "амаль праз {{count}} гады",
pluralGenitive: "амаль праз {{count}} гадоў",
},
}),
};
export const formatDistance = (token, count, options) => {
options = options || {};
return formatDistanceLocale[token](count, options);
};

View File

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

View File

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

View File

@@ -0,0 +1,38 @@
"use strict";
exports.formatLong = void 0;
var _index = require("../../_lib/buildFormatLongFn.js");
const dateFormats = {
full: "EEEE, d MMMM y 'г.'",
long: "d MMMM y 'г.'",
medium: "d MMM y 'г.'",
short: "dd.MM.y",
};
const timeFormats = {
full: "H:mm:ss zzzz",
long: "H:mm:ss z",
medium: "H:mm:ss",
short: "H:mm",
};
const dateTimeFormats = {
any: "{{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: "any",
}),
});

View File

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

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;

View File

@@ -0,0 +1,92 @@
"use strict";
exports.formatRelative = void 0;
var _index = require("../../../isSameWeek.js");
var _index2 = require("../../../toDate.js");
const accusativeWeekdays = [
"нядзелю",
"панядзелак",
"аўторак",
"сераду",
"чацьвер",
"пятніцу",
"суботу",
];
function lastWeek(day) {
const weekday = accusativeWeekdays[day];
switch (day) {
case 0:
case 3:
case 5:
case 6:
return "'у мінулую " + weekday + " а' p";
case 1:
case 2:
case 4:
return "'у мінулы " + weekday + " а' p";
}
}
function thisWeek(day) {
const weekday = accusativeWeekdays[day];
return "'у " + weekday + " а' p";
}
function nextWeek(day) {
const weekday = accusativeWeekdays[day];
switch (day) {
case 0:
case 3:
case 5:
case 6:
return "'у наступную " + weekday + " а' p";
case 1:
case 2:
case 4:
return "'у наступны " + weekday + " а' p";
}
}
const lastWeekFormat = (dirtyDate, baseDate, options) => {
const date = (0, _index2.toDate)(dirtyDate);
const day = date.getDay();
if ((0, _index.isSameWeek)(date, baseDate, options)) {
return thisWeek(day);
} else {
return lastWeek(day);
}
};
const nextWeekFormat = (dirtyDate, baseDate, options) => {
const date = (0, _index2.toDate)(dirtyDate);
const day = date.getDay();
if ((0, _index.isSameWeek)(date, baseDate, options)) {
return thisWeek(day);
} else {
return nextWeek(day);
}
};
const formatRelativeLocale = {
lastWeek: lastWeekFormat,
yesterday: "'учора а' p",
today: "'сёньня а' p",
tomorrow: "'заўтра а' p",
nextWeek: nextWeekFormat,
other: "P",
};
const formatRelative = (token, date, baseDate, options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date, baseDate, options);
}
return format;
};
exports.formatRelative = formatRelative;

View File

@@ -0,0 +1,89 @@
import { isSameWeek } from "../../../isSameWeek.mjs";
import { toDate } from "../../../toDate.mjs";
const accusativeWeekdays = [
"нядзелю",
"панядзелак",
"аўторак",
"сераду",
"чацьвер",
"пятніцу",
"суботу",
];
function lastWeek(day) {
const weekday = accusativeWeekdays[day];
switch (day) {
case 0:
case 3:
case 5:
case 6:
return "'у мінулую " + weekday + " а' p";
case 1:
case 2:
case 4:
return "'у мінулы " + weekday + " а' p";
}
}
function thisWeek(day) {
const weekday = accusativeWeekdays[day];
return "'у " + weekday + " а' p";
}
function nextWeek(day) {
const weekday = accusativeWeekdays[day];
switch (day) {
case 0:
case 3:
case 5:
case 6:
return "'у наступную " + weekday + " а' p";
case 1:
case 2:
case 4:
return "'у наступны " + weekday + " а' p";
}
}
const lastWeekFormat = (dirtyDate, baseDate, options) => {
const date = toDate(dirtyDate);
const day = date.getDay();
if (isSameWeek(date, baseDate, options)) {
return thisWeek(day);
} else {
return lastWeek(day);
}
};
const nextWeekFormat = (dirtyDate, baseDate, options) => {
const date = toDate(dirtyDate);
const day = date.getDay();
if (isSameWeek(date, baseDate, options)) {
return thisWeek(day);
} else {
return nextWeek(day);
}
};
const formatRelativeLocale = {
lastWeek: lastWeekFormat,
yesterday: "'учора а' p",
today: "'сёньня а' p",
tomorrow: "'заўтра а' p",
nextWeek: nextWeekFormat,
other: "P",
};
export const formatRelative = (token, date, baseDate, options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date, baseDate, options);
}
return format;
};

View File

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

View File

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

228
node_modules/date-fns/locale/be-tarask/_lib/localize.js generated vendored Normal file
View File

@@ -0,0 +1,228 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["да н.э.", "н.э."],
abbreviated: ["да н. э.", "н. э."],
wide: ["да нашай эры", "нашай эры"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-ы кв.", "2-і кв.", "3-і кв.", "4-ы кв."],
wide: ["1-ы квартал", "2-і квартал", "3-і квартал", "4-ы квартал"],
};
const monthValues = {
narrow: ["С", "Л", "С", "К", "Т", "Ч", "Л", "Ж", "В", "К", "Л", "С"],
abbreviated: [
"студз.",
"лют.",
"сак.",
"крас.",
"трав.",
"чэрв.",
"ліп.",
"жн.",
"вер.",
"кастр.",
"ліст.",
"сьнеж.",
],
wide: [
"студзень",
"люты",
"сакавік",
"красавік",
"травень",
"чэрвень",
"ліпень",
"жнівень",
"верасень",
"кастрычнік",
"лістапад",
"сьнежань",
],
};
const formattingMonthValues = {
narrow: ["С", "Л", "С", "К", "Т", "Ч", "Л", "Ж", "В", "К", "Л", "С"],
abbreviated: [
"студз.",
"лют.",
"сак.",
"крас.",
"трав.",
"чэрв.",
"ліп.",
"жн.",
"вер.",
"кастр.",
"ліст.",
"сьнеж.",
],
wide: [
"студзеня",
"лютага",
"сакавіка",
"красавіка",
"траўня",
"чэрвеня",
"ліпеня",
"жніўня",
"верасня",
"кастрычніка",
"лістапада",
"сьнежня",
],
};
const dayValues = {
narrow: ["Н", "П", "А", "С", "Ч", "П", "С"],
short: ["нд", "пн", "аў", "ср", "чц", "пт", "сб"],
abbreviated: ["нядз", "пан", "аўт", "сер", "чаць", "пят", "суб"],
wide: [
"нядзеля",
"панядзелак",
"аўторак",
"серада",
"чацьвер",
"пятніца",
"субота",
],
};
const dayPeriodValues = {
narrow: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дзень",
evening: "веч.",
night: "ноч",
},
abbreviated: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дзень",
evening: "веч.",
night: "ноч",
},
wide: {
am: "ДП",
pm: "ПП",
midnight: "поўнач",
noon: "поўдзень",
morning: "раніца",
afternoon: "дзень",
evening: "вечар",
night: "ноч",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дня",
evening: "веч.",
night: "ночы",
},
abbreviated: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дня",
evening: "веч.",
night: "ночы",
},
wide: {
am: "ДП",
pm: "ПП",
midnight: "поўнач",
noon: "поўдзень",
morning: "раніцы",
afternoon: "дня",
evening: "вечара",
night: "ночы",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const unit = String(options?.unit);
const number = Number(dirtyNumber);
let suffix;
/** Though it's an incorrect ordinal form of a date we use it here for consistency with other similar locales (ru, uk)
* For date-month combinations should be used `d` formatter.
* Correct: `d MMMM` (4 верасня)
* Incorrect: `do MMMM` (4-га верасня)
*
* But following the consistency leads to mistakes for literal uses of `do` formatter (ordinal day of month).
* So for phrase "5th day of month" (`do дзень месяца`)
* library will produce: `5-га дзень месяца`
* but correct spelling should be: `5-ы дзень месяца`
*
* So I guess there should be a stand-alone and a formatting version of "day of month" formatters
*/
if (unit === "date") {
suffix = "-га";
} else if (unit === "hour" || unit === "minute" || unit === "second") {
suffix = "-я";
} else {
suffix =
(number % 10 === 2 || number % 10 === 3) &&
number % 100 !== 12 &&
number % 100 !== 13
? "-і"
: "-ы";
}
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",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "any",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,225 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["да н.э.", "н.э."],
abbreviated: ["да н. э.", "н. э."],
wide: ["да нашай эры", "нашай эры"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-ы кв.", "2-і кв.", "3-і кв.", "4-ы кв."],
wide: ["1-ы квартал", "2-і квартал", "3-і квартал", "4-ы квартал"],
};
const monthValues = {
narrow: ["С", "Л", "С", "К", "Т", "Ч", "Л", "Ж", "В", "К", "Л", "С"],
abbreviated: [
"студз.",
"лют.",
"сак.",
"крас.",
"трав.",
"чэрв.",
"ліп.",
"жн.",
"вер.",
"кастр.",
"ліст.",
"сьнеж.",
],
wide: [
"студзень",
"люты",
"сакавік",
"красавік",
"травень",
"чэрвень",
"ліпень",
"жнівень",
"верасень",
"кастрычнік",
"лістапад",
"сьнежань",
],
};
const formattingMonthValues = {
narrow: ["С", "Л", "С", "К", "Т", "Ч", "Л", "Ж", "В", "К", "Л", "С"],
abbreviated: [
"студз.",
"лют.",
"сак.",
"крас.",
"трав.",
"чэрв.",
"ліп.",
"жн.",
"вер.",
"кастр.",
"ліст.",
"сьнеж.",
],
wide: [
"студзеня",
"лютага",
"сакавіка",
"красавіка",
"траўня",
"чэрвеня",
"ліпеня",
"жніўня",
"верасня",
"кастрычніка",
"лістапада",
"сьнежня",
],
};
const dayValues = {
narrow: ["Н", "П", "А", "С", "Ч", "П", "С"],
short: ["нд", "пн", "аў", "ср", "чц", "пт", "сб"],
abbreviated: ["нядз", "пан", "аўт", "сер", "чаць", "пят", "суб"],
wide: [
"нядзеля",
"панядзелак",
"аўторак",
"серада",
"чацьвер",
"пятніца",
"субота",
],
};
const dayPeriodValues = {
narrow: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дзень",
evening: "веч.",
night: "ноч",
},
abbreviated: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дзень",
evening: "веч.",
night: "ноч",
},
wide: {
am: "ДП",
pm: "ПП",
midnight: "поўнач",
noon: "поўдзень",
morning: "раніца",
afternoon: "дзень",
evening: "вечар",
night: "ноч",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дня",
evening: "веч.",
night: "ночы",
},
abbreviated: {
am: "ДП",
pm: "ПП",
midnight: "поўн.",
noon: "поўд.",
morning: "ран.",
afternoon: "дня",
evening: "веч.",
night: "ночы",
},
wide: {
am: "ДП",
pm: "ПП",
midnight: "поўнач",
noon: "поўдзень",
morning: "раніцы",
afternoon: "дня",
evening: "вечара",
night: "ночы",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const unit = String(options?.unit);
const number = Number(dirtyNumber);
let suffix;
/** Though it's an incorrect ordinal form of a date we use it here for consistency with other similar locales (ru, uk)
* For date-month combinations should be used `d` formatter.
* Correct: `d MMMM` (4 верасня)
* Incorrect: `do MMMM` (4-га верасня)
*
* But following the consistency leads to mistakes for literal uses of `do` formatter (ordinal day of month).
* So for phrase "5th day of month" (`do дзень месяца`)
* library will produce: `5-га дзень месяца`
* but correct spelling should be: `5-ы дзень месяца`
*
* So I guess there should be a stand-alone and a formatting version of "day of month" formatters
*/
if (unit === "date") {
suffix = "-га";
} else if (unit === "hour" || unit === "minute" || unit === "second") {
suffix = "-я";
} else {
suffix =
(number % 10 === 2 || number % 10 === 3) &&
number % 100 !== 12 &&
number % 100 !== 13
? "-і"
: "-ы";
}
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",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "any",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

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

View File

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

138
node_modules/date-fns/locale/be-tarask/_lib/match.js generated vendored Normal file
View File

@@ -0,0 +1,138 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern =
/^(\d+)(-?(е|я|га|і|ы|ае|ая|яя|шы|гі|ці|ты|мы))?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^((да )?н\.?\s?э\.?)/i,
abbreviated: /^((да )?н\.?\s?э\.?)/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 = {
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,
abbreviated: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
wide: /^([дп]п|поўнач|поўдзень|раніц[аы]|дзень|дня|вечара?|ночы?)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^дп/i,
pm: /^пп/i,
midnight: /^поўн/i,
noon: /^поўд/i,
morning: /^р/i,
afternoon: /^д[зн]/i,
evening: /^в/i,
night: /^н/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: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

135
node_modules/date-fns/locale/be-tarask/_lib/match.mjs generated vendored Normal file
View File

@@ -0,0 +1,135 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern =
/^(\d+)(-?(е|я|га|і|ы|ае|ая|яя|шы|гі|ці|ты|мы))?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^((да )?н\.?\s?э\.?)/i,
abbreviated: /^((да )?н\.?\s?э\.?)/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 = {
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,
abbreviated: /^([дп]п|поўн\.?|поўд\.?|ран\.?|дзень|дня|веч\.?|ночы?)/i,
wide: /^([дп]п|поўнач|поўдзень|раніц[аы]|дзень|дня|вечара?|ночы?)/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: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};