@simplysm/core-common 13.0.76 → 13.0.78
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 +64 -21
- package/dist/extensions/arr-ext.d.ts +1 -1
- package/dist/extensions/arr-ext.d.ts.map +1 -1
- package/dist/extensions/arr-ext.helpers.d.ts +8 -0
- package/dist/extensions/arr-ext.helpers.d.ts.map +1 -1
- package/dist/extensions/arr-ext.helpers.js +65 -0
- package/dist/extensions/arr-ext.helpers.js.map +2 -2
- package/dist/extensions/arr-ext.js +16 -124
- package/dist/extensions/arr-ext.js.map +2 -2
- package/dist/extensions/arr-ext.types.d.ts +40 -32
- package/dist/extensions/arr-ext.types.d.ts.map +1 -1
- package/dist/extensions/map-ext.js.map +1 -1
- package/dist/extensions/set-ext.js.map +1 -1
- package/dist/features/event-emitter.d.ts +4 -4
- package/dist/features/event-emitter.d.ts.map +1 -1
- package/dist/features/event-emitter.js.map +1 -1
- package/dist/features/serial-queue.js +2 -2
- package/dist/features/serial-queue.js.map +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -13
- package/dist/index.js.map +1 -1
- package/dist/types/date-only.js +2 -2
- package/dist/types/date-only.js.map +1 -1
- package/dist/types/date-time.js +2 -2
- package/dist/types/date-time.js.map +1 -1
- package/dist/types/time.js +2 -2
- package/dist/types/time.js.map +1 -1
- package/dist/types/uuid.d.ts +2 -2
- package/dist/types/uuid.d.ts.map +1 -1
- package/dist/types/uuid.js +1 -1
- package/dist/types/uuid.js.map +1 -1
- package/dist/utils/bytes.d.ts +10 -10
- package/dist/utils/bytes.d.ts.map +1 -1
- package/dist/utils/bytes.js +10 -10
- package/dist/utils/bytes.js.map +1 -1
- package/dist/utils/date-format.d.ts +1 -1
- package/dist/utils/date-format.d.ts.map +1 -1
- package/dist/utils/date-format.js +2 -2
- package/dist/utils/date-format.js.map +1 -1
- package/dist/utils/error.d.ts +1 -1
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/error.js +2 -2
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/json.d.ts +4 -2
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/json.js +9 -9
- package/dist/utils/json.js.map +1 -1
- package/dist/utils/num.d.ts +10 -10
- package/dist/utils/num.d.ts.map +1 -1
- package/dist/utils/num.js +11 -11
- package/dist/utils/num.js.map +1 -1
- package/dist/utils/obj.d.ts +40 -40
- package/dist/utils/obj.d.ts.map +1 -1
- package/dist/utils/obj.js +102 -99
- package/dist/utils/obj.js.map +1 -1
- package/dist/utils/path.d.ts +3 -3
- package/dist/utils/path.d.ts.map +1 -1
- package/dist/utils/path.js +6 -6
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/primitive.d.ts +1 -1
- package/dist/utils/primitive.d.ts.map +1 -1
- package/dist/utils/primitive.js +2 -2
- package/dist/utils/primitive.js.map +1 -1
- package/dist/utils/str.d.ts +16 -16
- package/dist/utils/str.d.ts.map +1 -1
- package/dist/utils/str.js +16 -16
- package/dist/utils/str.js.map +1 -1
- package/dist/utils/transferable.d.ts +3 -3
- package/dist/utils/transferable.d.ts.map +1 -1
- package/dist/utils/transferable.js +10 -10
- package/dist/utils/transferable.js.map +1 -1
- package/dist/utils/wait.d.ts +2 -2
- package/dist/utils/wait.d.ts.map +1 -1
- package/dist/utils/wait.js +5 -5
- package/dist/utils/wait.js.map +1 -1
- package/dist/utils/xml.d.ts +2 -2
- package/dist/utils/xml.d.ts.map +1 -1
- package/dist/utils/xml.js +4 -4
- package/dist/utils/xml.js.map +1 -1
- package/dist/{zip/sd-zip.d.ts → utils/zip.d.ts} +1 -1
- package/dist/utils/zip.d.ts.map +1 -0
- package/dist/{zip/sd-zip.js → utils/zip.js} +1 -1
- package/dist/{zip/sd-zip.js.map → utils/zip.js.map} +1 -1
- package/package.json +1 -1
- package/src/extensions/arr-ext.helpers.ts +86 -0
- package/src/extensions/arr-ext.ts +22 -170
- package/src/extensions/arr-ext.types.ts +76 -48
- package/src/extensions/map-ext.ts +3 -3
- package/src/extensions/set-ext.ts +2 -2
- package/src/features/event-emitter.ts +6 -6
- package/src/features/serial-queue.ts +2 -2
- package/src/index.ts +16 -16
- package/src/types/date-only.ts +2 -2
- package/src/types/date-time.ts +2 -2
- package/src/types/time.ts +2 -2
- package/src/types/uuid.ts +2 -2
- package/src/utils/bytes.ts +15 -15
- package/src/utils/date-format.ts +1 -1
- package/src/utils/error.ts +1 -1
- package/src/utils/json.ts +9 -7
- package/src/utils/num.ts +15 -15
- package/src/utils/obj.ts +119 -116
- package/src/utils/path.ts +3 -3
- package/src/utils/primitive.ts +1 -1
- package/src/utils/str.ts +16 -16
- package/src/utils/transferable.ts +9 -9
- package/src/utils/wait.ts +3 -3
- package/src/utils/xml.ts +2 -2
- package/tests/extensions/array-extension.spec.ts +7 -5
- package/tests/types/uuid.spec.ts +4 -4
- package/tests/utils/bytes-utils.spec.ts +42 -49
- package/tests/utils/date-format.spec.ts +89 -88
- package/tests/utils/debounce-queue.spec.ts +3 -1
- package/tests/utils/json.spec.ts +61 -68
- package/tests/utils/number.spec.ts +41 -46
- package/tests/utils/object.spec.ts +120 -139
- package/tests/utils/path.spec.ts +19 -19
- package/tests/utils/primitive.spec.ts +12 -12
- package/tests/utils/string.spec.ts +66 -74
- package/tests/utils/transferable.spec.ts +55 -62
- package/tests/utils/wait.spec.ts +10 -10
- package/tests/utils/xml.spec.ts +25 -25
- package/dist/zip/sd-zip.d.ts.map +0 -1
- /package/src/{zip/sd-zip.ts → utils/zip.ts} +0 -0
- /package/tests/{zip/sd-zip.spec.ts → utils/zip.spec.ts} +0 -0
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import {
|
|
2
|
+
import { dt } from "@simplysm/core-common";
|
|
3
|
+
import { normalizeMonth } from "../../src/utils/date-format";
|
|
3
4
|
|
|
4
5
|
describe("formatDateTime", () => {
|
|
5
6
|
//#region Year pattern
|
|
6
7
|
|
|
7
8
|
describe("Year pattern", () => {
|
|
8
9
|
it("outputs 4-digit year with yyyy format", () => {
|
|
9
|
-
expect(
|
|
10
|
+
expect(dt.format("yyyy", { year: 2025 })).toBe("2025");
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
it("outputs 2-digit year with yy format", () => {
|
|
13
|
-
expect(
|
|
14
|
-
expect(
|
|
15
|
-
expect(
|
|
14
|
+
expect(dt.format("yy", { year: 2025 })).toBe("25");
|
|
15
|
+
expect(dt.format("yy", { year: 2000 })).toBe("00");
|
|
16
|
+
expect(dt.format("yy", { year: 1999 })).toBe("99");
|
|
16
17
|
});
|
|
17
18
|
});
|
|
18
19
|
|
|
@@ -22,15 +23,15 @@ describe("formatDateTime", () => {
|
|
|
22
23
|
|
|
23
24
|
describe("Month pattern", () => {
|
|
24
25
|
it("outputs 2-digit month with MM format", () => {
|
|
25
|
-
expect(
|
|
26
|
-
expect(
|
|
27
|
-
expect(
|
|
26
|
+
expect(dt.format("MM", { month: 1 })).toBe("01");
|
|
27
|
+
expect(dt.format("MM", { month: 9 })).toBe("09");
|
|
28
|
+
expect(dt.format("MM", { month: 12 })).toBe("12");
|
|
28
29
|
});
|
|
29
30
|
|
|
30
31
|
it("outputs month without padding with M format", () => {
|
|
31
|
-
expect(
|
|
32
|
-
expect(
|
|
33
|
-
expect(
|
|
32
|
+
expect(dt.format("M", { month: 1 })).toBe("1");
|
|
33
|
+
expect(dt.format("M", { month: 9 })).toBe("9");
|
|
34
|
+
expect(dt.format("M", { month: 12 })).toBe("12");
|
|
34
35
|
});
|
|
35
36
|
});
|
|
36
37
|
|
|
@@ -40,15 +41,15 @@ describe("formatDateTime", () => {
|
|
|
40
41
|
|
|
41
42
|
describe("Day pattern", () => {
|
|
42
43
|
it("outputs 2-digit day with dd format", () => {
|
|
43
|
-
expect(
|
|
44
|
-
expect(
|
|
45
|
-
expect(
|
|
44
|
+
expect(dt.format("dd", { day: 1 })).toBe("01");
|
|
45
|
+
expect(dt.format("dd", { day: 9 })).toBe("09");
|
|
46
|
+
expect(dt.format("dd", { day: 31 })).toBe("31");
|
|
46
47
|
});
|
|
47
48
|
|
|
48
49
|
it("outputs day without padding with d format", () => {
|
|
49
|
-
expect(
|
|
50
|
-
expect(
|
|
51
|
-
expect(
|
|
50
|
+
expect(dt.format("d", { day: 1 })).toBe("1");
|
|
51
|
+
expect(dt.format("d", { day: 9 })).toBe("9");
|
|
52
|
+
expect(dt.format("d", { day: 31 })).toBe("31");
|
|
52
53
|
});
|
|
53
54
|
});
|
|
54
55
|
|
|
@@ -59,11 +60,11 @@ describe("formatDateTime", () => {
|
|
|
59
60
|
describe("Day of week pattern", () => {
|
|
60
61
|
it("outputs day of week in Korean with ddd format", () => {
|
|
61
62
|
// 2025-01-18 is Saturday
|
|
62
|
-
expect(
|
|
63
|
+
expect(dt.format("ddd", { year: 2025, month: 1, day: 18 })).toBe("토");
|
|
63
64
|
// 2025-01-19 is Sunday
|
|
64
|
-
expect(
|
|
65
|
+
expect(dt.format("ddd", { year: 2025, month: 1, day: 19 })).toBe("일");
|
|
65
66
|
// 2025-01-20 is Monday
|
|
66
|
-
expect(
|
|
67
|
+
expect(dt.format("ddd", { year: 2025, month: 1, day: 20 })).toBe("월");
|
|
67
68
|
});
|
|
68
69
|
});
|
|
69
70
|
|
|
@@ -73,39 +74,39 @@ describe("formatDateTime", () => {
|
|
|
73
74
|
|
|
74
75
|
describe("Hour pattern", () => {
|
|
75
76
|
it("outputs 12-hour format with padding using hh format", () => {
|
|
76
|
-
expect(
|
|
77
|
-
expect(
|
|
78
|
-
expect(
|
|
79
|
-
expect(
|
|
77
|
+
expect(dt.format("hh", { hour: 0 })).toBe("12");
|
|
78
|
+
expect(dt.format("hh", { hour: 1 })).toBe("01");
|
|
79
|
+
expect(dt.format("hh", { hour: 12 })).toBe("12");
|
|
80
|
+
expect(dt.format("hh", { hour: 13 })).toBe("01");
|
|
80
81
|
});
|
|
81
82
|
|
|
82
83
|
it("outputs 12-hour format without padding using h format", () => {
|
|
83
|
-
expect(
|
|
84
|
-
expect(
|
|
85
|
-
expect(
|
|
86
|
-
expect(
|
|
87
|
-
expect(
|
|
88
|
-
expect(
|
|
89
|
-
expect(
|
|
84
|
+
expect(dt.format("h", { hour: 0 })).toBe("12");
|
|
85
|
+
expect(dt.format("h", { hour: 1 })).toBe("1");
|
|
86
|
+
expect(dt.format("h", { hour: 9 })).toBe("9");
|
|
87
|
+
expect(dt.format("h", { hour: 10 })).toBe("10");
|
|
88
|
+
expect(dt.format("h", { hour: 12 })).toBe("12");
|
|
89
|
+
expect(dt.format("h", { hour: 13 })).toBe("1");
|
|
90
|
+
expect(dt.format("h", { hour: 23 })).toBe("11");
|
|
90
91
|
});
|
|
91
92
|
|
|
92
93
|
it("outputs 24-hour format with padding using HH format", () => {
|
|
93
|
-
expect(
|
|
94
|
-
expect(
|
|
95
|
-
expect(
|
|
94
|
+
expect(dt.format("HH", { hour: 0 })).toBe("00");
|
|
95
|
+
expect(dt.format("HH", { hour: 9 })).toBe("09");
|
|
96
|
+
expect(dt.format("HH", { hour: 23 })).toBe("23");
|
|
96
97
|
});
|
|
97
98
|
|
|
98
99
|
it("outputs 24-hour format without padding using H format", () => {
|
|
99
|
-
expect(
|
|
100
|
-
expect(
|
|
101
|
-
expect(
|
|
100
|
+
expect(dt.format("H", { hour: 0 })).toBe("0");
|
|
101
|
+
expect(dt.format("H", { hour: 9 })).toBe("9");
|
|
102
|
+
expect(dt.format("H", { hour: 23 })).toBe("23");
|
|
102
103
|
});
|
|
103
104
|
|
|
104
105
|
it("outputs AM/PM with tt format", () => {
|
|
105
|
-
expect(
|
|
106
|
-
expect(
|
|
107
|
-
expect(
|
|
108
|
-
expect(
|
|
106
|
+
expect(dt.format("tt", { hour: 0 })).toBe("AM");
|
|
107
|
+
expect(dt.format("tt", { hour: 11 })).toBe("AM");
|
|
108
|
+
expect(dt.format("tt", { hour: 12 })).toBe("PM");
|
|
109
|
+
expect(dt.format("tt", { hour: 23 })).toBe("PM");
|
|
109
110
|
});
|
|
110
111
|
});
|
|
111
112
|
|
|
@@ -115,15 +116,15 @@ describe("formatDateTime", () => {
|
|
|
115
116
|
|
|
116
117
|
describe("Minute pattern", () => {
|
|
117
118
|
it("outputs 2-digit minute with mm format", () => {
|
|
118
|
-
expect(
|
|
119
|
-
expect(
|
|
120
|
-
expect(
|
|
119
|
+
expect(dt.format("mm", { minute: 0 })).toBe("00");
|
|
120
|
+
expect(dt.format("mm", { minute: 5 })).toBe("05");
|
|
121
|
+
expect(dt.format("mm", { minute: 59 })).toBe("59");
|
|
121
122
|
});
|
|
122
123
|
|
|
123
124
|
it("outputs minute without padding with m format", () => {
|
|
124
|
-
expect(
|
|
125
|
-
expect(
|
|
126
|
-
expect(
|
|
125
|
+
expect(dt.format("m", { minute: 0 })).toBe("0");
|
|
126
|
+
expect(dt.format("m", { minute: 5 })).toBe("5");
|
|
127
|
+
expect(dt.format("m", { minute: 59 })).toBe("59");
|
|
127
128
|
});
|
|
128
129
|
});
|
|
129
130
|
|
|
@@ -133,15 +134,15 @@ describe("formatDateTime", () => {
|
|
|
133
134
|
|
|
134
135
|
describe("Second pattern", () => {
|
|
135
136
|
it("outputs 2-digit second with ss format", () => {
|
|
136
|
-
expect(
|
|
137
|
-
expect(
|
|
138
|
-
expect(
|
|
137
|
+
expect(dt.format("ss", { second: 0 })).toBe("00");
|
|
138
|
+
expect(dt.format("ss", { second: 5 })).toBe("05");
|
|
139
|
+
expect(dt.format("ss", { second: 59 })).toBe("59");
|
|
139
140
|
});
|
|
140
141
|
|
|
141
142
|
it("outputs second without padding with s format", () => {
|
|
142
|
-
expect(
|
|
143
|
-
expect(
|
|
144
|
-
expect(
|
|
143
|
+
expect(dt.format("s", { second: 0 })).toBe("0");
|
|
144
|
+
expect(dt.format("s", { second: 5 })).toBe("5");
|
|
145
|
+
expect(dt.format("s", { second: 59 })).toBe("59");
|
|
145
146
|
});
|
|
146
147
|
});
|
|
147
148
|
|
|
@@ -151,27 +152,27 @@ describe("formatDateTime", () => {
|
|
|
151
152
|
|
|
152
153
|
describe("Millisecond pattern", () => {
|
|
153
154
|
it("outputs 3-digit millisecond with fff format", () => {
|
|
154
|
-
expect(
|
|
155
|
-
expect(
|
|
156
|
-
expect(
|
|
157
|
-
expect(
|
|
158
|
-
expect(
|
|
155
|
+
expect(dt.format("fff", { millisecond: 0 })).toBe("000");
|
|
156
|
+
expect(dt.format("fff", { millisecond: 5 })).toBe("005");
|
|
157
|
+
expect(dt.format("fff", { millisecond: 50 })).toBe("050");
|
|
158
|
+
expect(dt.format("fff", { millisecond: 500 })).toBe("500");
|
|
159
|
+
expect(dt.format("fff", { millisecond: 999 })).toBe("999");
|
|
159
160
|
});
|
|
160
161
|
|
|
161
162
|
it("outputs 2-digit millisecond with ff format", () => {
|
|
162
|
-
expect(
|
|
163
|
-
expect(
|
|
164
|
-
expect(
|
|
165
|
-
expect(
|
|
166
|
-
expect(
|
|
163
|
+
expect(dt.format("ff", { millisecond: 0 })).toBe("00");
|
|
164
|
+
expect(dt.format("ff", { millisecond: 5 })).toBe("00");
|
|
165
|
+
expect(dt.format("ff", { millisecond: 50 })).toBe("05");
|
|
166
|
+
expect(dt.format("ff", { millisecond: 500 })).toBe("50");
|
|
167
|
+
expect(dt.format("ff", { millisecond: 999 })).toBe("99");
|
|
167
168
|
});
|
|
168
169
|
|
|
169
170
|
it("outputs 1-digit millisecond with f format", () => {
|
|
170
|
-
expect(
|
|
171
|
-
expect(
|
|
172
|
-
expect(
|
|
173
|
-
expect(
|
|
174
|
-
expect(
|
|
171
|
+
expect(dt.format("f", { millisecond: 0 })).toBe("0");
|
|
172
|
+
expect(dt.format("f", { millisecond: 5 })).toBe("0");
|
|
173
|
+
expect(dt.format("f", { millisecond: 100 })).toBe("1");
|
|
174
|
+
expect(dt.format("f", { millisecond: 500 })).toBe("5");
|
|
175
|
+
expect(dt.format("f", { millisecond: 999 })).toBe("9");
|
|
175
176
|
});
|
|
176
177
|
});
|
|
177
178
|
|
|
@@ -183,50 +184,50 @@ describe("formatDateTime", () => {
|
|
|
183
184
|
describe("Positive offset (East)", () => {
|
|
184
185
|
it("outputs +HH:mm format with zzz format", () => {
|
|
185
186
|
// UTC+9 (540 minutes)
|
|
186
|
-
expect(
|
|
187
|
+
expect(dt.format("zzz", { timezoneOffsetMinutes: 540 })).toBe("+09:00");
|
|
187
188
|
// UTC+5:30 (330 minutes)
|
|
188
|
-
expect(
|
|
189
|
+
expect(dt.format("zzz", { timezoneOffsetMinutes: 330 })).toBe("+05:30");
|
|
189
190
|
});
|
|
190
191
|
|
|
191
192
|
it("outputs +HH format with zz format", () => {
|
|
192
|
-
expect(
|
|
193
|
-
expect(
|
|
193
|
+
expect(dt.format("zz", { timezoneOffsetMinutes: 540 })).toBe("+09");
|
|
194
|
+
expect(dt.format("zz", { timezoneOffsetMinutes: 60 })).toBe("+01");
|
|
194
195
|
});
|
|
195
196
|
|
|
196
197
|
it("outputs +H format without padding with z format", () => {
|
|
197
|
-
expect(
|
|
198
|
-
expect(
|
|
199
|
-
expect(
|
|
198
|
+
expect(dt.format("z", { timezoneOffsetMinutes: 540 })).toBe("+9");
|
|
199
|
+
expect(dt.format("z", { timezoneOffsetMinutes: 60 })).toBe("+1");
|
|
200
|
+
expect(dt.format("z", { timezoneOffsetMinutes: 600 })).toBe("+10");
|
|
200
201
|
});
|
|
201
202
|
});
|
|
202
203
|
|
|
203
204
|
describe("Negative offset (West)", () => {
|
|
204
205
|
it("outputs -HH:mm format with zzz format", () => {
|
|
205
206
|
// UTC-5 (-300 minutes) - Integer hour offset
|
|
206
|
-
expect(
|
|
207
|
+
expect(dt.format("zzz", { timezoneOffsetMinutes: -300 })).toBe("-05:00");
|
|
207
208
|
// UTC-8 (-480 minutes) - Integer hour offset
|
|
208
|
-
expect(
|
|
209
|
+
expect(dt.format("zzz", { timezoneOffsetMinutes: -480 })).toBe("-08:00");
|
|
209
210
|
// UTC-3:30 (-210 minutes) - Newfoundland Standard Time
|
|
210
|
-
expect(
|
|
211
|
+
expect(dt.format("zzz", { timezoneOffsetMinutes: -210 })).toBe("-03:30");
|
|
211
212
|
// UTC-9:30 (-570 minutes) - Marquesas Islands
|
|
212
|
-
expect(
|
|
213
|
+
expect(dt.format("zzz", { timezoneOffsetMinutes: -570 })).toBe("-09:30");
|
|
213
214
|
});
|
|
214
215
|
|
|
215
216
|
it("outputs -HH format with zz format", () => {
|
|
216
|
-
expect(
|
|
217
|
-
expect(
|
|
217
|
+
expect(dt.format("zz", { timezoneOffsetMinutes: -300 })).toBe("-05");
|
|
218
|
+
expect(dt.format("zz", { timezoneOffsetMinutes: -60 })).toBe("-01");
|
|
218
219
|
});
|
|
219
220
|
|
|
220
221
|
it("outputs -H format without padding with z format", () => {
|
|
221
|
-
expect(
|
|
222
|
-
expect(
|
|
223
|
-
expect(
|
|
222
|
+
expect(dt.format("z", { timezoneOffsetMinutes: -300 })).toBe("-5");
|
|
223
|
+
expect(dt.format("z", { timezoneOffsetMinutes: -60 })).toBe("-1");
|
|
224
|
+
expect(dt.format("z", { timezoneOffsetMinutes: -720 })).toBe("-12");
|
|
224
225
|
});
|
|
225
226
|
});
|
|
226
227
|
|
|
227
228
|
describe("UTC (0 offset)", () => {
|
|
228
229
|
it("outputs +00:00 with zzz format", () => {
|
|
229
|
-
expect(
|
|
230
|
+
expect(dt.format("zzz", { timezoneOffsetMinutes: 0 })).toBe("+00:00");
|
|
230
231
|
});
|
|
231
232
|
});
|
|
232
233
|
});
|
|
@@ -239,7 +240,7 @@ describe("formatDateTime", () => {
|
|
|
239
240
|
|
|
240
241
|
describe("Complex format", () => {
|
|
241
242
|
it("handles full date/time format", () => {
|
|
242
|
-
const result =
|
|
243
|
+
const result = dt.format("yyyy-MM-dd HH:mm:ss.fff", {
|
|
243
244
|
year: 2025,
|
|
244
245
|
month: 1,
|
|
245
246
|
day: 18,
|
|
@@ -252,7 +253,7 @@ describe("formatDateTime", () => {
|
|
|
252
253
|
});
|
|
253
254
|
|
|
254
255
|
it("handles 12-hour format", () => {
|
|
255
|
-
const result =
|
|
256
|
+
const result = dt.format("yyyy-MM-dd tt h:mm:ss", {
|
|
256
257
|
year: 2025,
|
|
257
258
|
month: 1,
|
|
258
259
|
day: 18,
|
|
@@ -264,7 +265,7 @@ describe("formatDateTime", () => {
|
|
|
264
265
|
});
|
|
265
266
|
|
|
266
267
|
it("handles format with timezone", () => {
|
|
267
|
-
const result =
|
|
268
|
+
const result = dt.format("yyyy-MM-ddTHH:mm:sszzz", {
|
|
268
269
|
year: 2025,
|
|
269
270
|
month: 1,
|
|
270
271
|
day: 18,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { DebounceQueue,
|
|
2
|
+
import { DebounceQueue, wait, SdError } from "@simplysm/core-common";
|
|
3
|
+
|
|
4
|
+
const time = wait.time;
|
|
3
5
|
|
|
4
6
|
describe("DebounceQueue", () => {
|
|
5
7
|
//#region Debounce behavior
|