@simplysm/core-common 13.0.100 → 14.0.1

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 (181) hide show
  1. package/dist/common.types.d.ts +14 -14
  2. package/dist/common.types.js +2 -1
  3. package/dist/common.types.js.map +1 -6
  4. package/dist/env.d.ts +5 -0
  5. package/dist/env.d.ts.map +1 -1
  6. package/dist/env.js +12 -8
  7. package/dist/env.js.map +1 -6
  8. package/dist/errors/argument-error.d.ts +10 -10
  9. package/dist/errors/argument-error.d.ts.map +1 -1
  10. package/dist/errors/argument-error.js +31 -14
  11. package/dist/errors/argument-error.js.map +1 -6
  12. package/dist/errors/not-implemented-error.d.ts +8 -8
  13. package/dist/errors/not-implemented-error.js +30 -12
  14. package/dist/errors/not-implemented-error.js.map +1 -6
  15. package/dist/errors/sd-error.d.ts +10 -10
  16. package/dist/errors/sd-error.d.ts.map +1 -1
  17. package/dist/errors/sd-error.js +45 -24
  18. package/dist/errors/sd-error.js.map +1 -6
  19. package/dist/errors/timeout-error.d.ts +10 -10
  20. package/dist/errors/timeout-error.js +34 -15
  21. package/dist/errors/timeout-error.js.map +1 -6
  22. package/dist/extensions/arr-ext.d.ts +2 -2
  23. package/dist/extensions/arr-ext.helpers.d.ts +10 -10
  24. package/dist/extensions/arr-ext.helpers.js +112 -89
  25. package/dist/extensions/arr-ext.helpers.js.map +1 -6
  26. package/dist/extensions/arr-ext.js +458 -422
  27. package/dist/extensions/arr-ext.js.map +1 -6
  28. package/dist/extensions/arr-ext.types.d.ts +57 -57
  29. package/dist/extensions/arr-ext.types.d.ts.map +1 -1
  30. package/dist/extensions/arr-ext.types.js +6 -1
  31. package/dist/extensions/arr-ext.types.js.map +1 -6
  32. package/dist/extensions/map-ext.d.ts +16 -16
  33. package/dist/extensions/map-ext.js +27 -22
  34. package/dist/extensions/map-ext.js.map +1 -6
  35. package/dist/extensions/set-ext.d.ts +11 -11
  36. package/dist/extensions/set-ext.js +32 -25
  37. package/dist/extensions/set-ext.js.map +1 -6
  38. package/dist/features/debounce-queue.d.ts +17 -17
  39. package/dist/features/debounce-queue.js +98 -70
  40. package/dist/features/debounce-queue.js.map +1 -6
  41. package/dist/features/event-emitter.d.ts +20 -20
  42. package/dist/features/event-emitter.js +101 -78
  43. package/dist/features/event-emitter.js.map +1 -6
  44. package/dist/features/serial-queue.d.ts +11 -11
  45. package/dist/features/serial-queue.js +78 -57
  46. package/dist/features/serial-queue.js.map +1 -6
  47. package/dist/globals.d.ts +4 -4
  48. package/dist/globals.js +9 -1
  49. package/dist/globals.js.map +1 -6
  50. package/dist/index.js +28 -27
  51. package/dist/index.js.map +1 -6
  52. package/dist/types/date-only.d.ts +64 -64
  53. package/dist/types/date-only.d.ts.map +1 -1
  54. package/dist/types/date-only.js +263 -252
  55. package/dist/types/date-only.js.map +1 -6
  56. package/dist/types/date-time.d.ts +36 -36
  57. package/dist/types/date-time.d.ts.map +1 -1
  58. package/dist/types/date-time.js +196 -288
  59. package/dist/types/date-time.js.map +1 -6
  60. package/dist/types/lazy-gc-map.d.ts +26 -26
  61. package/dist/types/lazy-gc-map.d.ts.map +1 -1
  62. package/dist/types/lazy-gc-map.js +202 -159
  63. package/dist/types/lazy-gc-map.js.map +1 -6
  64. package/dist/types/time.d.ts +23 -23
  65. package/dist/types/time.d.ts.map +1 -1
  66. package/dist/types/time.js +169 -158
  67. package/dist/types/time.js.map +1 -6
  68. package/dist/types/uuid.d.ts +11 -11
  69. package/dist/types/uuid.d.ts.map +1 -1
  70. package/dist/types/uuid.js +95 -70
  71. package/dist/types/uuid.js.map +1 -6
  72. package/dist/utils/bytes.d.ts +17 -17
  73. package/dist/utils/bytes.js +137 -81
  74. package/dist/utils/bytes.js.map +1 -6
  75. package/dist/utils/date-format.d.ts +40 -40
  76. package/dist/utils/date-format.js +187 -101
  77. package/dist/utils/date-format.js.map +1 -6
  78. package/dist/utils/error.d.ts +4 -4
  79. package/dist/utils/error.js +11 -6
  80. package/dist/utils/error.js.map +1 -6
  81. package/dist/utils/json.d.ts +19 -19
  82. package/dist/utils/json.js +187 -135
  83. package/dist/utils/json.js.map +1 -6
  84. package/dist/utils/num.d.ts +20 -20
  85. package/dist/utils/num.js +76 -34
  86. package/dist/utils/num.js.map +1 -6
  87. package/dist/utils/obj.d.ts +111 -111
  88. package/dist/utils/obj.d.ts.map +1 -1
  89. package/dist/utils/obj.js +706 -496
  90. package/dist/utils/obj.js.map +1 -6
  91. package/dist/utils/path.d.ts +10 -10
  92. package/dist/utils/path.js +35 -18
  93. package/dist/utils/path.js.map +1 -6
  94. package/dist/utils/primitive.d.ts +5 -5
  95. package/dist/utils/primitive.js +34 -14
  96. package/dist/utils/primitive.js.map +1 -6
  97. package/dist/utils/str.d.ts +38 -38
  98. package/dist/utils/str.js +217 -113
  99. package/dist/utils/str.js.map +1 -6
  100. package/dist/utils/template-strings.d.ts +26 -26
  101. package/dist/utils/template-strings.js +113 -40
  102. package/dist/utils/template-strings.js.map +1 -6
  103. package/dist/utils/transferable.d.ts +18 -18
  104. package/dist/utils/transferable.js +218 -151
  105. package/dist/utils/transferable.js.map +1 -6
  106. package/dist/utils/wait.d.ts +9 -9
  107. package/dist/utils/wait.js +30 -15
  108. package/dist/utils/wait.js.map +1 -6
  109. package/dist/utils/xml.d.ts +13 -13
  110. package/dist/utils/xml.js +84 -46
  111. package/dist/utils/xml.js.map +1 -6
  112. package/dist/utils/zip.d.ts +22 -22
  113. package/dist/utils/zip.js +172 -148
  114. package/dist/utils/zip.js.map +1 -6
  115. package/package.json +5 -7
  116. package/src/common.types.ts +14 -14
  117. package/src/env.ts +9 -1
  118. package/src/errors/argument-error.ts +15 -15
  119. package/src/errors/not-implemented-error.ts +9 -9
  120. package/src/errors/sd-error.ts +12 -12
  121. package/src/errors/timeout-error.ts +12 -12
  122. package/src/extensions/arr-ext.helpers.ts +16 -16
  123. package/src/extensions/arr-ext.ts +35 -35
  124. package/src/extensions/arr-ext.types.ts +57 -57
  125. package/src/extensions/map-ext.ts +16 -16
  126. package/src/extensions/set-ext.ts +11 -11
  127. package/src/features/debounce-queue.ts +23 -23
  128. package/src/features/event-emitter.ts +25 -25
  129. package/src/features/serial-queue.ts +13 -13
  130. package/src/globals.ts +4 -4
  131. package/src/index.ts +5 -5
  132. package/src/types/date-only.ts +84 -83
  133. package/src/types/date-time.ts +43 -42
  134. package/src/types/lazy-gc-map.ts +44 -44
  135. package/src/types/time.ts +29 -29
  136. package/src/types/uuid.ts +15 -15
  137. package/src/utils/bytes.ts +35 -35
  138. package/src/utils/date-format.ts +59 -59
  139. package/src/utils/error.ts +4 -4
  140. package/src/utils/json.ts +41 -41
  141. package/src/utils/num.ts +20 -20
  142. package/src/utils/obj.ts +138 -138
  143. package/src/utils/path.ts +10 -10
  144. package/src/utils/primitive.ts +6 -6
  145. package/src/utils/str.ts +48 -48
  146. package/src/utils/template-strings.ts +29 -29
  147. package/src/utils/transferable.ts +38 -38
  148. package/src/utils/wait.ts +10 -10
  149. package/src/utils/xml.ts +19 -19
  150. package/src/utils/zip.ts +25 -25
  151. package/README.md +0 -160
  152. package/docs/errors.md +0 -119
  153. package/docs/extensions.md +0 -387
  154. package/docs/features.md +0 -143
  155. package/docs/types.md +0 -287
  156. package/docs/utils.md +0 -757
  157. package/tests/errors/errors.spec.ts +0 -80
  158. package/tests/extensions/array-extension.spec.ts +0 -654
  159. package/tests/extensions/map-extension.spec.ts +0 -117
  160. package/tests/extensions/set-extension.spec.ts +0 -67
  161. package/tests/types/date-only.spec.ts +0 -533
  162. package/tests/types/date-time.spec.ts +0 -246
  163. package/tests/types/lazy-gc-map.spec.ts +0 -606
  164. package/tests/types/time.spec.ts +0 -428
  165. package/tests/types/uuid.spec.ts +0 -74
  166. package/tests/utils/bytes-utils.spec.ts +0 -197
  167. package/tests/utils/date-format.spec.ts +0 -350
  168. package/tests/utils/debounce-queue.spec.ts +0 -226
  169. package/tests/utils/json.spec.ts +0 -400
  170. package/tests/utils/number.spec.ts +0 -136
  171. package/tests/utils/object.spec.ts +0 -810
  172. package/tests/utils/path.spec.ts +0 -70
  173. package/tests/utils/primitive.spec.ts +0 -43
  174. package/tests/utils/sd-event-emitter.spec.ts +0 -189
  175. package/tests/utils/serial-queue.spec.ts +0 -305
  176. package/tests/utils/string.spec.ts +0 -265
  177. package/tests/utils/template-strings.spec.ts +0 -48
  178. package/tests/utils/transferable.spec.ts +0 -639
  179. package/tests/utils/wait.spec.ts +0 -123
  180. package/tests/utils/xml.spec.ts +0 -146
  181. package/tests/utils/zip.spec.ts +0 -221
