@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.
Files changed (126) hide show
  1. package/README.md +64 -21
  2. package/dist/extensions/arr-ext.d.ts +1 -1
  3. package/dist/extensions/arr-ext.d.ts.map +1 -1
  4. package/dist/extensions/arr-ext.helpers.d.ts +8 -0
  5. package/dist/extensions/arr-ext.helpers.d.ts.map +1 -1
  6. package/dist/extensions/arr-ext.helpers.js +65 -0
  7. package/dist/extensions/arr-ext.helpers.js.map +2 -2
  8. package/dist/extensions/arr-ext.js +16 -124
  9. package/dist/extensions/arr-ext.js.map +2 -2
  10. package/dist/extensions/arr-ext.types.d.ts +40 -32
  11. package/dist/extensions/arr-ext.types.d.ts.map +1 -1
  12. package/dist/extensions/map-ext.js.map +1 -1
  13. package/dist/extensions/set-ext.js.map +1 -1
  14. package/dist/features/event-emitter.d.ts +4 -4
  15. package/dist/features/event-emitter.d.ts.map +1 -1
  16. package/dist/features/event-emitter.js.map +1 -1
  17. package/dist/features/serial-queue.js +2 -2
  18. package/dist/features/serial-queue.js.map +1 -1
  19. package/dist/index.d.ts +13 -13
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +27 -13
  22. package/dist/index.js.map +1 -1
  23. package/dist/types/date-only.js +2 -2
  24. package/dist/types/date-only.js.map +1 -1
  25. package/dist/types/date-time.js +2 -2
  26. package/dist/types/date-time.js.map +1 -1
  27. package/dist/types/time.js +2 -2
  28. package/dist/types/time.js.map +1 -1
  29. package/dist/types/uuid.d.ts +2 -2
  30. package/dist/types/uuid.d.ts.map +1 -1
  31. package/dist/types/uuid.js +1 -1
  32. package/dist/types/uuid.js.map +1 -1
  33. package/dist/utils/bytes.d.ts +10 -10
  34. package/dist/utils/bytes.d.ts.map +1 -1
  35. package/dist/utils/bytes.js +10 -10
  36. package/dist/utils/bytes.js.map +1 -1
  37. package/dist/utils/date-format.d.ts +1 -1
  38. package/dist/utils/date-format.d.ts.map +1 -1
  39. package/dist/utils/date-format.js +2 -2
  40. package/dist/utils/date-format.js.map +1 -1
  41. package/dist/utils/error.d.ts +1 -1
  42. package/dist/utils/error.d.ts.map +1 -1
  43. package/dist/utils/error.js +2 -2
  44. package/dist/utils/error.js.map +1 -1
  45. package/dist/utils/json.d.ts +4 -2
  46. package/dist/utils/json.d.ts.map +1 -1
  47. package/dist/utils/json.js +9 -9
  48. package/dist/utils/json.js.map +1 -1
  49. package/dist/utils/num.d.ts +10 -10
  50. package/dist/utils/num.d.ts.map +1 -1
  51. package/dist/utils/num.js +11 -11
  52. package/dist/utils/num.js.map +1 -1
  53. package/dist/utils/obj.d.ts +40 -40
  54. package/dist/utils/obj.d.ts.map +1 -1
  55. package/dist/utils/obj.js +102 -99
  56. package/dist/utils/obj.js.map +1 -1
  57. package/dist/utils/path.d.ts +3 -3
  58. package/dist/utils/path.d.ts.map +1 -1
  59. package/dist/utils/path.js +6 -6
  60. package/dist/utils/path.js.map +1 -1
  61. package/dist/utils/primitive.d.ts +1 -1
  62. package/dist/utils/primitive.d.ts.map +1 -1
  63. package/dist/utils/primitive.js +2 -2
  64. package/dist/utils/primitive.js.map +1 -1
  65. package/dist/utils/str.d.ts +16 -16
  66. package/dist/utils/str.d.ts.map +1 -1
  67. package/dist/utils/str.js +16 -16
  68. package/dist/utils/str.js.map +1 -1
  69. package/dist/utils/transferable.d.ts +3 -3
  70. package/dist/utils/transferable.d.ts.map +1 -1
  71. package/dist/utils/transferable.js +10 -10
  72. package/dist/utils/transferable.js.map +1 -1
  73. package/dist/utils/wait.d.ts +2 -2
  74. package/dist/utils/wait.d.ts.map +1 -1
  75. package/dist/utils/wait.js +5 -5
  76. package/dist/utils/wait.js.map +1 -1
  77. package/dist/utils/xml.d.ts +2 -2
  78. package/dist/utils/xml.d.ts.map +1 -1
  79. package/dist/utils/xml.js +4 -4
  80. package/dist/utils/xml.js.map +1 -1
  81. package/dist/{zip/sd-zip.d.ts → utils/zip.d.ts} +1 -1
  82. package/dist/utils/zip.d.ts.map +1 -0
  83. package/dist/{zip/sd-zip.js → utils/zip.js} +1 -1
  84. package/dist/{zip/sd-zip.js.map → utils/zip.js.map} +1 -1
  85. package/package.json +1 -1
  86. package/src/extensions/arr-ext.helpers.ts +86 -0
  87. package/src/extensions/arr-ext.ts +22 -170
  88. package/src/extensions/arr-ext.types.ts +76 -48
  89. package/src/extensions/map-ext.ts +3 -3
  90. package/src/extensions/set-ext.ts +2 -2
  91. package/src/features/event-emitter.ts +6 -6
  92. package/src/features/serial-queue.ts +2 -2
  93. package/src/index.ts +16 -16
  94. package/src/types/date-only.ts +2 -2
  95. package/src/types/date-time.ts +2 -2
  96. package/src/types/time.ts +2 -2
  97. package/src/types/uuid.ts +2 -2
  98. package/src/utils/bytes.ts +15 -15
  99. package/src/utils/date-format.ts +1 -1
  100. package/src/utils/error.ts +1 -1
  101. package/src/utils/json.ts +9 -7
  102. package/src/utils/num.ts +15 -15
  103. package/src/utils/obj.ts +119 -116
  104. package/src/utils/path.ts +3 -3
  105. package/src/utils/primitive.ts +1 -1
  106. package/src/utils/str.ts +16 -16
  107. package/src/utils/transferable.ts +9 -9
  108. package/src/utils/wait.ts +3 -3
  109. package/src/utils/xml.ts +2 -2
  110. package/tests/extensions/array-extension.spec.ts +7 -5
  111. package/tests/types/uuid.spec.ts +4 -4
  112. package/tests/utils/bytes-utils.spec.ts +42 -49
  113. package/tests/utils/date-format.spec.ts +89 -88
  114. package/tests/utils/debounce-queue.spec.ts +3 -1
  115. package/tests/utils/json.spec.ts +61 -68
  116. package/tests/utils/number.spec.ts +41 -46
  117. package/tests/utils/object.spec.ts +120 -139
  118. package/tests/utils/path.spec.ts +19 -19
  119. package/tests/utils/primitive.spec.ts +12 -12
  120. package/tests/utils/string.spec.ts +66 -74
  121. package/tests/utils/transferable.spec.ts +55 -62
  122. package/tests/utils/wait.spec.ts +10 -10
  123. package/tests/utils/xml.spec.ts +25 -25
  124. package/dist/zip/sd-zip.d.ts.map +0 -1
  125. /package/src/{zip/sd-zip.ts → utils/zip.ts} +0 -0
  126. /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 { formatDate, normalizeMonth } from "@simplysm/core-common";
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(formatDate("yyyy", { year: 2025 })).toBe("2025");
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(formatDate("yy", { year: 2025 })).toBe("25");
14
- expect(formatDate("yy", { year: 2000 })).toBe("00");
15
- expect(formatDate("yy", { year: 1999 })).toBe("99");
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(formatDate("MM", { month: 1 })).toBe("01");
26
- expect(formatDate("MM", { month: 9 })).toBe("09");
27
- expect(formatDate("MM", { month: 12 })).toBe("12");
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(formatDate("M", { month: 1 })).toBe("1");
32
- expect(formatDate("M", { month: 9 })).toBe("9");
33
- expect(formatDate("M", { month: 12 })).toBe("12");
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(formatDate("dd", { day: 1 })).toBe("01");
44
- expect(formatDate("dd", { day: 9 })).toBe("09");
45
- expect(formatDate("dd", { day: 31 })).toBe("31");
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(formatDate("d", { day: 1 })).toBe("1");
50
- expect(formatDate("d", { day: 9 })).toBe("9");
51
- expect(formatDate("d", { day: 31 })).toBe("31");
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(formatDate("ddd", { year: 2025, month: 1, day: 18 })).toBe("토");
63
+ expect(dt.format("ddd", { year: 2025, month: 1, day: 18 })).toBe("토");
63
64
  // 2025-01-19 is Sunday
