Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

102 lines
2.9 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 2af97222b2982846.43dcb21113.js
* Module id: 695018
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e, t, r) => {
function o(e, t, r, o) {
return Math.round(e / r) + " " + o + (t >= 1.5 * r ? "s" : "");
}
t.exports = function (e, t) {
t = t || {};
var r,
s,
n,
i,
a = typeof e;
if ("string" === a && e.length > 0) {
var l = e;
if (!((l = String(l)).length > 100)) {
var c =
/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
l,
);
if (c) {
var u = parseFloat(c[1]);
switch ((c[2] || "ms").toLowerCase()) {
case "years":
case "year":
case "yrs":
case "yr":
case "y":
return 315576e5 * u;
case "weeks":
case "week":
case "w":
return 6048e5 * u;
case "days":
case "day":
case "d":
return 864e5 * u;
case "hours":
case "hour":
case "hrs":
case "hr":
case "h":
return 36e5 * u;
case "minutes":
case "minute":
case "mins":
case "min":
case "m":
return 6e4 * u;
case "seconds":
case "second":
case "secs":
case "sec":
case "s":
return 1e3 * u;
case "milliseconds":
case "millisecond":
case "msecs":
case "msec":
case "ms":
return u;
default:
break;
}
}
}
return;
}
if ("number" === a && isFinite(e)) {
return t.long
? (s = Math.abs((r = e))) >= 864e5
? o(r, s, 864e5, "day")
: s >= 36e5
? o(r, s, 36e5, "hour")
: s >= 6e4
? o(r, s, 6e4, "minute")
: s >= 1e3
? o(r, s, 1e3, "second")
: r + " ms"
: (i = Math.abs((n = e))) >= 864e5
? Math.round(n / 864e5) + "d"
: i >= 36e5
? Math.round(n / 36e5) + "h"
: i >= 6e4
? Math.round(n / 6e4) + "m"
: i >= 1e3
? Math.round(n / 1e3) + "s"
: n + "ms";
}
throw Error(
"val is not a non-empty string or a valid number. val=" +
JSON.stringify(e),
);
};
};
export default moduleFactory;