@@ -1,8 +1,8 @@
1
1
  import type { Bytes } from "../common.types";
2
2
  /**
3
- * Concatenate multiple Uint8Arrays
4
- * @param arrays Uint8Array array to concatenate
5
- * @returns New concatenated Uint8Array
3
+ * 여러 Uint8Array 결합
4
+ * @param arrays 결합할 Uint8Array 배열
5
+ * @returns 결합된 Uint8Array
6
6
  * @example
7
7
  * const a = new Uint8Array([1, 2]);
8
8
  * const b = new Uint8Array([3, 4]);
@@ -11,38 +11,38 @@ import type { Bytes } from "../common.types";
11
11
  */
12
12
  export declare function concat(arrays: Bytes[]): Bytes;
13
13
  /**
14
- * Convert to hex string
15
- * @param bytes Uint8Array to convert
16
- * @returns Lowercase hex string
14
+ * hex 문자열로 변환
15
+ * @param bytes 변환할 Uint8Array
16
+ * @returns 소문자 hex 문자열
17
17
  * @example
18
18
  * toHex(new Uint8Array([255, 0, 127]));
19
19
  * // "ff007f"
20
20
  */
21
21
  export declare function toHex(bytes: Bytes): string;
22
22
  /**
23
- * Convert from hex string to Uint8Array
24
- * @param hex Hex string to convert (lowercase and uppercase allowed)
25
- * @returns Converted Uint8Array
26
- * @throws {ArgumentError} If odd length or invalid hex characters are present
23
+ * hex 문자열을 Uint8Array로 변환
24
+ * @param hex 변환할 hex 문자열 (대소문자 허용)
25
+ * @returns 변환된 Uint8Array
26
+ * @throws {ArgumentError} 홀수 길이이거나 유효하지 않은 hex 문자가 포함된 경우
27
27
  * @example
28
28
  * fromHex("ff007f");
29
29
  * // Uint8Array([255, 0, 127])
30
30
  */
