Files
discord-decomp/_bundle/Module1275.js
T
2026-11-01 12:12:55 +02:00

74 lines
2.5 KiB
JavaScript

// Metro module 1275 (f1276).
import { resolveFormatConfigOptions } from "./Module1276";
import { dataFormatterCache } from "./FormatterCache";
export function makeDataFormatters(c12939_0, c12939_1, r5 = false) {
let c12939_2 = r5;
return {
formatDate: (a0, a1) => {
const r10 = (0, resolveFormatConfigOptions)(c12939_1.date, a1);
return dataFormatterCache.getDateTimeFormatter(c12939_0, c12939_2 ? {
...r10,
localeMatcher: "lookup"
} : r10).format(a0);
},
formatDuration: (a0, a1) => {
const r10 = (0, resolveFormatConfigOptions)(c12939_1.time, a1);
return dataFormatterCache.getDurationFormatter(c12939_0, c12939_2 ? {
...r10,
localeMatcher: "lookup"
} : r10).format(a0);
},
formatNumber: (a0, a1) => {
const r10 = (0, resolveFormatConfigOptions)(c12939_1.number, a1);
return dataFormatterCache.getNumberFormatter(c12939_0, c12939_2 ? {
...r10,
localeMatcher: "lookup"
} : r10).format(a0);
},
formatList: (a0, a1) => {
const r10 = (0, resolveFormatConfigOptions)(c12939_1.list, a1);
return dataFormatterCache.getListFormatter(c12939_0, c12939_2 ? {
...r10,
localeMatcher: "lookup"
} : r10).format(a0);
},
formatListToParts: (a0, a1) => {
const r14 = (0, resolveFormatConfigOptions)(c12939_1.list, a1);
const r20 = {};
let c24345_0 = r20;
for (const key in a0) {
r20["$+/-$placeholder." + key] = a0[key];
}
return dataFormatterCache.getListFormatter(c12939_0, c12939_2 ? {
...r14,
localeMatcher: "lookup"
} : r14).formatToParts(Object.keys(r20)).map((item) => {
let value = c24345_0[item.value];
if (!(value !== null && value !== void 0)) {
value = item.value;
}
item.value = value;
return value;
});
},
formatRelativeTime: (a0, a1, a2) => {
const r10 = (0, resolveFormatConfigOptions)(c12939_1.relativeTime, a2);
return dataFormatterCache.getRelativeTimeFormatter(c12939_0, c12939_2 ? {
...r10,
localeMatcher: "lookup"
} : r10).format(a0, a1);
},
formatTime: (a0, a1) => {
const r10 = (0, resolveFormatConfigOptions)(c12939_1.time, a1);
return dataFormatterCache.getDateTimeFormatter(c12939_0, c12939_2 ? {
...r10,
localeMatcher: "lookup"
} : r10).format(a0);
},
getPluralRules: (a0) => dataFormatterCache.getPluralRules(c12939_0, c12939_2 ? {
...a0,
localeMatcher: "lookup"
} : a0)
};
}