64
- expect(formatDate("ddd", { year: 2025, month: 1, day: 19 })).toBe("일");
65
+ expect(dt.format("ddd", { year: 2025, month: 1, day: 19 })).toBe("일");
65
66
  // 2025-01-20 is Monday
66
- expect(formatDate("ddd", { year: 2025, month: 1, day: 20 })).toBe("월");
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(formatDate("hh", { hour: 0 })).toBe("12");
77
- expect(formatDate("hh", { hour: 1 })).toBe("01");
78
- expect(formatDate("hh", { hour: 12 })).toBe("12");
79
- expect(formatDate("hh", { hour: 13 })).toBe("01");
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(formatDate("h", { hour: 0 })).toBe("12");
84
- expect(formatDate("h", { hour: 1 })).toBe("1");
85
- expect(formatDate("h", { hour: 9 })).toBe("9");
86
- expect(formatDate("h", { hour: 10 })).toBe("10");
87
- expect(formatDate("h", { hour: 12 })).toBe("12");
88
- expect(formatDate("h", { hour: 13 })).toBe("1");
89
- expect(formatDate("h", { hour: 23 })).toBe("11");
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(formatDate("HH", { hour: 0 })).toBe("00");
94
- expect(formatDate("HH", { hour: 9 })).toBe("09");
95
- expect(formatDate("HH", { hour: 23 })).toBe("23");
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(formatDate("H", { hour: 0 })).toBe("0");
100
- expect(formatDate("H", { hour: 9 })).toBe("9");
101
- expect(formatDate("H", { hour: 23 })).toBe("23");
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(formatDate("tt", { hour: 0 })).toBe("AM");
106
- expect(formatDate("tt", { hour: 11 })).toBe("AM");
107
- expect(formatDate("tt", { hour: 12 })).toBe("PM");
108
- expect(formatDate("tt", { hour: 23 })).toBe("PM");
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(formatDate("mm", { minute: 0 })).toBe("00");
119
- expect(formatDate("mm", { minute: 5 })).toBe("05");
120
- expect(formatDate("mm", { minute: 59 })).toBe("59");
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(formatDate("m", { minute: 0 })).toBe("0");
125
- expect(formatDate("m", { minute: 5 })).toBe("5");
126
- expect(formatDate("m", { minute: 59 })).toBe("59");
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(formatDate("ss", { second: 0 })).toBe("00");
137
- expect(formatDate("ss", { second: 5 })).toBe("05");
138
- expect(formatDate("ss", { second: 59 })).toBe("59");
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(formatDate("s", { second: 0 })).toBe("0");
143
- expect(formatDate("s", { second: 5 })).toBe("5");
144
- expect(formatDate("s", { second: 59 })).toBe("59");
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(formatDate("fff", { millisecond: 0 })).toBe("000");
155
- expect(formatDate("fff", { millisecond: 5 })).toBe("005");
156
- expect(formatDate("fff", { millisecond: 50 })).toBe("050");
157
- expect(formatDate("fff", { millisecond: 500 })).toBe("500");
158
- expect(formatDate("fff", { millisecond: 999 })).toBe("999");
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(formatDate("ff", { millisecond: 0 })).toBe("00");
163
- expect(formatDate("ff", { millisecond: 5 })).toBe("00");
164
- expect(formatDate("ff", { millisecond: 50 })).toBe("05");
165
- expect(formatDate("ff", { millisecond: 500 })).toBe("50");
166
- expect(formatDate("ff", { millisecond: 999 })).toBe("99");
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(formatDate("f", { millisecond: 0 })).toBe("0");
171
- expect(formatDate("f", { millisecond: 5 })).toBe("0");
172
- expect(formatDate("f", { millisecond: 100 })).toBe("1");
173
- expect(formatDate("f", { millisecond: 500 })).toBe("5");
174
- expect(formatDate("f", { millisecond: 999 })).toBe("9");
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(formatDate("zzz", { timezoneOffsetMinutes: 540 })).toBe("+09:00");
187
+ expect(dt.format("zzz", { timezoneOffsetMinutes: 540 })).toBe("+09:00");
187
188
  // UTC+5:30 (330 minutes)