31
31
  export declare function fromHex(hex: string): Bytes;
32
32
  /**
33
- * Convert Bytes to base64 string
34
- * @param bytes Uint8Array to convert
35
- * @returns Base64 encoded string
33
+ * Bytes base64 문자열로 변환
34
+ * @param bytes 변환할 Uint8Array
35
+ * @returns Base64 인코딩된 문자열
36
36
  * @example
37
37
  * toBase64(new Uint8Array([72, 101, 108, 108, 111]));
38
38
  * // "SGVsbG8="
39
39
  */
40
40
  export declare function toBase64(bytes: Bytes): string;
41
41
  /**
42
- * Convert base64 string to Bytes
43
- * @param base64 Base64 string to convert
44
- * @returns Decoded Uint8Array
45
- * @throws {ArgumentError} If invalid base64 character is present
42
+ * base64 문자열을 Bytes로 변환
43
+ * @param base64 변환할 base64 문자열
44
+ * @returns 디코딩된 Uint8Array
45
+ * @throws {ArgumentError} 유효하지 않은 base64 문자가 포함된 경우
46
46
  * @example
47
47
  * fromBase64("SGVsbG8=");
48
48
  * // Uint8Array([72, 101, 108, 108, 111])
@@ -1,91 +1,147 @@
1
1
  import { ArgumentError } from "../errors/argument-error.js";
2
+ /**
3
+ * Uint8Array 유틸리티 함수 (복잡한 연산만)
4
+ *
5
+ * 기능:
6
+ * - concat: 여러 Uint8Array 결합
7
+ * - toHex: Uint8Array를 hex 문자열로 변환
8
+ * - fromHex: hex 문자열을 Uint8Array로 변환
9
+ * - toBase64: Uint8Array를 base64 문자열로 변환
10
+ * - fromBase64: base64 문자열을 Uint8Array로 변환
11
+ */
12
+ /** hex 변환용 조회 테이블 (성능 최적화) */
2
13
  const hexTable = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
