78 lines
1.9 KiB
JavaScript
78 lines
1.9 KiB
JavaScript
// Module ID: 3464
|
|
// Function ID: 26829
|
|
// Name: formatDuration
|
|
// Dependencies: [3456, 3215]
|
|
// Exports: default
|
|
|
|
// Module 3464 (formatDuration)
|
|
import module_3456 from "module_3456";
|
|
|
|
if (!module_3456) {
|
|
const obj = { default: module_3456 };
|
|
let tmp3 = obj;
|
|
} else {
|
|
tmp3 = module_3456;
|
|
}
|
|
let closure_2 = tmp3;
|
|
let closure_3 = ["years", "months", "weeks", "days", "hours", "minutes", "seconds"];
|
|
|
|
export default function formatDuration(arg0, locale) {
|
|
const _require = arg0;
|
|
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;
|
|
const defaultOptions = _require(locale[1]).getDefaultOptions();
|
|
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;
|
|
if ("number" === typeof dependencyMap[arg1]) {
|
|
if (closure_2) {
|
|
combined = arr.concat(locale.formatDistance(tmp, tmp2));
|
|
} else {
|
|
combined = arr;
|
|
}
|
|
}
|
|
return combined;
|
|
}, []);
|
|
return reduced.join(str2);
|
|
} else {
|
|
return "";
|
|
}
|
|
}
|
|
};
|
|
export default exports.default;
|