Files
discord-decomp/sources/by-id/module-01290-parseDateTimeSkeleton.js
T
2026-07-28 01:06:53 +03:00

180 lines
8.2 KiB
JavaScript

/* Metro module 1290; source: unknown; dependencies: [] */
function _fun14249(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#14249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1417:6, offset: 0x00dff66f, size: 76 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
exports.parseDateTimeSkeleton = undefined;
const env0_0 = RegExp("(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)",
'g');
exports.parseDateTimeSkeleton = function(a0) {
var object = {};
a0.replace(object, _fun14251);
return object;
};
function parseDateTimeSkeleton(a0) { // fn#14250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1417:325, offset: 0x00dff6bb, size: 36 bytes, params: 2, frame: 14
const object = {};
a0.replace(object, _fun14251);
return object;
function _fun14251(a0) { // fn#14251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1417:388, offset: 0x00dff6df, size: 1425 bytes, params: 2, frame: 13
var binding;
const length = a0.length;
const property = a0[0];
if (property === 'G') {
env0_0.era = length === 4 ? 'long' : length !== 5 ? 'short' : 'narrow';
return '';
}
if (property === 'y') {
env0_0.year = length !== 2 ? 'numeric' : '2-digit';
return '';
}
if (property === 'Y') {
throw new global.RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');
}
if (property === 'u') {
throw new global.RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');
}
if (property === 'U') {
throw new global.RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');
}
if (property === 'r') {
throw new global.RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');
}
if (property === 'q') {
throw new global.RangeError('`q/Q` (quarter) patterns are not supported');
}
if (property === 'Q') {
throw new global.RangeError('`q/Q` (quarter) patterns are not supported');
}
if (property === 'M') {
env0_0.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][length - 1];
return '';
}
if (property === 'L') {
env0_0.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][length - 1];
return '';
}
if (property === 'w') {
throw new global.RangeError('`w/W` (week) patterns are not supported');
}
if (property === 'W') {
throw new global.RangeError('`w/W` (week) patterns are not supported');
}
if (property === 'd') {
env0_0.day = ['numeric', '2-digit'][length - 1];
return '';
}
if (property === 'D') {
throw new global.RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');
}
if (property === 'F') {
throw new global.RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');
}
if (property === 'g') {
throw new global.RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');
}
if (property === 'E') {
env0_0.weekday = length === 4 ? 'long' : length !== 5 ? 'short' : 'narrow';
return '';
}
if (property === 'e') {
if (length < 4) {
throw new global.RangeError('`e..eee` (weekday) patterns are not supported');
}
env0_0.weekday = ['short', 'long', 'narrow', 'short'][length - 4];
return '';
}
if (property === 'c') {
if (length < 4) {
throw new global.RangeError('`c..ccc` (weekday) patterns are not supported');
}
env0_0.weekday = ['short', 'long', 'narrow', 'short'][length - 4];
return '';
}
if (property === 'a') {
env0_0.hour12 = true;
return '';
}
if (property === 'b') {
throw new global.RangeError('`b/B` (period) patterns are not supported, use `a` instead');
}
if (property === 'B') {
throw new global.RangeError('`b/B` (period) patterns are not supported, use `a` instead');
}
if (property === 'h') {
binding = env0_0;
binding.hourCycle = 'h12';
binding.hour = ['numeric', '2-digit'][length - 1];
return '';
}
if (property === 'H') {
binding = env0_0;
binding.hourCycle = 'h23';
binding.hour = ['numeric', '2-digit'][length - 1];
return '';
}
if (property === 'K') {
binding = env0_0;
binding.hourCycle = 'h11';
binding.hour = ['numeric', '2-digit'][length - 1];
return '';
}
if (property === 'k') {
binding = env0_0;
binding.hourCycle = 'h24';
binding.hour = ['numeric', '2-digit'][length - 1];
return '';
}
if (property === 'j') {
throw new global.RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');
}
if (property === 'J') {
throw new global.RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');
}
if (property === 'C') {
throw new global.RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');
}
if (property === 'm') {
env0_0.minute = ['numeric', '2-digit'][length - 1];
return '';
}
if (property === 's') {
env0_0.second = ['numeric', '2-digit'][length - 1];
return '';
}
if (property === 'S') {
throw new global.RangeError('`S/A` (second) patterns are not supported, use `s` instead');
}
if (property === 'A') {
throw new global.RangeError('`S/A` (second) patterns are not supported, use `s` instead');
}
if (property === 'z') {
env0_0.timeZoneName = length < 4 ? 'short' : 'long';
return '';
}
if (property === 'Z') {
throw new global.RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');
}
if (property === 'O') {
throw new global.RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');
}
if (property === 'v') {
throw new global.RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');
}
if (property === 'V') {
throw new global.RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');
}
if (property === 'X') {
throw new global.RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');
}
if (property !== 'x') {
return '';
}
const RangeError = global.RangeError;
throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');
}
}
}
global.__d(_fun14249, 1290, []) /* metro module 1290 */;