14
+ /** Base64 인코딩 테이블 */
3
15
  const BASE64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
16
+ /** Base64 디코딩 조회 테이블 (O(1) 조회, 모든 바이트 값 포함) */
4
17
  const BASE64_LOOKUP = Array.from({ length: 256 }, (_, i) => {
5
- const idx = BASE64_CHARS.indexOf(String.fromCharCode(i));
6
- return idx === -1 ? 0 : idx;
18
+ const idx = BASE64_CHARS.indexOf(String.fromCharCode(i));
19
+ return idx === -1 ? 0 : idx;
7
20
  });
8
- function concat(arrays) {
9
- const total = arrays.reduce((sum, arr) => sum + arr.length, 0);
10
- const result = new Uint8Array(total);
11
- let offset = 0;
12
- for (const arr of arrays) {
13
- result.set(arr, offset);
14
- offset += arr.length;
15
- }
16
- return result;
21
+ /**
22
+ * 여러 Uint8Array 결합
23
+ * @param arrays 결합할 Uint8Array 배열
24
+ * @returns 결합된 새 Uint8Array
25
+ * @example
26
+ * const a = new Uint8Array([1, 2]);
27
+ * const b = new Uint8Array([3, 4]);
28
+ * concat([a, b]);
29
+ * // Uint8Array([1, 2, 3, 4])
30
+ */
31
+ export function concat(arrays) {
32
+ const total = arrays.reduce((sum, arr) => sum + arr.length, 0);
33
+ const result = new Uint8Array(total);
34
+ let offset = 0;
35
+ for (const arr of arrays) {
36
+ result.set(arr, offset);
37
+ offset += arr.length;
38
+ }
39
+ return result;
17
40
  }
18
- function toHex(bytes) {
19
- const h = hexTable;
20
- let result = "";
21
- for (let i = 0; i < bytes.length; i++) {
22
- result += h[bytes[i]];
23
- }
24
- return result;
41
+ /**
42
+ * hex 문자열로 변환
43
+ * @param bytes 변환할 Uint8Array
44
+ * @returns 소문자 hex 문자열
45
+ * @example
46
+ * toHex(new Uint8Array([255, 0, 127]));
47
+ * // "ff007f"
48
+ */
49
+ export function toHex(bytes) {
50
+ const h = hexTable;
51
+ let result = "";
52
+ for (let i = 0; i < bytes.length; i++) {
53
+ result += h[bytes[i]];
54
+ }
55
+ return result;
25
56
  }
26
- function fromHex(hex) {
27
- if (hex.length % 2 !== 0) {
28
- throw new ArgumentError("Hex string must have even length", { hex });
29
- }
30
- if (hex.length > 0 && !/^[0-9a-fA-F]+$/.test(hex)) {
31
- throw new ArgumentError("Invalid hex character included", { hex });
32
- }
33
- const bytes = new Uint8Array(hex.length / 2);
34
- for (let i = 0; i < bytes.length; i++) {
35
- bytes[i] = Number.parseInt(hex.substring(i * 2, i * 2 + 2), 16);
36
- }
37
- return bytes;
57
+ /**
58
+ * hex 문자열을 Uint8Array로 변환
59
+ * @param hex 변환할 hex 문자열 (대소문자 허용)
60
+ * @returns 변환된 Uint8Array
61
+ * @throws {ArgumentError} 홀수 길이이거나 유효하지 않은 hex 문자가 포함된 경우
62
+ * @example
63
+ * fromHex("ff007f");
64
+ * // Uint8Array([255, 0, 127])
65
+ */
66
+ export function fromHex(hex) {
67
+ if (hex.length % 2 !== 0) {
68
+ throw new ArgumentError("hex 문자열은 짝수 길이여야 합니다", { hex });
69
+ }
70
+ if (hex.length > 0 && !/^[0-9a-fA-F]+$/.test(hex)) {
71
+ throw new ArgumentError("유효하지 않은 hex 문자가 포함되어 있습니다", { hex });
72
+ }
73
+ const bytes = new Uint8Array(hex.length / 2);
74
+ for (let i = 0; i < bytes.length; i++) {
75
+ bytes[i] = Number.parseInt(hex.substring(i * 2, i * 2 + 2), 16);
76
+ }
77
+ return bytes;
38
78
  }
39
- function toBase64(bytes) {
40
- if (bytes.length === 0) {
41
- return "";
42
- }
43
- let result = "";
44
- const len = bytes.length;
45
- for (let i = 0; i < len; i += 3) {
46
- const b1 = bytes[i];
47
- const b2 = i + 1 < len ? bytes[i + 1] : 0;
48
- const b3 = i + 2 < len ? bytes[i + 2] : 0;
49
- result += BASE64_CHARS[b1 >> 2];
50
- result += BASE64_CHARS[(b1 & 3) << 4 | b2 >> 4];
51
- result += i + 1 < len ? BASE64_CHARS[(b2 & 15) << 2 | b3 >> 6] : "=";
52
- result += i + 2 < len ? BASE64_CHARS[b3 & 63] : "=";
53
- }
54
- return result;
79
+ /**
80
+ * Bytes를 base64 문자열로 변환
81
+ * @param bytes 변환할 Uint8Array
82
+ * @returns Base64 인코딩된 문자열
83
+ * @example
84
+ * toBase64(new Uint8Array([72, 101, 108, 108, 111]));
85
+ * // "SGVsbG8="
86
+ */
87
+ export function toBase64(bytes) {
88
+ if (bytes.length === 0) {
89
+ return "";
90
+ }
91
+ let result = "";
92
+ const len = bytes.length;
93
+ for (let i = 0; i < len; i += 3) {
94
+ const b1 = bytes[i];
95
+ const b2 = i + 1 < len ? bytes[i + 1] : 0;
96
+ const b3 = i + 2 < len ? bytes[i + 2] : 0;
97
+ result += BASE64_CHARS[b1 >> 2];
98
+ result += BASE64_CHARS[((b1 & 3) << 4) | (b2 >> 4)];
99
+ result += i + 1 < len ? BASE64_CHARS[((b2 & 15) << 2) | (b3 >> 6)] : "=";
100
+ result += i + 2 < len ? BASE64_CHARS[b3 & 63] : "=";
101
+ }
102
+ return result;
55
103
  }
56
- function fromBase64(base64) {
57
- const cleanBase64 = base64.replace(/\s/g, "").replace(/=+$/, "");
58
- if (cleanBase64.length === 0) {
59
- return new Uint8Array(0);
60
- }
61
- if (!/^[A-Za-z0-9+/]+$/.test(cleanBase64)) {
62
- throw new ArgumentError("Invalid base64 character included", {
63
- base64: base64.substring(0, 20)
64
- });
65
- }
66
- if (cleanBase64.length % 4 === 1) {
67
- throw new ArgumentError("Invalid base64 length", { length: cleanBase64.length });
68
- }
69
- const len = cleanBase64.length;
70
- const byteLen = Math.floor(len * 3 / 4);
71
- const bytes = new Uint8Array(byteLen);
72
- let byteIdx = 0;
73
- for (let i = 0; i < len; i += 4) {
74
- const c1 = BASE64_LOOKUP[cleanBase64.charCodeAt(i)];
75
- const c2 = i + 1 < len ? BASE64_LOOKUP[cleanBase64.charCodeAt(i + 1)] : 0;
76
- const c3 = i + 2 < len ? BASE64_LOOKUP[cleanBase64.charCodeAt(i + 2)] : 0;
77
- const c4 = i + 3 < len ? BASE64_LOOKUP[cleanBase64.charCodeAt(i + 3)] : 0;
78
- bytes[byteIdx++] = c1 << 2 | c2 >> 4;
79
- if (byteIdx < byteLen) bytes[byteIdx++] = (c2 & 15) << 4 | c3 >> 2;
80
- if (byteIdx < byteLen) bytes[byteIdx++] = (c3 & 3) << 6 | c4;
81
- }
82
- return bytes;
104
+ /**
105
+ * base64 문자열을 Bytes로 변환
106
+ * @param base64 변환할 base64 문자열
107
+ * @returns 디코딩된 Uint8Array
108
+ * @throws {ArgumentError} 유효하지 않은 base64 문자가 포함된 경우
109
+ * @example
110
+ * fromBase64("SGVsbG8=");
111
+ * // Uint8Array([72, 101, 108, 108, 111])
112
+ */
113
+ export function fromBase64(base64) {
114
+ // 공백 제거 패딩 정규화
115
+ const cleanBase64 = base64.replace(/\s/g, "").replace(/=+$/, "");
116
+ // 빈 문자열 처리
117
+ if (cleanBase64.length === 0) {
118
+ return new Uint8Array(0);
119
+ }
120
+ // 유효성 검사: 문자
121
+ if (!/^[A-Za-z0-9+/]+$/.test(cleanBase64)) {
122
+ throw new ArgumentError("유효하지 않은 base64 문자가 포함되어 있습니다", {
123
+ base64: base64.substring(0, 20),
124
+ });
125
+ }
126
+ // 유효성 검사: 길이 (패딩 제거 나머지가 1이면 유효하지 않음)
127
+ if (cleanBase64.length % 4 === 1) {
128
+ throw new ArgumentError("유효하지 않은 base64 길이입니다", { length: cleanBase64.length });
129
+ }
130
+ const len = cleanBase64.length;
131
+ const byteLen = Math.floor((len * 3) / 4);
132
+ const bytes = new Uint8Array(byteLen);
133
+ let byteIdx = 0;
134
+ for (let i = 0; i < len; i += 4) {
135
+ const c1 = BASE64_LOOKUP[cleanBase64.charCodeAt(i)];
136
+ const c2 = i + 1 < len ? BASE64_LOOKUP[cleanBase64.charCodeAt(i + 1)] : 0;
137
+ const c3 = i + 2 < len ? BASE64_LOOKUP[cleanBase64.charCodeAt(i + 2)] : 0;
138
+ const c4 = i + 3 < len ? BASE64_LOOKUP[cleanBase64.charCodeAt(i + 3)] : 0;
139
+ bytes[byteIdx++] = (c1 << 2) | (c2 >> 4);
140
+ if (byteIdx < byteLen)
141
+ bytes[byteIdx++] = ((c2 & 15) << 4) | (c3 >> 2);
142
+ if (byteIdx < byteLen)
143
+ bytes[byteIdx++] = ((c3 & 3) << 6) | c4;
144
+ }
145
+ return bytes;
83
146
  }
84
- export {
85
- concat,
86
- fromBase64,
87
- fromHex,
88
- toBase64,
89
- toHex
90
- };
91
- //# sourceMappingURL=bytes.js.map
147
+ //# sourceMappingURL=bytes.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/utils/bytes.ts"],
4
- "mappings": "AACA,SAAS,qBAAqB;AAc9B,MAAM,WAAqB,MAAM,KAAK,EAAE,QAAQ,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC;AAGhG,MAAM,eAAe;AAGrB,MAAM,gBAA0B,MAAM,KAAK,EAAE,QAAQ,IAAI,GAAG,CAAC,GAAG,MAAM;AACpE,QAAM,MAAM,aAAa,QAAQ,OAAO,aAAa,CAAC,CAAC;AACvD,SAAO,QAAQ,KAAK,IAAI;AAC1B,CAAC;AAYM,SAAS,OAAO,QAAwB;AAC7C,QAAM,QAAQ,OAAO,OAAO,CAAC,KAAK,QAAQ,MAAM,IAAI,QAAQ,CAAC;AAC7D,QAAM,SAAS,IAAI,WAAW,KAAK;AACnC,MAAI,SAAS;AACb,aAAW,OAAO,QAAQ;AACxB,WAAO,IAAI,KAAK,MAAM;AACtB,cAAU,IAAI;AAAA,EAChB;AACA,SAAO;AACT;AAUO,SAAS,MAAM,OAAsB;AAC1C,QAAM,IAAI;AACV,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,cAAU,EAAE,MAAM,CAAC,CAAC;AAAA,EACtB;AACA,SAAO;AACT;AAWO,SAAS,QAAQ,KAAoB;AAC1C,MAAI,IAAI,SAAS,MAAM,GAAG;AACxB,UAAM,IAAI,cAAc,oCAAoC,EAAE,IAAI,CAAC;AAAA,EACrE;AACA,MAAI,IAAI,SAAS,KAAK,CAAC,iBAAiB,KAAK,GAAG,GAAG;AACjD,UAAM,IAAI,cAAc,kCAAkC,EAAE,IAAI,CAAC;AAAA,EACnE;A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,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QACvE,IAAI,OAAO,GAAG,OAAO;YAAE,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;IACjE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Result of year/month/day normalization when setting month
2
+ * 설정 연/월/일 정규화 결과
3
3
  */
4
4
  export interface DtNormalizedMonth {
5
5
  year: number;
@@ -7,14 +7,14 @@ export interface DtNormalizedMonth {
7
7
  day: number;
8
8
  }
9
9
  /**
10
- * Normalize year/month/day when setting month
11
- * - Adjust year if month is outside 1-12 range
12
- * - Adjust to last day of target month if current day is greater than the number of days in the target month
10
+ * 설정 연/월/일 정규화
11
+ * - 월이 1-12 범위를 벗어나면 연도 조정
12
+ * - 현재 일이 대상 월의 일수보다 크면 해당 월의 마지막 일로 조정
13
13
  *
14
- * @param year Base year
15
- * @param month Month to set (values outside 1-12 range allowed)
16
- * @param day Base day
17
- * @returns Normalized year, month, day
14
+ * @param year 기준 연도
15
+ * @param month 설정할 (1-12 범위 밖의 값 허용)
16
+ * @param day 기준
17
+ * @returns 정규화된 연도, 월,
18
18
  *
19
19
  * @example
20
20
  * normalizeMonth(2025, 13, 15) // { year: 2026, month: 1, day: 15 }
@@ -22,48 +22,48 @@ export interface DtNormalizedMonth {
22
22
  */
23
23
  export declare function normalizeMonth(year: number, month: number, day: number): DtNormalizedMonth;
24
24
  /**
25
- * Convert 12-hour format to 24-hour format
25
+ * 12시간 형식을 24시간 형식으로 변환
26
26
  * - 12:00 AM = 0:00, 12:00 PM = 12:00
27
27
  * - 1-11 AM = 1-11, 1-11 PM = 13-23
28
28
  *
29
- * @param rawHour 12-hour format hour (1-12)
30
- * @param isPM Whether PM
31
- * @returns 24-hour format hour (0-23)
29
+ * @param rawHour 12시간 형식의 (1-12)
30
+ * @param isPM 오후 여부
31
+ * @returns 24시간 형식의 (0-23)
32
32
  */
33
33
  export declare function convert12To24(rawHour: number, isPM: boolean): number;
34
34
  /**
35
- * Convert date/time to string according to format string
35
+ * 형식 문자열에 따라 날짜/시간을 문자열로 변환
36
36
  *
37
- * @param formatString Format string
38
- * @param args Date/time components
37
+ * @param formatString 형식 문자열
38
+ * @param args 날짜/시간 구성요소
39
39
  *
40
40
  * @remarks
41
- * Supports the same format strings as C#:
41
+ * C#과 동일한 형식 문자열을 지원:
42
42
  *
43
- * | Format | Description | Example |
44
- * |--------|-------------|---------|
45
- * | yyyy | 4-digit year | 2024 |
46
- * | yy | 2-digit year | 24 |
47
- * | MM | Zero-padded month | 01~12 |
48
- * | M | Month | 1~12 |
49
- * | ddd | Day of week | Sun, Mon, Tue, Wed, Thu, Fri, Sat |
50
- * | dd | Zero-padded day | 01~31 |
51
- * | d | Day | 1~31 |
52
- * | tt | AM/PM | AM, PM |
53
- * | hh | Zero-padded 12-hour | 01~12 |
54
- * | h | 12-hour | 1~12 |
55
- * | HH | Zero-padded 24-hour | 00~23 |
56
- * | H | 24-hour | 0~23 |
57
- * | mm | Zero-padded minute | 00~59 |
58
- * | m | Minute | 0~59 |
59
- * | ss | Zero-padded second | 00~59 |
60
- * | s | Second | 0~59 |
61
- * | fff | Milliseconds (3 digits) | 000~999 |
62
- * | ff | Milliseconds (2 digits) | 00~99 |
63
- * | f | Milliseconds (1 digit) | 0~9 |
64
- * | zzz | Timezone offset (±HH:mm) | +09:00 |
65
- * | zz | Timezone offset (±HH) | +09 |
66
- * | z | Timezone offset (±H) | +9 |
43
+ * | 형식 | 설명 | 예시 |
44
+ * |------|------|------|
45
+ * | yyyy | 4자리 연도 | 2024 |
46
+ * | yy | 2자리 연도 | 24 |
47
+ * | MM | 0 채움 | 01~12 |
48
+ * | M | | 1~12 |
49
+ * | ddd | 요일 | 일, 월, 화, 수, 목, 금, |
50
+ * | dd | 0 채움 | 01~31 |
51
+ * | d | | 1~31 |
52
+ * | tt | 오전/오후 | AM, PM |
53
+ * | hh | 0 채움 12시간 | 01~12 |
54
+ * | h | 12시간 | 1~12 |
55
+ * | HH | 0 채움 24시간 | 00~23 |
56
+ * | H | 24시간 | 0~23 |
57
+ * | mm | 0 채움 | 00~59 |
58
+ * | m | | 0~59 |
59
+ * | ss | 0 채움 | 00~59 |
60
+ * | s | | 0~59 |
61
+ * | fff | 밀리초 (3자리) | 000~999 |
62
+ * | ff | 밀리초 (2자리) | 00~99 |
63
+ * | f | 밀리초 (1자리) | 0~9 |
64
+ * | zzz | 타임존 오프셋 (±HH:mm) | +09:00 |
65
+ * | zz | 타임존 오프셋 (±HH) | +09 |
66
+ * | z | 타임존 오프셋 (±H) | +9 |
67
67
  *
68
68
  * @example
69
69
  * ```typescript