@choksheak/ts-utils 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/arrayBuffer.cjs +10 -39
- package/arrayBuffer.min.cjs +1 -1
- package/arrayBuffer.min.cjs.map +1 -1
- package/arrayBuffer.min.mjs +1 -1
- package/arrayBuffer.min.mjs.map +1 -1
- package/arrayBuffer.mjs +7 -10
- package/asNumber.cjs +6 -38
- package/asNumber.d.mts +1 -1
- package/asNumber.d.ts +1 -1
- package/asNumber.min.cjs +1 -1
- package/asNumber.min.cjs.map +1 -1
- package/asNumber.min.mjs +1 -1
- package/asNumber.min.mjs.map +1 -1
- package/asNumber.mjs +4 -11
- package/assert.cjs +4 -27
- package/assert.min.cjs +1 -1
- package/assert.min.cjs.map +1 -1
- package/assert.min.mjs +1 -1
- package/assert.min.mjs.map +1 -1
- package/assert.mjs +2 -0
- package/base64Url.cjs +5 -29
- package/base64Url.min.cjs +1 -1
- package/base64Url.min.cjs.map +1 -1
- package/base64Url.min.mjs +1 -1
- package/base64Url.min.mjs.map +1 -1
- package/base64Url.mjs +2 -0
- package/capLength.cjs +7 -71
- package/capLength.min.cjs +1 -5
- package/capLength.min.cjs.map +1 -1
- package/capLength.min.mjs +1 -5
- package/capLength.min.mjs.map +1 -1
- package/capLength.mjs +4 -41
- package/chunk-22JDWCOS.min.cjs +2 -0
- package/chunk-22JDWCOS.min.cjs.map +1 -0
- package/chunk-244NBT4Q.min.mjs +2 -0
- package/chunk-244NBT4Q.min.mjs.map +1 -0
- package/chunk-27MBP3ES.min.cjs +2 -0
- package/chunk-27MBP3ES.min.cjs.map +1 -0
- package/chunk-34ENP2B3.min.mjs +438 -0
- package/chunk-34ENP2B3.min.mjs.map +1 -0
- package/chunk-3EBQ2GO2.min.cjs +2 -0
- package/chunk-3EBQ2GO2.min.cjs.map +1 -0
- package/chunk-4GLOLTJ5.cjs +167 -0
- package/chunk-6TQBMXTL.min.cjs +2 -0
- package/chunk-6TQBMXTL.min.cjs.map +1 -0
- package/chunk-AWZBCFMG.min.cjs +2 -0
- package/chunk-AWZBCFMG.min.cjs.map +1 -0
- package/chunk-AXNETZET.cjs +20 -0
- package/chunk-BKZM6NWX.min.cjs +2 -0
- package/chunk-BKZM6NWX.min.cjs.map +1 -0
- package/chunk-BZKQXX3A.cjs +40 -0
- package/chunk-CERFUU5I.cjs +93 -0
- package/chunk-CSTKFJ6G.mjs +239 -0
- package/chunk-DUN4UY2Q.cjs +239 -0
- package/chunk-EDJJUP4K.min.cjs +6 -0
- package/chunk-EDJJUP4K.min.cjs.map +1 -0
- package/chunk-FFNQBZH5.cjs +14 -0
- package/chunk-FZZRSHSH.min.mjs +6 -0
- package/chunk-FZZRSHSH.min.mjs.map +1 -0
- package/chunk-GAP2HS5M.min.cjs +2 -0
- package/chunk-GAP2HS5M.min.cjs.map +1 -0
- package/chunk-GLYMAPS4.min.mjs +2 -0
- package/chunk-GLYMAPS4.min.mjs.map +1 -0
- package/chunk-I65KPVMO.min.cjs +438 -0
- package/chunk-I65KPVMO.min.cjs.map +1 -0
- package/chunk-ILGTU46T.cjs +39 -0
- package/chunk-IOKRXHKE.min.mjs +2 -0
- package/chunk-IOKRXHKE.min.mjs.map +1 -0
- package/chunk-ISP4SMRC.min.cjs +2 -0
- package/chunk-ISP4SMRC.min.cjs.map +1 -0
- package/chunk-KETP5HBF.cjs +24 -0
- package/chunk-KLHNGJ4Y.min.mjs +2 -0
- package/chunk-KLHNGJ4Y.min.mjs.map +1 -0
- package/chunk-KMNTU3DJ.mjs +45 -0
- package/chunk-LDVEXETI.cjs +45 -0
- package/chunk-LZENHV35.min.cjs +2 -0
- package/chunk-LZENHV35.min.cjs.map +1 -0
- package/chunk-M5PIM2HB.mjs +42 -0
- package/chunk-M6PYQYOX.mjs +39 -0
- package/chunk-MN5EYNZN.min.mjs +2 -0
- package/chunk-MN5EYNZN.min.mjs.map +1 -0
- package/chunk-NRIBJ2OJ.mjs +16031 -0
- package/chunk-NVLYXWLX.cjs +32 -0
- package/chunk-O352F2MT.mjs +24 -0
- package/chunk-O6B2TKFK.min.mjs +2 -0
- package/chunk-O6B2TKFK.min.mjs.map +1 -0
- package/chunk-OGF34H4T.min.cjs +2 -0
- package/chunk-OGF34H4T.min.cjs.map +1 -0
- package/chunk-OXSWWWOM.min.mjs +2 -0
- package/chunk-OXSWWWOM.min.mjs.map +1 -0
- package/chunk-PRUGHVRT.mjs +14 -0
- package/chunk-Q4WCMSOW.min.mjs +2 -0
- package/chunk-Q4WCMSOW.min.mjs.map +1 -0
- package/chunk-QH74JZCK.mjs +9 -0
- package/chunk-QNNJNLGK.min.cjs +2 -0
- package/chunk-QNNJNLGK.min.cjs.map +1 -0
- package/chunk-QWCFN7ZM.mjs +15 -0
- package/chunk-SDM2OPT6.mjs +32 -0
- package/chunk-SHKRZCF2.cjs +16031 -0
- package/chunk-SJDJDNDN.min.cjs +2 -0
- package/chunk-SJDJDNDN.min.cjs.map +1 -0
- package/chunk-SULNMALN.cjs +328 -0
- package/chunk-SV35RBZ7.min.mjs +2 -0
- package/chunk-SV35RBZ7.min.mjs.map +1 -0
- package/chunk-TJFYGFOW.mjs +328 -0
- package/chunk-UHRYBUUX.min.mjs +2 -0
- package/chunk-UHRYBUUX.min.mjs.map +1 -0
- package/chunk-UOU6IP3S.min.mjs +2 -0
- package/chunk-UOU6IP3S.min.mjs.map +1 -0
- package/chunk-V76XVNZ5.mjs +20 -0
- package/chunk-VFYQ7I5V.min.mjs +2 -0
- package/chunk-VFYQ7I5V.min.mjs.map +1 -0
- package/chunk-VG7VV7J2.mjs +167 -0
- package/chunk-VJCV56DO.cjs +15 -0
- package/chunk-VREA6AKG.cjs +9 -0
- package/chunk-W5I6Y5FK.min.mjs +2 -0
- package/chunk-W5I6Y5FK.min.mjs.map +1 -0
- package/chunk-Y7MC73BZ.cjs +42 -0
- package/chunk-YVWROQKU.mjs +40 -0
- package/chunk-ZKIZ5SWK.min.cjs +2 -0
- package/chunk-ZKIZ5SWK.min.cjs.map +1 -0
- package/chunk-ZZZB7NJX.mjs +93 -0
- package/concatIterators.cjs +4 -27
- package/concatIterators.min.cjs +1 -1
- package/concatIterators.min.cjs.map +1 -1
- package/concatIterators.min.mjs +1 -1
- package/concatIterators.min.mjs.map +1 -1
- package/concatIterators.mjs +2 -0
- package/dateTimeStr.cjs +31 -119
- package/dateTimeStr.min.cjs +1 -1
- package/dateTimeStr.min.cjs.map +1 -1
- package/dateTimeStr.min.mjs +1 -1
- package/dateTimeStr.min.mjs.map +1 -1
- package/dateTimeStr.mjs +17 -69
- package/duration.cjs +24 -188
- package/duration.min.cjs +1 -1
- package/duration.min.cjs.map +1 -1
- package/duration.min.mjs +1 -1
- package/duration.min.mjs.map +1 -1
- package/duration.mjs +14 -144
- package/getEnv.cjs +20 -0
- package/getEnv.d.mts +11 -0
- package/getEnv.d.ts +11 -0
- package/getEnv.min.cjs +2 -0
- package/getEnv.min.cjs.map +1 -0
- package/getEnv.min.mjs +2 -0
- package/getEnv.min.mjs.map +1 -0
- package/getEnv.mjs +20 -0
- package/isEmpty.cjs +8 -46
- package/isEmpty.min.cjs +1 -1
- package/isEmpty.min.cjs.map +1 -1
- package/isEmpty.min.mjs +1 -1
- package/isEmpty.min.mjs.map +1 -1
- package/isEmpty.mjs +6 -19
- package/isPromise.cjs +5 -29
- package/isPromise.min.cjs +1 -1
- package/isPromise.min.cjs.map +1 -1
- package/isPromise.min.mjs +1 -1
- package/isPromise.min.mjs.map +1 -1
- package/isPromise.mjs +2 -0
- package/kvStore.cjs +15 -362
- package/kvStore.d.mts +142 -44
- package/kvStore.d.ts +142 -44
- package/kvStore.min.cjs +1 -1
- package/kvStore.min.cjs.map +1 -1
- package/kvStore.min.mjs +1 -1
- package/kvStore.min.mjs.map +1 -1
- package/kvStore.mjs +13 -328
- package/localStore.cjs +15 -263
- package/localStore.d.mts +135 -34
- package/localStore.d.ts +135 -34
- package/localStore.min.cjs +1 -1
- package/localStore.min.cjs.map +1 -1
- package/localStore.min.mjs +1 -1
- package/localStore.min.mjs.map +1 -1
- package/localStore.mjs +13 -229
- package/magic-string.es-4UY437WL.min.mjs +14 -0
- package/magic-string.es-4UY437WL.min.mjs.map +1 -0
- package/magic-string.es-OAQWZQTY.mjs +1323 -0
- package/magic-string.es-UE2UVQEL.cjs +1323 -0
- package/magic-string.es-X6DNUB6Y.min.cjs +14 -0
- package/magic-string.es-X6DNUB6Y.min.cjs.map +1 -0
- package/mean.cjs +8 -48
- package/mean.min.cjs +1 -1
- package/mean.min.cjs.map +1 -1
- package/mean.min.mjs +1 -1
- package/mean.min.mjs.map +1 -1
- package/mean.mjs +5 -18
- package/median.cjs +7 -41
- package/median.min.cjs +1 -1
- package/median.min.cjs.map +1 -1
- package/median.min.mjs +1 -1
- package/median.min.mjs.map +1 -1
- package/median.mjs +5 -12
- package/nonEmpty.cjs +8 -48
- package/nonEmpty.min.cjs +1 -1
- package/nonEmpty.min.cjs.map +1 -1
- package/nonEmpty.min.mjs +1 -1
- package/nonEmpty.min.mjs.map +1 -1
- package/nonEmpty.mjs +6 -19
- package/nonNil.cjs +4 -27
- package/nonNil.min.cjs +1 -1
- package/nonNil.min.cjs.map +1 -1
- package/nonNil.min.mjs +1 -1
- package/nonNil.min.mjs.map +1 -1
- package/nonNil.mjs +2 -0
- package/package.json +274 -34
- package/round.cjs +6 -32
- package/round.min.cjs +1 -1
- package/round.min.cjs.map +1 -1
- package/round.min.mjs +1 -1
- package/round.min.mjs.map +1 -1
- package/round.mjs +4 -5
- package/roundToString.cjs +7 -35
- package/roundToString.min.cjs +1 -1
- package/roundToString.min.cjs.map +1 -1
- package/roundToString.min.mjs +1 -1
- package/roundToString.min.mjs.map +1 -1
- package/roundToString.mjs +4 -5
- package/safeBtoa.cjs +4 -27
- package/safeBtoa.d.mts +7 -0
- package/safeBtoa.d.ts +7 -0
- package/safeBtoa.min.cjs +1 -1
- package/safeBtoa.min.cjs.map +1 -1
- package/safeBtoa.min.mjs +1 -1
- package/safeBtoa.min.mjs.map +1 -1
- package/safeBtoa.mjs +2 -0
- package/sha256.cjs +8 -34
- package/sha256.min.cjs +1 -1
- package/sha256.min.cjs.map +1 -1
- package/sha256.min.mjs +1 -1
- package/sha256.min.mjs.map +1 -1
- package/sha256.mjs +6 -7
- package/sleep.cjs +4 -27
- package/sleep.min.cjs +1 -1
- package/sleep.min.cjs.map +1 -1
- package/sleep.min.mjs +1 -1
- package/sleep.min.mjs.map +1 -1
- package/sleep.mjs +2 -0
- package/storageAdapter.cjs +1 -18
- package/storageAdapter.min.cjs +1 -2
- package/storageAdapter.min.cjs.map +1 -1
- package/sum.cjs +5 -45
- package/sum.min.cjs +1 -1
- package/sum.min.cjs.map +1 -1
- package/sum.min.mjs +1 -1
- package/sum.min.mjs.map +1 -1
- package/sum.mjs +5 -18
- package/timeConstants.cjs +35 -69
- package/timeConstants.min.cjs +1 -1
- package/timeConstants.min.cjs.map +1 -1
- package/timeConstants.min.mjs +1 -1
- package/timeConstants.min.mjs.map +1 -1
- package/timeConstants.mjs +19 -15
- package/timer.cjs +7 -185
- package/timer.d.mts +9 -6
- package/timer.d.ts +9 -6
- package/timer.min.cjs +1 -1
- package/timer.min.cjs.map +1 -1
- package/timer.min.mjs +1 -1
- package/timer.min.mjs.map +1 -1
- package/timer.mjs +8 -158
- package/toReadableString.cjs +6 -68
- package/toReadableString.min.cjs +1 -5
- package/toReadableString.min.cjs.map +1 -1
- package/toReadableString.min.mjs +1 -5
- package/toReadableString.min.mjs.map +1 -1
- package/toReadableString.mjs +4 -41
- package/safeParseFloat.cjs +0 -33
- package/safeParseFloat.d.mts +0 -6
- package/safeParseFloat.d.ts +0 -6
- package/safeParseFloat.min.cjs +0 -2
- package/safeParseFloat.min.cjs.map +0 -1
- package/safeParseFloat.min.mjs +0 -2
- package/safeParseFloat.min.mjs.map +0 -1
- package/safeParseFloat.mjs +0 -8
- package/safeParseInt.cjs +0 -33
- package/safeParseInt.d.mts +0 -6
- package/safeParseInt.d.ts +0 -6
- package/safeParseInt.min.cjs +0 -2
- package/safeParseInt.min.cjs.map +0 -1
- package/safeParseInt.min.mjs +0 -2
- package/safeParseInt.min.mjs.map +0 -1
- package/safeParseInt.mjs +0 -8
package/timer.cjs
CHANGED
|
@@ -1,189 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
19
2
|
|
|
20
|
-
// src/timer.ts
|
|
21
|
-
var timer_exports = {};
|
|
22
|
-
__export(timer_exports, {
|
|
23
|
-
Timer: () => Timer,
|
|
24
|
-
timer: () => timer
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(timer_exports);
|
|
27
3
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var HOURS_PER_DAY = 24;
|
|
4
|
+
var _chunkBZKQXX3Acjs = require('./chunk-BZKQXX3A.cjs');
|
|
5
|
+
require('./chunk-4GLOLTJ5.cjs');
|
|
6
|
+
require('./chunk-Y7MC73BZ.cjs');
|
|
7
|
+
require('./chunk-ILGTU46T.cjs');
|
|
8
|
+
_chunkBZKQXX3Acjs.init_timer.call(void 0, );
|
|
34
9
|
|
|
35
|
-
// src/duration.ts
|
|
36
|
-
var DURATION_TYPE_SEQUENCE = [
|
|
37
|
-
"days",
|
|
38
|
-
"hours",
|
|
39
|
-
"minutes",
|
|
40
|
-
"seconds",
|
|
41
|
-
"milliseconds"
|
|
42
|
-
];
|
|
43
|
-
var DURATION_STYLE_SUFFIX_MAP = {
|
|
44
|
-
days: {
|
|
45
|
-
short: "day",
|
|
46
|
-
shorts: "days",
|
|
47
|
-
long: "day",
|
|
48
|
-
longs: "days",
|
|
49
|
-
narrow: "d"
|
|
50
|
-
},
|
|
51
|
-
hours: {
|
|
52
|
-
short: "hr",
|
|
53
|
-
shorts: "hrs",
|
|
54
|
-
long: "hour",
|
|
55
|
-
longs: "hours",
|
|
56
|
-
narrow: "h"
|
|
57
|
-
},
|
|
58
|
-
minutes: {
|
|
59
|
-
short: "min",
|
|
60
|
-
shorts: "mins",
|
|
61
|
-
long: "minute",
|
|
62
|
-
longs: "minutes",
|
|
63
|
-
narrow: "m"
|
|
64
|
-
},
|
|
65
|
-
seconds: {
|
|
66
|
-
short: "sec",
|
|
67
|
-
shorts: "secs",
|
|
68
|
-
long: "second",
|
|
69
|
-
longs: "seconds",
|
|
70
|
-
narrow: "s"
|
|
71
|
-
},
|
|
72
|
-
milliseconds: {
|
|
73
|
-
short: "ms",
|
|
74
|
-
shorts: "ms",
|
|
75
|
-
long: "millisecond",
|
|
76
|
-
longs: "milliseconds",
|
|
77
|
-
narrow: "ms"
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
function getDurationStyleForPlural(style) {
|
|
81
|
-
return style == "short" ? "shorts" : style === "long" ? "longs" : style;
|
|
82
|
-
}
|
|
83
|
-
function getValueAndUnitSeparator(style) {
|
|
84
|
-
return style === "narrow" ? "" : " ";
|
|
85
|
-
}
|
|
86
|
-
function getDurationTypeSeparator(style) {
|
|
87
|
-
return style === "narrow" ? " " : ", ";
|
|
88
|
-
}
|
|
89
|
-
function msToDuration(ms, durationTypeForZero) {
|
|
90
|
-
if (ms === 0) {
|
|
91
|
-
durationTypeForZero = durationTypeForZero ?? "milliseconds";
|
|
92
|
-
return { [durationTypeForZero]: 0 };
|
|
93
|
-
}
|
|
94
|
-
const duration = {};
|
|
95
|
-
for (let i = 0; i < 1; i++) {
|
|
96
|
-
let seconds = Math.floor(ms / MS_PER_SECOND);
|
|
97
|
-
const millis = ms - seconds * MS_PER_SECOND;
|
|
98
|
-
if (millis > 0) {
|
|
99
|
-
duration["milliseconds"] = millis;
|
|
100
|
-
}
|
|
101
|
-
if (seconds === 0) {
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
let minutes = Math.floor(seconds / SECONDS_PER_MINUTE);
|
|
105
|
-
seconds -= minutes * SECONDS_PER_MINUTE;
|
|
106
|
-
if (seconds > 0) {
|
|
107
|
-
duration["seconds"] = seconds;
|
|
108
|
-
}
|
|
109
|
-
if (minutes === 0) {
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
let hours = Math.floor(minutes / MINUTES_PER_HOUR);
|
|
113
|
-
minutes -= hours * MINUTES_PER_HOUR;
|
|
114
|
-
if (minutes > 0) {
|
|
115
|
-
duration["minutes"] = minutes;
|
|
116
|
-
}
|
|
117
|
-
if (hours === 0) {
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
const days = Math.floor(hours / HOURS_PER_DAY);
|
|
121
|
-
hours -= days * HOURS_PER_DAY;
|
|
122
|
-
if (hours > 0) {
|
|
123
|
-
duration["hours"] = hours;
|
|
124
|
-
}
|
|
125
|
-
if (days > 0) {
|
|
126
|
-
duration["days"] = days;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return duration;
|
|
130
|
-
}
|
|
131
|
-
function formatDuration(duration, style) {
|
|
132
|
-
style = style ?? "short";
|
|
133
|
-
const stylePlural = getDurationStyleForPlural(style);
|
|
134
|
-
const space = getValueAndUnitSeparator(style);
|
|
135
|
-
const a = [];
|
|
136
|
-
for (const unit of DURATION_TYPE_SEQUENCE) {
|
|
137
|
-
const value = duration[unit];
|
|
138
|
-
if (value === void 0) continue;
|
|
139
|
-
const suffixMap = DURATION_STYLE_SUFFIX_MAP[unit];
|
|
140
|
-
const suffix = value === 1 ? suffixMap[style] : suffixMap[stylePlural];
|
|
141
|
-
a.push(value + space + suffix);
|
|
142
|
-
}
|
|
143
|
-
const separator = getDurationTypeSeparator(style);
|
|
144
|
-
return a.join(separator);
|
|
145
|
-
}
|
|
146
|
-
function readableDuration(ms, options) {
|
|
147
|
-
const duration = msToDuration(ms, options?.durationTypeForZero);
|
|
148
|
-
return formatDuration(duration, options?.style);
|
|
149
|
-
}
|
|
150
|
-
function elapsed(ms) {
|
|
151
|
-
if (ms > MS_PER_MINUTE) {
|
|
152
|
-
return readableDuration(ms);
|
|
153
|
-
}
|
|
154
|
-
if (ms > 100) {
|
|
155
|
-
return `${(ms / 1e3).toFixed(3)}s`;
|
|
156
|
-
}
|
|
157
|
-
return ms + "ms";
|
|
158
|
-
}
|
|
159
10
|
|
|
160
|
-
|
|
161
|
-
var Timer = class {
|
|
162
|
-
startMs;
|
|
163
|
-
endMs = 0;
|
|
164
|
-
constructor() {
|
|
165
|
-
this.startMs = Date.now();
|
|
166
|
-
}
|
|
167
|
-
stop() {
|
|
168
|
-
this.endMs = Date.now();
|
|
169
|
-
}
|
|
170
|
-
restart() {
|
|
171
|
-
this.endMs = 0;
|
|
172
|
-
this.startMs = Date.now();
|
|
173
|
-
}
|
|
174
|
-
elapsedMs() {
|
|
175
|
-
const stopMs = this.endMs || Date.now();
|
|
176
|
-
return stopMs - this.startMs;
|
|
177
|
-
}
|
|
178
|
-
toString() {
|
|
179
|
-
return elapsed(this.elapsedMs());
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
function timer() {
|
|
183
|
-
return new Timer();
|
|
184
|
-
}
|
|
185
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
186
|
-
0 && (module.exports = {
|
|
187
|
-
Timer,
|
|
188
|
-
timer
|
|
189
|
-
});
|
|
11
|
+
exports.timer = _chunkBZKQXX3Acjs.timer;
|
package/timer.d.mts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Create a new timer and starts the timing right away. Returns a closed object
|
|
3
|
+
* instead of a class to make sure the variables are bound correctly.
|
|
4
|
+
*/
|
|
5
|
+
declare function timer(): {
|
|
2
6
|
startMs: number;
|
|
3
7
|
endMs: number;
|
|
4
|
-
constructor();
|
|
5
8
|
stop(): void;
|
|
6
9
|
restart(): void;
|
|
7
10
|
elapsedMs(): number;
|
|
8
11
|
toString(): string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
+
};
|
|
13
|
+
/** Defines the type of the Timer object. */
|
|
14
|
+
type Timer = ReturnType<typeof timer>;
|
|
12
15
|
|
|
13
|
-
export { Timer, timer };
|
|
16
|
+
export { type Timer, timer };
|
package/timer.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Create a new timer and starts the timing right away. Returns a closed object
|
|
3
|
+
* instead of a class to make sure the variables are bound correctly.
|
|
4
|
+
*/
|
|
5
|
+
declare function timer(): {
|
|
2
6
|
startMs: number;
|
|
3
7
|
endMs: number;
|
|
4
|
-
constructor();
|
|
5
8
|
stop(): void;
|
|
6
9
|
restart(): void;
|
|
7
10
|
elapsedMs(): number;
|
|
8
11
|
toString(): string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
+
};
|
|
13
|
+
/** Defines the type of the Timer object. */
|
|
14
|
+
type Timer = ReturnType<typeof timer>;
|
|
12
15
|
|
|
13
|
-
export { Timer, timer };
|
|
16
|
+
export { type Timer, timer };
|
package/timer.min.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZKIZ5SWKmincjs = require('./chunk-ZKIZ5SWK.min.cjs');require('./chunk-27MBP3ES.min.cjs');require('./chunk-GAP2HS5M.min.cjs');require('./chunk-QNNJNLGK.min.cjs');_chunkZKIZ5SWKmincjs.b.call(void 0, );exports.timer = _chunkZKIZ5SWKmincjs.a;
|
|
2
2
|
//# sourceMappingURL=timer.min.cjs.map
|
package/timer.min.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/timer.ts","../src/duration.ts"],"sourcesContent":["import { elapsed } from \"./duration\";\n\nexport class Timer {\n public startMs: number;\n public endMs = 0;\n\n public constructor() {\n this.startMs = Date.now();\n }\n\n public stop(): void {\n this.endMs = Date.now();\n }\n\n public restart(): void {\n this.endMs = 0;\n this.startMs = Date.now();\n }\n\n public elapsedMs(): number {\n const stopMs = this.endMs || Date.now();\n return stopMs - this.startMs;\n }\n\n public toString(): string {\n return elapsed(this.elapsedMs());\n }\n}\n\n/** Shorthand for `new Timer()` to make this easier to use. */\nexport function timer(): Timer {\n return new Timer();\n}\n","/**\n * Bunch of miscellaneous constants and utility functions related to handling\n * date and time durations.\n *\n * Note that month and year do not have fixed durations, and hence are excluded\n * from this file. Weeks have fixed durations, but are excluded because we\n * use days as the max duration supported.\n */\n\nimport {\n HOURS_PER_DAY,\n MINUTES_PER_HOUR,\n MS_PER_DAY,\n MS_PER_HOUR,\n MS_PER_MINUTE,\n MS_PER_SECOND,\n SECONDS_PER_MINUTE,\n} from \"./timeConstants\";\n\nexport type Duration = {\n days?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n};\n\n/**\n * One of: days, hours, minutes, seconds, milliseconds\n */\nexport type DurationType = keyof Duration;\n\n/**\n * Order in which the duration type appears in the duration string.\n */\nexport const DURATION_TYPE_SEQUENCE: DurationType[] = [\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\n/**\n * Follows the same format as Intl.DurationFormat.prototype.format().\n *\n * Short: 1 yr, 2 mths, 3 wks, 3 days, 4 hr, 5 min, 6 sec, 7 ms, 8 μs, 9 ns\n * Long: 1 year, 2 months, 3 weeks, 3 days, 4 hours, 5 minutes, 6 seconds,\n * 7 milliseconds, 8 microseconds, 9 nanoseconds\n * Narrow: 1y 2mo 3w 3d 4h 5m 6s 7ms 8μs 9ns\n */\nexport type DurationStyle = \"short\" | \"long\" | \"narrow\";\n\nexport type DurationSuffixMap = {\n short: string;\n shorts: string;\n long: string;\n longs: string;\n narrow: string;\n};\n\nexport type DurationSuffixType = keyof DurationSuffixMap;\n\nexport const DURATION_STYLE_SUFFIX_MAP: Record<\n DurationType,\n DurationSuffixMap\n> = {\n days: {\n short: \"day\",\n shorts: \"days\",\n long: \"day\",\n longs: \"days\",\n narrow: \"d\",\n },\n hours: {\n short: \"hr\",\n shorts: \"hrs\",\n long: \"hour\",\n longs: \"hours\",\n narrow: \"h\",\n },\n minutes: {\n short: \"min\",\n shorts: \"mins\",\n long: \"minute\",\n longs: \"minutes\",\n narrow: \"m\",\n },\n seconds: {\n short: \"sec\",\n shorts: \"secs\",\n long: \"second\",\n longs: \"seconds\",\n narrow: \"s\",\n },\n milliseconds: {\n short: \"ms\",\n shorts: \"ms\",\n long: \"millisecond\",\n longs: \"milliseconds\",\n narrow: \"ms\",\n },\n};\n\nfunction getDurationStyleForPlural(style: DurationStyle): DurationSuffixType {\n return style == \"short\" ? \"shorts\" : style === \"long\" ? \"longs\" : style;\n}\n\nfunction getValueAndUnitSeparator(style: DurationStyle): string {\n return style === \"narrow\" ? \"\" : \" \";\n}\n\nfunction getDurationTypeSeparator(style: DurationStyle): string {\n return style === \"narrow\" ? \" \" : \", \";\n}\n\n/**\n * Convert a milliseconds duration into a Duration object. If the given ms is\n * zero, then return an object with a single field of zero with duration type\n * of durationTypeForZero.\n *\n * @param durationTypeForZero Defaults to 'milliseconds'\n */\nexport function msToDuration(\n ms: number,\n durationTypeForZero?: DurationType,\n): Duration {\n if (ms === 0) {\n durationTypeForZero = durationTypeForZero ?? \"milliseconds\";\n return { [durationTypeForZero]: 0 };\n }\n\n const duration: Duration = {};\n\n for (let i = 0; i < 1; i++) {\n let seconds = Math.floor(ms / MS_PER_SECOND);\n const millis = ms - seconds * MS_PER_SECOND;\n\n if (millis > 0) {\n duration[\"milliseconds\"] = millis;\n }\n\n if (seconds === 0) {\n break;\n }\n\n let minutes = Math.floor(seconds / SECONDS_PER_MINUTE);\n seconds -= minutes * SECONDS_PER_MINUTE;\n\n if (seconds > 0) {\n duration[\"seconds\"] = seconds;\n }\n\n if (minutes === 0) {\n break;\n }\n\n let hours = Math.floor(minutes / MINUTES_PER_HOUR);\n minutes -= hours * MINUTES_PER_HOUR;\n\n if (minutes > 0) {\n duration[\"minutes\"] = minutes;\n }\n\n if (hours === 0) {\n break;\n }\n\n const days = Math.floor(hours / HOURS_PER_DAY);\n hours -= days * HOURS_PER_DAY;\n\n if (hours > 0) {\n duration[\"hours\"] = hours;\n }\n\n if (days > 0) {\n duration[\"days\"] = days;\n }\n }\n\n return duration;\n}\n\n/**\n * Returns the number of milliseconds for the given duration.\n */\nexport function durationToMs(duration: Duration): number {\n const daysMs = (duration.days ?? 0) * MS_PER_DAY;\n const hoursMs = (duration.hours ?? 0) * MS_PER_HOUR;\n const minsMs = (duration.minutes ?? 0) * MS_PER_MINUTE;\n const secsMs = (duration.seconds ?? 0) * MS_PER_SECOND;\n const msMs = duration.milliseconds ?? 0;\n\n return daysMs + hoursMs + minsMs + secsMs + msMs;\n}\n\n/**\n * Convenience function to return a duration given an ms or Duration.\n */\nexport function durationOrMsToMs(duration: number | Duration): number {\n return typeof duration === \"number\" ? duration : durationToMs(duration);\n}\n\n/**\n * Format a given Duration object into a string. If the object has no fields,\n * then returns an empty string.\n *\n * @param style Defaults to 'short'\n */\nexport function formatDuration(duration: Duration, style?: DurationStyle) {\n style = style ?? \"short\";\n const stylePlural = getDurationStyleForPlural(style);\n\n const space = getValueAndUnitSeparator(style);\n\n const a: string[] = [];\n\n for (const unit of DURATION_TYPE_SEQUENCE) {\n const value = duration[unit];\n if (value === undefined) continue;\n\n const suffixMap = DURATION_STYLE_SUFFIX_MAP[unit];\n const suffix = value === 1 ? suffixMap[style] : suffixMap[stylePlural];\n a.push(value + space + suffix);\n }\n\n const separator = getDurationTypeSeparator(style);\n return a.join(separator);\n}\n\n/**\n * Convert a millisecond duration into a human-readable duration string.\n *\n * @param options.durationTypeForZero - Defaults to 'milliseconds'\n * @param options.style - Defaults to 'short'\n */\nexport function readableDuration(\n ms: number,\n options?: { durationTypeForZero?: DurationType; style?: DurationStyle },\n): string {\n const duration = msToDuration(ms, options?.durationTypeForZero);\n\n return formatDuration(duration, options?.style);\n}\n\n/** A shortened duration string useful for logging timings. */\nexport function elapsed(ms: number): string {\n // Use long format for 1 minute or over.\n if (ms > MS_PER_MINUTE) {\n return readableDuration(ms);\n }\n\n // Use seconds format for over 100ms.\n if (ms > 100) {\n return `${(ms / 1000).toFixed(3)}s`;\n }\n\n // Use milliseconds format.\n return ms + \"ms\";\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,UAAAC,IAAA,eAAAC,EAAAJ,GCmCO,IAAMK,EAAyC,CACpD,OACA,QACA,UACA,UACA,cACF,EAsBaC,EAGT,CACF,KAAM,CACJ,MAAO,MACP,OAAQ,OACR,KAAM,MACN,MAAO,OACP,OAAQ,GACV,EACA,MAAO,CACL,MAAO,KACP,OAAQ,MACR,KAAM,OACN,MAAO,QACP,OAAQ,GACV,EACA,QAAS,CACP,MAAO,MACP,OAAQ,OACR,KAAM,SACN,MAAO,UACP,OAAQ,GACV,EACA,QAAS,CACP,MAAO,MACP,OAAQ,OACR,KAAM,SACN,MAAO,UACP,OAAQ,GACV,EACA,aAAc,CACZ,MAAO,KACP,OAAQ,KACR,KAAM,cACN,MAAO,eACP,OAAQ,IACV,CACF,EAEA,SAASC,EAA0BC,EAA0C,CAC3E,OAAOA,GAAS,QAAU,SAAWA,IAAU,OAAS,QAAUA,CACpE,CAEA,SAASC,EAAyBD,EAA8B,CAC9D,OAAOA,IAAU,SAAW,GAAK,GACnC,CAEA,SAASE,EAAyBF,EAA8B,CAC9D,OAAOA,IAAU,SAAW,IAAM,IACpC,CASO,SAASG,EACdC,EACAC,EACU,CACV,GAAID,IAAO,EACT,OAAAC,EAAsBA,GAAuB,eACtC,CAAE,CAACA,CAAmB,EAAG,CAAE,EAGpC,IAAMC,EAAqB,CAAC,EAE5B,QAAS,EAAI,EAAG,EAAI,EAAG,IAAK,CAC1B,IAAIC,EAAU,KAAK,MAAMH,EAAK,GAAa,EACrCI,EAASJ,EAAKG,EAAU,IAM9B,GAJIC,EAAS,IACXF,EAAS,aAAkBE,GAGzBD,IAAY,EACd,MAGF,IAAIE,EAAU,KAAK,MAAMF,EAAU,EAAkB,EAOrD,GANAA,GAAWE,EAAU,GAEjBF,EAAU,IACZD,EAAS,QAAaC,GAGpBE,IAAY,EACd,MAGF,IAAIC,EAAQ,KAAK,MAAMD,EAAU,EAAgB,EAOjD,GANAA,GAAWC,EAAQ,GAEfD,EAAU,IACZH,EAAS,QAAaG,GAGpBC,IAAU,EACZ,MAGF,IAAMC,EAAO,KAAK,MAAMD,EAAQ,EAAa,EAC7CA,GAASC,EAAO,GAEZD,EAAQ,IACVJ,EAAS,MAAWI,GAGlBC,EAAO,IACTL,EAAS,KAAUK,EAEvB,CAEA,OAAOL,CACT,CA4BO,SAASM,EAAeC,EAAoBC,EAAuB,CACxEA,EAAQA,GAAS,QACjB,IAAMC,EAAcC,EAA0BF,CAAK,EAE7CG,EAAQC,EAAyBJ,CAAK,EAEtCK,EAAc,CAAC,EAErB,QAAWC,KAAQC,EAAwB,CACzC,IAAMC,EAAQT,EAASO,CAAI,EAC3B,GAAIE,IAAU,OAAW,SAEzB,IAAMC,EAAYC,EAA0BJ,CAAI,EAC1CK,EAASH,IAAU,EAAIC,EAAUT,CAAK,EAAIS,EAAUR,CAAW,EACrEI,EAAE,KAAKG,EAAQL,EAAQQ,CAAM,CAC/B,CAEA,IAAMC,EAAYC,EAAyBb,CAAK,EAChD,OAAOK,EAAE,KAAKO,CAAS,CACzB,CAQO,SAASE,EACdC,EACAC,EACQ,CACR,IAAMjB,EAAWkB,EAAaF,EAAIC,GAAS,mBAAmB,EAE9D,OAAOlB,EAAeC,EAAUiB,GAAS,KAAK,CAChD,CAGO,SAASE,EAAQH,EAAoB,CAE1C,OAAIA,EAAK,IACAD,EAAiBC,CAAE,EAIxBA,EAAK,IACA,IAAIA,EAAK,KAAM,QAAQ,CAAC,CAAC,IAI3BA,EAAK,IACd,CDjQO,IAAMI,EAAN,KAAY,CACV,QACA,MAAQ,EAER,aAAc,CACnB,KAAK,QAAU,KAAK,IAAI,CAC1B,CAEO,MAAa,CAClB,KAAK,MAAQ,KAAK,IAAI,CACxB,CAEO,SAAgB,CACrB,KAAK,MAAQ,EACb,KAAK,QAAU,KAAK,IAAI,CAC1B,CAEO,WAAoB,CAEzB,OADe,KAAK,OAAS,KAAK,IAAI,GACtB,KAAK,OACvB,CAEO,UAAmB,CACxB,OAAOC,EAAQ,KAAK,UAAU,CAAC,CACjC,CACF,EAGO,SAASC,GAAe,CAC7B,OAAO,IAAIF,CACb","names":["timer_exports","__export","Timer","timer","__toCommonJS","DURATION_TYPE_SEQUENCE","DURATION_STYLE_SUFFIX_MAP","getDurationStyleForPlural","style","getValueAndUnitSeparator","getDurationTypeSeparator","msToDuration","ms","durationTypeForZero","duration","seconds","millis","minutes","hours","days","formatDuration","duration","style","stylePlural","getDurationStyleForPlural","space","getValueAndUnitSeparator","a","unit","DURATION_TYPE_SEQUENCE","value","suffixMap","DURATION_STYLE_SUFFIX_MAP","suffix","separator","getDurationTypeSeparator","readableDuration","ms","options","msToDuration","elapsed","Timer","elapsed","timer"]}
|
|
1
|
+
{"version":3,"sources":["/Users/choksheaklau/src/ts-utils/dist/timer.min.cjs"],"names":[],"mappings":"AAAA,wIAAyC,oCAAiC,oCAAiC,oCAAiC,oCAAE,CAAE,CAAC,uCAAkB","file":"/Users/choksheaklau/src/ts-utils/dist/timer.min.cjs"}
|
package/timer.min.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{a,b}from"./chunk-OXSWWWOM.min.mjs";import"./chunk-Q4WCMSOW.min.mjs";import"./chunk-MN5EYNZN.min.mjs";import"./chunk-UOU6IP3S.min.mjs";b();export{a as timer};
|
|
2
2
|
//# sourceMappingURL=timer.min.mjs.map
|
package/timer.min.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/duration.ts","../src/timer.ts"],"sourcesContent":["/**\n * Bunch of miscellaneous constants and utility functions related to handling\n * date and time durations.\n *\n * Note that month and year do not have fixed durations, and hence are excluded\n * from this file. Weeks have fixed durations, but are excluded because we\n * use days as the max duration supported.\n */\n\nimport {\n HOURS_PER_DAY,\n MINUTES_PER_HOUR,\n MS_PER_DAY,\n MS_PER_HOUR,\n MS_PER_MINUTE,\n MS_PER_SECOND,\n SECONDS_PER_MINUTE,\n} from \"./timeConstants\";\n\nexport type Duration = {\n days?: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n};\n\n/**\n * One of: days, hours, minutes, seconds, milliseconds\n */\nexport type DurationType = keyof Duration;\n\n/**\n * Order in which the duration type appears in the duration string.\n */\nexport const DURATION_TYPE_SEQUENCE: DurationType[] = [\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\n/**\n * Follows the same format as Intl.DurationFormat.prototype.format().\n *\n * Short: 1 yr, 2 mths, 3 wks, 3 days, 4 hr, 5 min, 6 sec, 7 ms, 8 μs, 9 ns\n * Long: 1 year, 2 months, 3 weeks, 3 days, 4 hours, 5 minutes, 6 seconds,\n * 7 milliseconds, 8 microseconds, 9 nanoseconds\n * Narrow: 1y 2mo 3w 3d 4h 5m 6s 7ms 8μs 9ns\n */\nexport type DurationStyle = \"short\" | \"long\" | \"narrow\";\n\nexport type DurationSuffixMap = {\n short: string;\n shorts: string;\n long: string;\n longs: string;\n narrow: string;\n};\n\nexport type DurationSuffixType = keyof DurationSuffixMap;\n\nexport const DURATION_STYLE_SUFFIX_MAP: Record<\n DurationType,\n DurationSuffixMap\n> = {\n days: {\n short: \"day\",\n shorts: \"days\",\n long: \"day\",\n longs: \"days\",\n narrow: \"d\",\n },\n hours: {\n short: \"hr\",\n shorts: \"hrs\",\n long: \"hour\",\n longs: \"hours\",\n narrow: \"h\",\n },\n minutes: {\n short: \"min\",\n shorts: \"mins\",\n long: \"minute\",\n longs: \"minutes\",\n narrow: \"m\",\n },\n seconds: {\n short: \"sec\",\n shorts: \"secs\",\n long: \"second\",\n longs: \"seconds\",\n narrow: \"s\",\n },\n milliseconds: {\n short: \"ms\",\n shorts: \"ms\",\n long: \"millisecond\",\n longs: \"milliseconds\",\n narrow: \"ms\",\n },\n};\n\nfunction getDurationStyleForPlural(style: DurationStyle): DurationSuffixType {\n return style == \"short\" ? \"shorts\" : style === \"long\" ? \"longs\" : style;\n}\n\nfunction getValueAndUnitSeparator(style: DurationStyle): string {\n return style === \"narrow\" ? \"\" : \" \";\n}\n\nfunction getDurationTypeSeparator(style: DurationStyle): string {\n return style === \"narrow\" ? \" \" : \", \";\n}\n\n/**\n * Convert a milliseconds duration into a Duration object. If the given ms is\n * zero, then return an object with a single field of zero with duration type\n * of durationTypeForZero.\n *\n * @param durationTypeForZero Defaults to 'milliseconds'\n */\nexport function msToDuration(\n ms: number,\n durationTypeForZero?: DurationType,\n): Duration {\n if (ms === 0) {\n durationTypeForZero = durationTypeForZero ?? \"milliseconds\";\n return { [durationTypeForZero]: 0 };\n }\n\n const duration: Duration = {};\n\n for (let i = 0; i < 1; i++) {\n let seconds = Math.floor(ms / MS_PER_SECOND);\n const millis = ms - seconds * MS_PER_SECOND;\n\n if (millis > 0) {\n duration[\"milliseconds\"] = millis;\n }\n\n if (seconds === 0) {\n break;\n }\n\n let minutes = Math.floor(seconds / SECONDS_PER_MINUTE);\n seconds -= minutes * SECONDS_PER_MINUTE;\n\n if (seconds > 0) {\n duration[\"seconds\"] = seconds;\n }\n\n if (minutes === 0) {\n break;\n }\n\n let hours = Math.floor(minutes / MINUTES_PER_HOUR);\n minutes -= hours * MINUTES_PER_HOUR;\n\n if (minutes > 0) {\n duration[\"minutes\"] = minutes;\n }\n\n if (hours === 0) {\n break;\n }\n\n const days = Math.floor(hours / HOURS_PER_DAY);\n hours -= days * HOURS_PER_DAY;\n\n if (hours > 0) {\n duration[\"hours\"] = hours;\n }\n\n if (days > 0) {\n duration[\"days\"] = days;\n }\n }\n\n return duration;\n}\n\n/**\n * Returns the number of milliseconds for the given duration.\n */\nexport function durationToMs(duration: Duration): number {\n const daysMs = (duration.days ?? 0) * MS_PER_DAY;\n const hoursMs = (duration.hours ?? 0) * MS_PER_HOUR;\n const minsMs = (duration.minutes ?? 0) * MS_PER_MINUTE;\n const secsMs = (duration.seconds ?? 0) * MS_PER_SECOND;\n const msMs = duration.milliseconds ?? 0;\n\n return daysMs + hoursMs + minsMs + secsMs + msMs;\n}\n\n/**\n * Convenience function to return a duration given an ms or Duration.\n */\nexport function durationOrMsToMs(duration: number | Duration): number {\n return typeof duration === \"number\" ? duration : durationToMs(duration);\n}\n\n/**\n * Format a given Duration object into a string. If the object has no fields,\n * then returns an empty string.\n *\n * @param style Defaults to 'short'\n */\nexport function formatDuration(duration: Duration, style?: DurationStyle) {\n style = style ?? \"short\";\n const stylePlural = getDurationStyleForPlural(style);\n\n const space = getValueAndUnitSeparator(style);\n\n const a: string[] = [];\n\n for (const unit of DURATION_TYPE_SEQUENCE) {\n const value = duration[unit];\n if (value === undefined) continue;\n\n const suffixMap = DURATION_STYLE_SUFFIX_MAP[unit];\n const suffix = value === 1 ? suffixMap[style] : suffixMap[stylePlural];\n a.push(value + space + suffix);\n }\n\n const separator = getDurationTypeSeparator(style);\n return a.join(separator);\n}\n\n/**\n * Convert a millisecond duration into a human-readable duration string.\n *\n * @param options.durationTypeForZero - Defaults to 'milliseconds'\n * @param options.style - Defaults to 'short'\n */\nexport function readableDuration(\n ms: number,\n options?: { durationTypeForZero?: DurationType; style?: DurationStyle },\n): string {\n const duration = msToDuration(ms, options?.durationTypeForZero);\n\n return formatDuration(duration, options?.style);\n}\n\n/** A shortened duration string useful for logging timings. */\nexport function elapsed(ms: number): string {\n // Use long format for 1 minute or over.\n if (ms > MS_PER_MINUTE) {\n return readableDuration(ms);\n }\n\n // Use seconds format for over 100ms.\n if (ms > 100) {\n return `${(ms / 1000).toFixed(3)}s`;\n }\n\n // Use milliseconds format.\n return ms + \"ms\";\n}\n","import { elapsed } from \"./duration\";\n\nexport class Timer {\n public startMs: number;\n public endMs = 0;\n\n public constructor() {\n this.startMs = Date.now();\n }\n\n public stop(): void {\n this.endMs = Date.now();\n }\n\n public restart(): void {\n this.endMs = 0;\n this.startMs = Date.now();\n }\n\n public elapsedMs(): number {\n const stopMs = this.endMs || Date.now();\n return stopMs - this.startMs;\n }\n\n public toString(): string {\n return elapsed(this.elapsedMs());\n }\n}\n\n/** Shorthand for `new Timer()` to make this easier to use. */\nexport function timer(): Timer {\n return new Timer();\n}\n"],"mappings":"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","names":["DURATION_TYPE_SEQUENCE","DURATION_STYLE_SUFFIX_MAP","getDurationStyleForPlural","style","getValueAndUnitSeparator","getDurationTypeSeparator","msToDuration","ms","durationTypeForZero","duration","i","seconds","millis","minutes","hours","days","formatDuration","duration","style","stylePlural","getDurationStyleForPlural","space","getValueAndUnitSeparator","a","unit","DURATION_TYPE_SEQUENCE","value","suffixMap","DURATION_STYLE_SUFFIX_MAP","suffix","separator","getDurationTypeSeparator","readableDuration","ms","options","msToDuration","elapsed","Timer","elapsed","timer"]}
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/timer.mjs
CHANGED
|
@@ -1,161 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var DURATION_TYPE_SEQUENCE = [
|
|
10
|
-
"days",
|
|
11
|
-
"hours",
|
|
12
|
-
"minutes",
|
|
13
|
-
"seconds",
|
|
14
|
-
"milliseconds"
|
|
15
|
-
];
|
|
16
|
-
var DURATION_STYLE_SUFFIX_MAP = {
|
|
17
|
-
days: {
|
|
18
|
-
short: "day",
|
|
19
|
-
shorts: "days",
|
|
20
|
-
long: "day",
|
|
21
|
-
longs: "days",
|
|
22
|
-
narrow: "d"
|
|
23
|
-
},
|
|
24
|
-
hours: {
|
|
25
|
-
short: "hr",
|
|
26
|
-
shorts: "hrs",
|
|
27
|
-
long: "hour",
|
|
28
|
-
longs: "hours",
|
|
29
|
-
narrow: "h"
|
|
30
|
-
},
|
|
31
|
-
minutes: {
|
|
32
|
-
short: "min",
|
|
33
|
-
shorts: "mins",
|
|
34
|
-
long: "minute",
|
|
35
|
-
longs: "minutes",
|
|
36
|
-
narrow: "m"
|
|
37
|
-
},
|
|
38
|
-
seconds: {
|
|
39
|
-
short: "sec",
|
|
40
|
-
shorts: "secs",
|
|
41
|
-
long: "second",
|
|
42
|
-
longs: "seconds",
|
|
43
|
-
narrow: "s"
|
|
44
|
-
},
|
|
45
|
-
milliseconds: {
|
|
46
|
-
short: "ms",
|
|
47
|
-
shorts: "ms",
|
|
48
|
-
long: "millisecond",
|
|
49
|
-
longs: "milliseconds",
|
|
50
|
-
narrow: "ms"
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
function getDurationStyleForPlural(style) {
|
|
54
|
-
return style == "short" ? "shorts" : style === "long" ? "longs" : style;
|
|
55
|
-
}
|
|
56
|
-
function getValueAndUnitSeparator(style) {
|
|
57
|
-
return style === "narrow" ? "" : " ";
|
|
58
|
-
}
|
|
59
|
-
function getDurationTypeSeparator(style) {
|
|
60
|
-
return style === "narrow" ? " " : ", ";
|
|
61
|
-
}
|
|
62
|
-
function msToDuration(ms, durationTypeForZero) {
|
|
63
|
-
if (ms === 0) {
|
|
64
|
-
durationTypeForZero = durationTypeForZero ?? "milliseconds";
|
|
65
|
-
return { [durationTypeForZero]: 0 };
|
|
66
|
-
}
|
|
67
|
-
const duration = {};
|
|
68
|
-
for (let i = 0; i < 1; i++) {
|
|
69
|
-
let seconds = Math.floor(ms / MS_PER_SECOND);
|
|
70
|
-
const millis = ms - seconds * MS_PER_SECOND;
|
|
71
|
-
if (millis > 0) {
|
|
72
|
-
duration["milliseconds"] = millis;
|
|
73
|
-
}
|
|
74
|
-
if (seconds === 0) {
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
let minutes = Math.floor(seconds / SECONDS_PER_MINUTE);
|
|
78
|
-
seconds -= minutes * SECONDS_PER_MINUTE;
|
|
79
|
-
if (seconds > 0) {
|
|
80
|
-
duration["seconds"] = seconds;
|
|
81
|
-
}
|
|
82
|
-
if (minutes === 0) {
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
let hours = Math.floor(minutes / MINUTES_PER_HOUR);
|
|
86
|
-
minutes -= hours * MINUTES_PER_HOUR;
|
|
87
|
-
if (minutes > 0) {
|
|
88
|
-
duration["minutes"] = minutes;
|
|
89
|
-
}
|
|
90
|
-
if (hours === 0) {
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
const days = Math.floor(hours / HOURS_PER_DAY);
|
|
94
|
-
hours -= days * HOURS_PER_DAY;
|
|
95
|
-
if (hours > 0) {
|
|
96
|
-
duration["hours"] = hours;
|
|
97
|
-
}
|
|
98
|
-
if (days > 0) {
|
|
99
|
-
duration["days"] = days;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return duration;
|
|
103
|
-
}
|
|
104
|
-
function formatDuration(duration, style) {
|
|
105
|
-
style = style ?? "short";
|
|
106
|
-
const stylePlural = getDurationStyleForPlural(style);
|
|
107
|
-
const space = getValueAndUnitSeparator(style);
|
|
108
|
-
const a = [];
|
|
109
|
-
for (const unit of DURATION_TYPE_SEQUENCE) {
|
|
110
|
-
const value = duration[unit];
|
|
111
|
-
if (value === void 0) continue;
|
|
112
|
-
const suffixMap = DURATION_STYLE_SUFFIX_MAP[unit];
|
|
113
|
-
const suffix = value === 1 ? suffixMap[style] : suffixMap[stylePlural];
|
|
114
|
-
a.push(value + space + suffix);
|
|
115
|
-
}
|
|
116
|
-
const separator = getDurationTypeSeparator(style);
|
|
117
|
-
return a.join(separator);
|
|
118
|
-
}
|
|
119
|
-
function readableDuration(ms, options) {
|
|
120
|
-
const duration = msToDuration(ms, options?.durationTypeForZero);
|
|
121
|
-
return formatDuration(duration, options?.style);
|
|
122
|
-
}
|
|
123
|
-
function elapsed(ms) {
|
|
124
|
-
if (ms > MS_PER_MINUTE) {
|
|
125
|
-
return readableDuration(ms);
|
|
126
|
-
}
|
|
127
|
-
if (ms > 100) {
|
|
128
|
-
return `${(ms / 1e3).toFixed(3)}s`;
|
|
129
|
-
}
|
|
130
|
-
return ms + "ms";
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// src/timer.ts
|
|
134
|
-
var Timer = class {
|
|
135
|
-
startMs;
|
|
136
|
-
endMs = 0;
|
|
137
|
-
constructor() {
|
|
138
|
-
this.startMs = Date.now();
|
|
139
|
-
}
|
|
140
|
-
stop() {
|
|
141
|
-
this.endMs = Date.now();
|
|
142
|
-
}
|
|
143
|
-
restart() {
|
|
144
|
-
this.endMs = 0;
|
|
145
|
-
this.startMs = Date.now();
|
|
146
|
-
}
|
|
147
|
-
elapsedMs() {
|
|
148
|
-
const stopMs = this.endMs || Date.now();
|
|
149
|
-
return stopMs - this.startMs;
|
|
150
|
-
}
|
|
151
|
-
toString() {
|
|
152
|
-
return elapsed(this.elapsedMs());
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
function timer() {
|
|
156
|
-
return new Timer();
|
|
157
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
init_timer,
|
|
3
|
+
timer
|
|
4
|
+
} from "./chunk-YVWROQKU.mjs";
|
|
5
|
+
import "./chunk-VG7VV7J2.mjs";
|
|
6
|
+
import "./chunk-M5PIM2HB.mjs";
|
|
7
|
+
import "./chunk-M6PYQYOX.mjs";
|
|
8
|
+
init_timer();
|
|
158
9
|
export {
|
|
159
|
-
Timer,
|
|
160
10
|
timer
|
|
161
11
|
};
|
package/toReadableString.cjs
CHANGED
|
@@ -1,69 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
module.exports = __toCommonJS(toReadableString_exports);
|
|
26
|
-
function toReadableString(u, options) {
|
|
27
|
-
if (typeof u === "string") {
|
|
28
|
-
return u;
|
|
29
|
-
}
|
|
30
|
-
if (u instanceof Error) {
|
|
31
|
-
const error = u;
|
|
32
|
-
let result = "";
|
|
33
|
-
const errorName = error.name || "Error";
|
|
34
|
-
const errorMessage = error.message || "An error occurred with no message provided.";
|
|
35
|
-
result += `${errorName}: ${errorMessage}`;
|
|
36
|
-
if (options?.includeStack && error.stack) {
|
|
37
|
-
const stack = error.stack.replace(new RegExp(`^${errorName}:.*\\n?`), "").trim();
|
|
38
|
-
if (stack) {
|
|
39
|
-
result += `
|
|
40
|
-
Stack Trace:
|
|
41
|
-
${stack}`;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (options?.includeErrorProps) {
|
|
45
|
-
const customProps = error;
|
|
46
|
-
const additionalInfo = Object.keys(customProps).filter(
|
|
47
|
-
(key) => key !== "name" && key !== "message" && key !== "stack" && typeof customProps[key] !== "function" && typeof customProps[key] !== "object"
|
|
48
|
-
).map((key) => `
|
|
49
|
-
- ${key}: ${customProps[key]}`);
|
|
50
|
-
if (additionalInfo.length > 0) {
|
|
51
|
-
result += `
|
|
52
|
-
Additional Data:${additionalInfo.join("")}`;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return result;
|
|
56
|
-
}
|
|
57
|
-
if (u !== null && typeof u === "object" && u.toString !== Object.prototype.toString) {
|
|
58
|
-
return u.toString();
|
|
59
|
-
}
|
|
60
|
-
try {
|
|
61
|
-
return JSON.stringify(u);
|
|
62
|
-
} catch {
|
|
63
|
-
return String(u);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
-
0 && (module.exports = {
|
|
68
|
-
toReadableString
|
|
69
|
-
});
|
|
3
|
+
var _chunkLDVEXETIcjs = require('./chunk-LDVEXETI.cjs');
|
|
4
|
+
require('./chunk-ILGTU46T.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.toReadableString = _chunkLDVEXETIcjs.toReadableString;
|
package/toReadableString.min.cjs
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Stack Trace:
|
|
3
|
-
${a}`)}if(t?.includeErrorProps){let a=n,s=Object.keys(a).filter(o=>o!=="name"&&o!=="message"&&o!=="stack"&&typeof a[o]!="function"&&typeof a[o]!="object").map(o=>`
|
|
4
|
-
- ${o}: ${a[o]}`);s.length>0&&(i+=`
|
|
5
|
-
Additional Data:${s.join("")}`)}return i}if(r!==null&&typeof r=="object"&&r.toString!==Object.prototype.toString)return r.toString();try{return JSON.stringify(r)}catch{return String(r)}}0&&(module.exports={toReadableString});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEDJJUP4Kmincjs = require('./chunk-EDJJUP4K.min.cjs');require('./chunk-QNNJNLGK.min.cjs');exports.toReadableString = _chunkEDJJUP4Kmincjs.a;
|
|
6
2
|
//# sourceMappingURL=toReadableString.min.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["/Users/choksheaklau/src/ts-utils/dist/toReadableString.min.cjs"],"names":[],"mappings":"AAAA,wIAAuC,oCAAiC,kDAA8B","file":"/Users/choksheaklau/src/ts-utils/dist/toReadableString.min.cjs"}
|
package/toReadableString.min.mjs
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
Stack Trace:
|
|
3
|
-
${n}`)}if(i?.includeErrorProps){let n=e,c=Object.keys(n).filter(t=>t!=="name"&&t!=="message"&&t!=="stack"&&typeof n[t]!="function"&&typeof n[t]!="object").map(t=>`
|
|
4
|
-
- ${t}: ${n[t]}`);c.length>0&&(o+=`
|
|
5
|
-
Additional Data:${c.join("")}`)}return o}if(r!==null&&typeof r=="object"&&r.toString!==Object.prototype.toString)return r.toString();try{return JSON.stringify(r)}catch{return String(r)}}export{f as toReadableString};
|
|
1
|
+
import{a}from"./chunk-FZZRSHSH.min.mjs";import"./chunk-UOU6IP3S.min.mjs";export{a as toReadableString};
|
|
6
2
|
//# sourceMappingURL=toReadableString.min.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/toReadableString.mjs
CHANGED
|
@@ -1,44 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
if (u instanceof Error) {
|
|
7
|
-
const error = u;
|
|
8
|
-
let result = "";
|
|
9
|
-
const errorName = error.name || "Error";
|
|
10
|
-
const errorMessage = error.message || "An error occurred with no message provided.";
|
|
11
|
-
result += `${errorName}: ${errorMessage}`;
|
|
12
|
-
if (options?.includeStack && error.stack) {
|
|
13
|
-
const stack = error.stack.replace(new RegExp(`^${errorName}:.*\\n?`), "").trim();
|
|
14
|
-
if (stack) {
|
|
15
|
-
result += `
|
|
16
|
-
Stack Trace:
|
|
17
|
-
${stack}`;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
if (options?.includeErrorProps) {
|
|
21
|
-
const customProps = error;
|
|
22
|
-
const additionalInfo = Object.keys(customProps).filter(
|
|
23
|
-
(key) => key !== "name" && key !== "message" && key !== "stack" && typeof customProps[key] !== "function" && typeof customProps[key] !== "object"
|
|
24
|
-
).map((key) => `
|
|
25
|
-
- ${key}: ${customProps[key]}`);
|
|
26
|
-
if (additionalInfo.length > 0) {
|
|
27
|
-
result += `
|
|
28
|
-
Additional Data:${additionalInfo.join("")}`;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
if (u !== null && typeof u === "object" && u.toString !== Object.prototype.toString) {
|
|
34
|
-
return u.toString();
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
return JSON.stringify(u);
|
|
38
|
-
} catch {
|
|
39
|
-
return String(u);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
toReadableString
|
|
3
|
+
} from "./chunk-KMNTU3DJ.mjs";
|
|
4
|
+
import "./chunk-M6PYQYOX.mjs";
|
|
42
5
|
export {
|
|
43
6
|
toReadableString
|
|
44
7
|
};
|