decord/source/3588_formatDuration.js

79 lines
1.9 KiB
JavaScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 3588
// Function ID: 3589
2026-07-20 16:05:17 +00:00
// Name: formatDuration
2026-08-05 07:35:12 +00:00
// Dependencies: [3580, 3339]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-05 07:35:12 +00:00
// Module 3588 (formatDuration)
2026-07-29 08:29:29 +00:00
import code from "code";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
if (!code) {
const obj = { default: null };
obj[0] = code;
2026-07-20 16:05:17 +00:00
let tmp3 = obj;
} else {
2026-07-29 08:29:29 +00:00
tmp3 = code;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let closure_3 = ["years", "months", "weeks", "days", "hours", "minutes", "seconds"];
2026-07-20 16:05:17 +00:00
export default function formatDuration(arg0, locale) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-20 16:05:17 +00:00
if (arguments.length < 1) {
const _TypeError = TypeError;
const concat = "1 argument required, but only ".concat;
const typeError = new TypeError("1 argument required, but only ".concat(arguments.length, " present"));
throw typeError;
} else {
locale = undefined;
2026-07-23 10:11:24 +00:00
const defaultOptions = _require(locale[1]).getDefaultOptions();
2026-07-20 16:05:17 +00:00
if (null != locale) {
locale = locale.locale;
}
if (null === locale) {
locale = defaultOptions.locale;
}
if (null === locale) {
locale = tmp3.default;
}
let format;
if (null != locale) {
format = locale.format;
}
if (null === format) {
format = closure_3;
}
let zero;
if (null != locale) {
zero = locale.zero;
}
let delimiter;
if (null != locale) {
delimiter = locale.delimiter;
}
let str2 = " ";
if (null !== delimiter) {
str2 = " ";
if (undefined !== delimiter) {
str2 = delimiter;
}
}
if (locale.formatDistance) {
const reduced = format.reduce((arr) => {
let combined = arr;
2026-08-04 21:03:28 +00:00
if (typeof table[arg1] === "number") {
2026-07-20 16:05:17 +00:00
if (closure_2) {
2026-07-29 08:29:29 +00:00
combined = arr.concat(locale.formatDistance(tmp, tmp3));
2026-07-20 16:05:17 +00:00
} else {
combined = arr;
}
}
return combined;
}, []);
return reduced.join(str2);
} else {
return "";
}
}
};
export default exports.default;