1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.toDate = exports.iso8601 = void 0;
|
4 | const iso8601 = (time) => (0, exports.toDate)(time)
|
5 | .toISOString()
|
6 | .replace(/\.\d{3}Z$/, "Z");
|
7 | exports.iso8601 = iso8601;
|
8 | const toDate = (time) => {
|
9 | if (typeof time === "number") {
|
10 | return new Date(time * 1000);
|
11 | }
|
12 | if (typeof time === "string") {
|
13 | if (Number(time)) {
|
14 | return new Date(Number(time) * 1000);
|
15 | }
|
16 | return new Date(time);
|
17 | }
|
18 | return time;
|
19 | };
|
20 | exports.toDate = toDate;
|