188
- expect(formatDate("zzz", { timezoneOffsetMinutes: 330 })).toBe("+05:30");
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(formatDate("zz", { timezoneOffsetMinutes: 540 })).toBe("+09");
193
- expect(formatDate("zz", { timezoneOffsetMinutes: 60 })).toBe("+01");
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(formatDate("z", { timezoneOffsetMinutes: 540 })).toBe("+9");
198
- expect(formatDate("z", { timezoneOffsetMinutes: 60 })).toBe("+1");
199
- expect(formatDate("z", { timezoneOffsetMinutes: 600 })).toBe("+10");
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(formatDate("zzz", { timezoneOffsetMinutes: -300 })).toBe("-05:00");
207
+ expect(dt.format("zzz", { timezoneOffsetMinutes: -300 })).toBe("-05:00");
207
208
  // UTC-8 (-480 minutes) - Integer hour offset
208
- expect(formatDate("zzz", { timezoneOffsetMinutes: -480 })).toBe("-08:00");
209
+ expect(dt.format("zzz", { timezoneOffsetMinutes: -480 })).toBe("-08:00");
209
210
  // UTC-3:30 (-210 minutes) - Newfoundland Standard Time
210
- expect(formatDate("zzz", { timezoneOffsetMinutes: -210 })).toBe("-03:30");
211
+ expect(dt.format("zzz", { timezoneOffsetMinutes: -210 })).toBe("-03:30");
211
212
  // UTC-9:30 (-570 minutes) - Marquesas Islands
212
- expect(formatDate("zzz", { timezoneOffsetMinutes: -570 })).toBe("-09:30");
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(formatDate("zz", { timezoneOffsetMinutes: -300 })).toBe("-05");
217
- expect(formatDate("zz", { timezoneOffsetMinutes: -60 })).toBe("-01");
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(formatDate("z", { timezoneOffsetMinutes: -300 })).toBe("-5");
222
- expect(formatDate("z", { timezoneOffsetMinutes: -60 })).toBe("-1");
223
- expect(formatDate("z", { timezoneOffsetMinutes: -720 })).toBe("-12");
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(formatDate("zzz", { timezoneOffsetMinutes: 0 })).toBe("+00:00");
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 = formatDate("yyyy-MM-dd HH:mm:ss.fff", {
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 = formatDate("yyyy-MM-dd tt h:mm:ss", {
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 = formatDate("yyyy-MM-ddTHH:mm:sszzz", {
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, waitTime as time, SdError } from "@simplysm/core-common";
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