decord/source/module_3482.js

37 lines
1.6 KiB
JavaScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 3482
// Function ID: 3483
// Dependencies: [2005, 2006]
2026-08-05 07:35:12 +00:00
2026-08-24 06:08:38 +00:00
// Module 3482
import buildMatchFn from "buildMatchFn" /* 2005 */;
import buildMatchPatternFn from "buildMatchPatternFn" /* 2006 */;
2026-08-05 07:35:12 +00:00
2026-08-15 05:55:55 +00:00
if (!buildMatchFn) {
2026-08-05 07:35:12 +00:00
let obj = { default: null };
2026-08-15 05:55:55 +00:00
obj[0] = buildMatchFn;
2026-08-05 07:35:12 +00:00
} else {
2026-08-15 05:55:55 +00:00
obj = buildMatchFn;
2026-08-05 07:35:12 +00:00
}
2026-08-15 05:55:55 +00:00
if (!buildMatchPatternFn) {
2026-08-05 07:35:12 +00:00
obj = { default: null };
2026-08-15 05:55:55 +00:00
obj[0] = buildMatchPatternFn;
2026-08-05 07:35:12 +00:00
let obj2 = obj;
} else {
2026-08-15 05:55:55 +00:00
obj2 = buildMatchPatternFn;
2026-08-05 07:35:12 +00:00
}
obj2 = {
2026-08-15 05:55:55 +00:00
matchPattern: /^(\d+)(-?[врмт][аи]|-?т?(ен|на)|-?(ев|ева))?/i,
2026-08-05 07:35:12 +00:00
parsePattern: /\d+/i,
valueCallback(joined) {
return parseInt(joined, 10);
}
};
2026-08-15 05:55:55 +00:00
const items = [/^п/i, /^н/i];
const items1 = [/1/i, /2/i, /3/i, /4/i];
const items2 = [/^я/i, /^ф/i, /^мар/i, /^ап/i, /^май/i, /^юн/i, /^юл/i, /^ав/i, /^се/i, /^окт/i, /^но/i, /^де/i];
const items3 = [/^н/i, /^п/i, /^в/i, /^с/i, /^ч/i, /^п/i, /^с/i];
const items4 = [/^н[ед]/i, /^п[он]/i, /^вт/i, /^ср/i, /^ч[ет]/i, /^п[ет]/i, /^с[ъб]/i];
2026-08-05 07:35:12 +00:00
2026-08-15 05:55:55 +00:00
export default { ordinalNumber: obj2.default(obj2), era: obj.default({ matchPatterns: obj3, defaultMatchWidth: "wide", parsePatterns: { any: items }, defaultParseWidth: "any" }), quarter: obj.default(obj4), month: obj.default({ matchPatterns: obj6, defaultMatchWidth: "wide", parsePatterns: { any: items2 }, defaultParseWidth: "any" }), day: obj.default({ matchPatterns: obj7, defaultMatchWidth: "wide", parsePatterns: { narrow: items3, any: items4 }, defaultParseWidth: "any" }), dayPeriod: obj.default({ matchPatterns: obj8, defaultMatchWidth: "any", parsePatterns: { any: obj9 }, defaultParseWidth: "any" }) };
2026-08-05 07:35:12 +00:00
export default exports.default;