@simplysm/core-common 13.0.100 → 14.0.4

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 (184) hide show
  1. package/README.md +86 -92
  2. package/dist/common.types.d.ts +14 -14
  3. package/dist/common.types.js +2 -1
  4. package/dist/common.types.js.map +1 -6
  5. package/dist/env.d.ts +8 -1
  6. package/dist/env.d.ts.map +1 -1
  7. package/dist/env.js +13 -9
  8. package/dist/env.js.map +1 -6
  9. package/dist/errors/argument-error.d.ts +10 -10
  10. package/dist/errors/argument-error.d.ts.map +1 -1
  11. package/dist/errors/argument-error.js +31 -14
  12. package/dist/errors/argument-error.js.map +1 -6
  13. package/dist/errors/not-implemented-error.d.ts +8 -8
  14. package/dist/errors/not-implemented-error.js +30 -12
  15. package/dist/errors/not-implemented-error.js.map +1 -6
  16. package/dist/errors/sd-error.d.ts +10 -10
  17. package/dist/errors/sd-error.d.ts.map +1 -1
  18. package/dist/errors/sd-error.js +45 -24
  19. package/dist/errors/sd-error.js.map +1 -6
  20. package/dist/errors/timeout-error.d.ts +10 -10
  21. package/dist/errors/timeout-error.js +34 -15
  22. package/dist/errors/timeout-error.js.map +1 -6
  23. package/dist/extensions/arr-ext.d.ts +2 -2
  24. package/dist/extensions/arr-ext.helpers.d.ts +10 -10
  25. package/dist/extensions/arr-ext.helpers.js +112 -89
  26. package/dist/extensions/arr-ext.helpers.js.map +1 -6
  27. package/dist/extensions/arr-ext.js +458 -422
  28. package/dist/extensions/arr-ext.js.map +1 -6
  29. package/dist/extensions/arr-ext.types.d.ts +57 -57
  30. package/dist/extensions/arr-ext.types.d.ts.map +1 -1
  31. package/dist/extensions/arr-ext.types.js +6 -1
  32. package/dist/extensions/arr-ext.types.js.map +1 -6
  33. package/dist/extensions/map-ext.d.ts +16 -16
  34. package/dist/extensions/map-ext.js +27 -22
  35. package/dist/extensions/map-ext.js.map +1 -6
  36. package/dist/extensions/set-ext.d.ts +11 -11
  37. package/dist/extensions/set-ext.js +32 -25
  38. package/dist/extensions/set-ext.js.map +1 -6
  39. package/dist/features/debounce-queue.d.ts +17 -17
  40. package/dist/features/debounce-queue.js +98 -70
  41. package/dist/features/debounce-queue.js.map +1 -6
  42. package/dist/features/event-emitter.d.ts +20 -20
  43. package/dist/features/event-emitter.js +101 -78
  44. package/dist/features/event-emitter.js.map +1 -6
  45. package/dist/features/serial-queue.d.ts +11 -11
  46. package/dist/features/serial-queue.js +78 -57
  47. package/dist/features/serial-queue.js.map +1 -6
  48. package/dist/globals.d.ts +4 -4
  49. package/dist/globals.js +9 -1
  50. package/dist/globals.js.map +1 -6
  51. package/dist/index.js +28 -27
  52. package/dist/index.js.map +1 -6
  53. package/dist/types/date-only.d.ts +64 -64
  54. package/dist/types/date-only.d.ts.map +1 -1
  55. package/dist/types/date-only.js +263 -252
  56. package/dist/types/date-only.js.map +1 -6
  57. package/dist/types/date-time.d.ts +36 -36
  58. package/dist/types/date-time.d.ts.map +1 -1
  59. package/dist/types/date-time.js +196 -288
  60. package/dist/types/date-time.js.map +1 -6
  61. package/dist/types/lazy-gc-map.d.ts +26 -26
  62. package/dist/types/lazy-gc-map.d.ts.map +1 -1
  63. package/dist/types/lazy-gc-map.js +202 -159
  64. package/dist/types/lazy-gc-map.js.map +1 -6
  65. package/dist/types/time.d.ts +23 -23
  66. package/dist/types/time.d.ts.map +1 -1
  67. package/dist/types/time.js +169 -158
  68. package/dist/types/time.js.map +1 -6
  69. package/dist/types/uuid.d.ts +11 -11
  70. package/dist/types/uuid.d.ts.map +1 -1
  71. package/dist/types/uuid.js +95 -70
  72. package/dist/types/uuid.js.map +1 -6
  73. package/dist/utils/bytes.d.ts +17 -17
  74. package/dist/utils/bytes.js +137 -81
  75. package/dist/utils/bytes.js.map +1 -6
  76. package/dist/utils/date-format.d.ts +40 -40
  77. package/dist/utils/date-format.js +187 -101
  78. package/dist/utils/date-format.js.map +1 -6
  79. package/dist/utils/error.d.ts +4 -4
  80. package/dist/utils/error.js +11 -6
  81. package/dist/utils/error.js.map +1 -6
  82. package/dist/utils/json.d.ts +19 -19
  83. package/dist/utils/json.js +187 -135
  84. package/dist/utils/json.js.map +1 -6
  85. package/dist/utils/num.d.ts +20 -20
  86. package/dist/utils/num.js +76 -34
  87. package/dist/utils/num.js.map +1 -6
  88. package/dist/utils/obj.d.ts +111 -111
  89. package/dist/utils/obj.d.ts.map +1 -1
  90. package/dist/utils/obj.js +706 -496
  91. package/dist/utils/obj.js.map +1 -6
  92. package/dist/utils/path.d.ts +10 -10
  93. package/dist/utils/path.js +35 -18
  94. package/dist/utils/path.js.map +1 -6
  95. package/dist/utils/primitive.d.ts +5 -5
  96. package/dist/utils/primitive.js +34 -14
  97. package/dist/utils/primitive.js.map +1 -6
  98. package/dist/utils/str.d.ts +38 -38
  99. package/dist/utils/str.js +217 -113
  100. package/dist/utils/str.js.map +1 -6
  101. package/dist/utils/template-strings.d.ts +26 -26
  102. package/dist/utils/template-strings.js +113 -40
  103. package/dist/utils/template-strings.js.map +1 -6
  104. package/dist/utils/transferable.d.ts +18 -18
  105. package/dist/utils/transferable.js +218 -151
  106. package/dist/utils/transferable.js.map +1 -6
  107. package/dist/utils/wait.d.ts +9 -9
  108. package/dist/utils/wait.js +30 -15
  109. package/dist/utils/wait.js.map +1 -6
  110. package/dist/utils/xml.d.ts +13 -13
  111. package/dist/utils/xml.js +84 -46
  112. package/dist/utils/xml.js.map +1 -6
  113. package/dist/utils/zip.d.ts +22 -22
  114. package/dist/utils/zip.js +172 -148
  115. package/dist/utils/zip.js.map +1 -6
  116. package/docs/array-extensions.md +430 -0
  117. package/docs/env.md +52 -0
  118. package/docs/errors.md +41 -56
  119. package/docs/features.md +82 -97
  120. package/docs/type-utilities.md +91 -0
  121. package/docs/types.md +221 -201
  122. package/docs/utils.md +319 -435
  123. package/package.json +7 -5
  124. package/src/common.types.ts +14 -14
  125. package/src/env.ts +12 -3
  126. package/src/errors/argument-error.ts +15 -15
  127. package/src/errors/not-implemented-error.ts +9 -9
  128. package/src/errors/sd-error.ts +12 -12
  129. package/src/errors/timeout-error.ts +12 -12
  130. package/src/extensions/arr-ext.helpers.ts +16 -16
  131. package/src/extensions/arr-ext.ts +35 -35
  132. package/src/extensions/arr-ext.types.ts +57 -57
  133. package/src/extensions/map-ext.ts +16 -16
  134. package/src/extensions/set-ext.ts +11 -11
  135. package/src/features/debounce-queue.ts +23 -23
  136. package/src/features/event-emitter.ts +25 -25
  137. package/src/features/serial-queue.ts +13 -13
  138. package/src/globals.ts +4 -4
  139. package/src/index.ts +5 -5
  140. package/src/types/date-only.ts +84 -83
  141. package/src/types/date-time.ts +43 -42
  142. package/src/types/lazy-gc-map.ts +44 -44
  143. package/src/types/time.ts +29 -29
  144. package/src/types/uuid.ts +15 -15
  145. package/src/utils/bytes.ts +35 -35
  146. package/src/utils/date-format.ts +59 -59
  147. package/src/utils/error.ts +4 -4
  148. package/src/utils/json.ts +41 -41
  149. package/src/utils/num.ts +20 -20
  150. package/src/utils/obj.ts +138 -138
  151. package/src/utils/path.ts +10 -10
  152. package/src/utils/primitive.ts +6 -6
  153. package/src/utils/str.ts +48 -48
  154. package/src/utils/template-strings.ts +29 -29
  155. package/src/utils/transferable.ts +38 -38
  156. package/src/utils/wait.ts +10 -10
  157. package/src/utils/xml.ts +19 -19
  158. package/src/utils/zip.ts +25 -25
  159. package/docs/extensions.md +0 -387
  160. package/tests/errors/errors.spec.ts +0 -80
  161. package/tests/extensions/array-extension.spec.ts +0 -654
  162. package/tests/extensions/map-extension.spec.ts +0 -117
  163. package/tests/extensions/set-extension.spec.ts +0 -67
  164. package/tests/types/date-only.spec.ts +0 -533
  165. package/tests/types/date-time.spec.ts +0 -246
  166. package/tests/types/lazy-gc-map.spec.ts +0 -606
  167. package/tests/types/time.spec.ts +0 -428
  168. package/tests/types/uuid.spec.ts +0 -74
  169. package/tests/utils/bytes-utils.spec.ts +0 -197
  170. package/tests/utils/date-format.spec.ts +0 -350
  171. package/tests/utils/debounce-queue.spec.ts +0 -226
  172. package/tests/utils/json.spec.ts +0 -400
  173. package/tests/utils/number.spec.ts +0 -136
  174. package/tests/utils/object.spec.ts +0 -810
  175. package/tests/utils/path.spec.ts +0 -70
  176. package/tests/utils/primitive.spec.ts +0 -43
  177. package/tests/utils/sd-event-emitter.spec.ts +0 -189
  178. package/tests/utils/serial-queue.spec.ts +0 -305
  179. package/tests/utils/string.spec.ts +0 -265
  180. package/tests/utils/template-strings.spec.ts +0 -48
  181. package/tests/utils/transferable.spec.ts +0 -639
  182. package/tests/utils/wait.spec.ts +0 -123
  183. package/tests/utils/xml.spec.ts +0 -146
  184. package/tests/utils/zip.spec.ts +0 -221
package/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # @simplysm/core-common
2
2
 
3
- Core module (common) -- platform-neutral core utilities for the Simplysm framework.
4
-
5
- Provides error classes, immutable date/time types, prototype extensions, event handling, and utility namespaces that work in both browser and Node.js environments.
3
+ Platform-neutral utility library for the Simplysm framework. Provides type-safe primitives, collection extensions, error hierarchy, async utilities, and serialization helpers that work in both browser and Node.js environments.
6
4
 
7
5
  ## Installation
8
6
 
@@ -10,26 +8,41 @@ Provides error classes, immutable date/time types, prototype extensions, event h
10
8
  npm install @simplysm/core-common
11
9
  ```
12
10
 
13
- ## Side-Effect Imports
11
+ ## API Overview
14
12
 
15
- Importing the package entry point (`@simplysm/core-common`) automatically patches `Array`, `Map`, and `Set` prototypes with extension methods. These are declared as side effects in `package.json`:
13
+ ### Environment
16
14
 
17
- - `extensions/arr-ext` -- Array prototype extensions
18
- - `extensions/map-ext` -- Map prototype extensions
19
- - `extensions/set-ext` -- Set prototype extensions
15
+ | API | Type | Description |
16
+ |-----|------|-------------|
17
+ | `env` | `object` | Unified environment variables from `import.meta.env` and `process.env` |
18
+ | `parseBoolEnv` | `function` | Parse a value to boolean (`"true"`, `"1"`, `"yes"`, `"on"` -> `true`) |
20
19
 
21
- If you import only specific modules (e.g., `@simplysm/core-common/dist/types/date-time`), the prototype extensions are **not** applied unless you also import the entry point or the extension modules directly.
20
+ -> See [docs/env.md](./docs/env.md) for details.
22
21
 
23
- ## API Overview
22
+ ### Array / Set / Map Extensions
23
+
24
+ | API | Type | Description |
25
+ |-----|------|-------------|
26
+ | `Array.prototype.*` | extension | 30+ methods: `single`, `first`, `last`, `groupBy`, `toMap`, `distinct`, `orderBy`, `diffs`, `sum`, `min`, `max`, etc. |
27
+ | `Set.prototype.adds` | extension | Add multiple values at once |
28
+ | `Set.prototype.toggle` | extension | Toggle a value (add if absent, remove if present) |
29
+ | `Map.prototype.getOrCreate` | extension | Get value or create with default/factory |
30
+ | `Map.prototype.update` | extension | Update a value using a function |
31
+ | `ArrayDiffsResult` | type | Result type for `diffs()` |
32
+ | `ArrayOneWayDiffResult` | type | Result type for `oneWayDiffs()` |
33
+ | `TreeArray` | type | Tree node type for `toTree()` |
34
+ | `ComparableType` | type | Union of types usable in ordering |
35
+
36
+ -> See [docs/array-extensions.md](./docs/array-extensions.md) for details.
24
37
 
25
38
  ### Errors
26
39
 
27
40
  | API | Type | Description |
28
41
  |-----|------|-------------|
29
- | `SdError` | class | Error with tree-structured cause chaining |
42
+ | `SdError` | class | Tree-structured error with cause chaining |
30
43
  | `ArgumentError` | class | Invalid argument error with YAML-formatted details |
31
44
  | `NotImplementedError` | class | Unimplemented feature error |
32
- | `TimeoutError` | class | Waiting time exceeded error |
45
+ | `TimeoutError` | class | Timeout exceeded error |
33
46
 
34
47
  -> See [docs/errors.md](./docs/errors.md) for details.
35
48
 
@@ -38,17 +51,10 @@ If you import only specific modules (e.g., `@simplysm/core-common/dist/types/dat
38
51
  | API | Type | Description |
39
52
  |-----|------|-------------|
40
53
  | `Uuid` | class | UUID v4 generation and parsing |
41
- | `DateTime` | class | Immutable date+time (millisecond precision) |
42
- | `DateOnly` | class | Immutable date without time |
43
- | `Time` | class | Immutable time without date (24h wraparound) |
44
- | `LazyGcMap` | class | Map with LRU-based automatic expiration |
45
- | `Bytes` | type alias | `Uint8Array` (replaces `Buffer`) |
46
- | `PrimitiveTypeMap` | type | Mapping of type name strings to types |
47
- | `PrimitiveTypeStr` | type | `keyof PrimitiveTypeMap` |
48
- | `PrimitiveType` | type | Union of all primitive types |
49
- | `DeepPartial<T>` | type | Recursively makes all properties optional |
50
- | `Type<T>` | interface | Constructor type for DI and factory patterns |
51
- | `env` | const | Unified `DEV` / `VER` environment accessor |
54
+ | `LazyGcMap` | class | Auto-expiring Map with LRU-style GC |
55
+ | `DateTime` | class | Immutable date-time wrapper with millisecond precision |
56
+ | `DateOnly` | class | Immutable date-only wrapper (no time component) |
57
+ | `Time` | class | Immutable time-only wrapper (no date component, 24h cyclic) |
52
58
 
53
59
  -> See [docs/types.md](./docs/types.md) for details.
54
60
 
@@ -56,105 +62,93 @@ If you import only specific modules (e.g., `@simplysm/core-common/dist/types/dat
56
62
 
57
63
  | API | Type | Description |
58
64
  |-----|------|-------------|
59
- | `EventEmitter` | class | Type-safe event emitter (EventTarget wrapper) |
60
- | `DebounceQueue` | class | Async debounce -- only the last call executes |
61
- | `SerialQueue` | class | Async serial execution queue |
65
+ | `DebounceQueue` | class | Async debounce queue -- only executes the last enqueued function |
66
+ | `SerialQueue` | class | Async serial queue -- executes functions one at a time in order |
67
+ | `EventEmitter` | class | Type-safe event emitter built on EventTarget |
62
68
 
63
69
  -> See [docs/features.md](./docs/features.md) for details.
64
70
 
65
- ### Prototype Extensions (side-effect)
71
+ ### Utils (Namespace Exports)
66
72
 
67
73
  | API | Type | Description |
68
74
  |-----|------|-------------|
69
- | `Array` extensions | prototype | 34 methods -- query, transform, diff, sort, mutate |
70
- | `Map` extensions | prototype | `getOrCreate`, `update` |
71
- | `Set` extensions | prototype | `adds`, `toggle` |
75
+ | `obj` | namespace | Deep clone, deep equal, deep merge, 3-way merge, omit, pick, chain access, type-safe keys/entries |
76
+ | `str` | namespace | Korean suffix, full-width conversion, case transforms, `isNullOrEmpty`, `insert` |
77
+ | `num` | namespace | parseInt, parseFloat, parseRoundedInt, isNullOrEmpty, format |
78
+ | `bytes` | namespace | Uint8Array concat, hex, base64 conversions |
79
+ | `path` | namespace | POSIX-style path join, basename, extname (browser-safe) |
80
+ | `json` | namespace | JSON stringify/parse with custom type support (DateTime, Uuid, Map, Set, etc.) |
81
+ | `xml` | namespace | XML parse/stringify via fast-xml-parser |
82
+ | `wait` | namespace | `until` (poll condition) and `time` (delay) |
83
+ | `transfer` | namespace | Worker-transferable encode/decode for custom types |
84
+ | `err` | namespace | Extract error message from unknown |
85
+ | `dt` | namespace | Date/time format strings (C#-style patterns) |
86
+ | `primitive` | namespace | Runtime primitive type string detection |
87
+ | `js`, `ts`, `html`, `tsql`, `mysql`, `pgsql` | template tag | IDE syntax highlighting template tags with indent normalization |
88
+ | `ZipArchive` | class | ZIP read/write/compress/extract |
72
89
 
73
- -> See [docs/extensions.md](./docs/extensions.md) for details.
90
+ -> See [docs/utils.md](./docs/utils.md) for details.
74
91
 
75
- ### Utilities
92
+ ### Type Utilities
76
93
 
77
94
  | API | Type | Description |
78
95
  |-----|------|-------------|
79
- | `obj` | namespace | clone, equal, merge, merge3, omit, pick, chain access |
80
- | `str` | namespace | Korean particles, case conversion, full-width replacement |
81
- | `num` | namespace | parseInt, parseFloat, format with separators |
82
- | `bytes` | namespace | concat, hex, base64 conversion |
83
- | `path` | namespace | POSIX-only join, basename, extname |
84
- | `json` | namespace | Custom-type-aware JSON stringify/parse |
85
- | `xml` | namespace | XML parse/stringify via fast-xml-parser |
86
- | `wait` | namespace | `until` (polling) and `time` (delay) |
87
- | `transfer` | namespace | Worker-safe encode/decode for custom types |
88
- | `err` | namespace | Extract message from unknown error |
89
- | `dt` | namespace | Date format, month normalization, 12h/24h conversion |
90
- | `primitive` | namespace | Infer `PrimitiveTypeStr` from a value |
91
- | `js`, `ts`, `html`, `tsql`, `mysql`, `pgsql` | function | Template tag functions for syntax highlighting |
92
- | `ZipArchive` | class | ZIP read/write/compress with caching |
96
+ | `Bytes` | type alias | `Uint8Array` (replaces `Buffer`) |
97
+ | `PrimitiveTypeMap` | type | Maps type-string keys to their TypeScript types |
98
+ | `PrimitiveTypeStr` | type | `"string" \| "number" \| "boolean" \| "DateTime" \| "DateOnly" \| "Time" \| "Uuid" \| "Bytes"` |
99
+ | `PrimitiveType` | type | Union of all primitive type values |
100
+ | `DeepPartial<T>` | type | Recursively makes all properties optional |
101
+ | `Type<T>` | interface | Constructor type (`new (...args) => T`) |
93
102
 
94
- -> See [docs/utils.md](./docs/utils.md) for details.
103
+ -> See [docs/type-utilities.md](./docs/type-utilities.md) for details.
95
104
 
96
- ## Quick Usage Examples
105
+ ## Usage Examples
97
106
 
98
- ### DateTime (immutable date/time)
107
+ ### Deep cloning and comparing objects
99
108
 
100
109
  ```typescript
101
- import { DateTime, DateOnly } from "@simplysm/core-common";
110
+ import { obj } from "@simplysm/core-common";
102
111
 
103
- const now = new DateTime();
104
- const tomorrow = now.addDays(1);
105
- const formatted = now.toFormatString("yyyy-MM-dd HH:mm:ss");
106
- const parsed = DateTime.parse("2025-01-15 10:30:00");
112
+ const original = { a: 1, b: { c: [2, 3] } };
113
+ const cloned = obj.clone(original);
114
+ obj.equal(original, cloned); // true
107
115
 
108
- const today = new DateOnly();
109
- const weekInfo = today.getWeekSeqOfYear(); // { year, weekSeq }
116
+ const merged = obj.merge(original, { b: { d: 4 } });
117
+ // { a: 1, b: { c: [2, 3], d: 4 } }
110
118
  ```
111
119
 
112
- ### Object utilities
120
+ ### Using Array extensions
113
121
 
114
122
  ```typescript
115
- import { obj, json } from "@simplysm/core-common";
116
-
117
- const cloned = obj.clone(deepObject);
118
- const isEqual = obj.equal(a, b, { ignoreArrayIndex: true });
119
- const merged = obj.merge(base, override);
120
- const value = obj.getChainValue(data, "a.b[0].c");
121
-
122
- // Custom-type-aware JSON
123
- const str = json.stringify({ date: new DateTime(), id: Uuid.generate() });
124
- const restored = json.parse(str); // DateTime and Uuid instances restored
125
- ```
123
+ import "@simplysm/core-common";
126
124
 
127
- ### Array extensions
125
+ const users = [
126
+ { id: 1, role: "admin", name: "Alice" },
127
+ { id: 2, role: "user", name: "Bob" },
128
+ { id: 3, role: "user", name: "Carol" },
129
+ ];
128
130
 
129
- ```typescript
130
- import "@simplysm/core-common";
131
+ const grouped = users.groupBy((u) => u.role);
132
+ // [{ key: "admin", values: [Alice] }, { key: "user", values: [Bob, Carol] }]
131
133
 
132
- const items = [3, 1, 4, 1, 5];
133
- items.distinct(); // [3, 1, 4, 5]
134
- items.orderBy(); // [1, 1, 3, 4, 5]
135
- items.sum(); // 14
136
- items.groupBy((x) => x % 2 === 0 ? "even" : "odd");
134
+ const userMap = users.toMap((u) => u.id);
135
+ // Map { 1 => Alice, 2 => Bob, 3 => Carol }
137
136
 
138
- const users = [{ id: 1, name: "A" }, { id: 2, name: "B" }];
139
- users.toMap((u) => u.id); // Map { 1 => {...}, 2 => {...} }
140
- users.single((u) => u.id === 1); // { id: 1, name: "A" }
137
+ const sorted = users.orderBy((u) => u.name);
141
138
  ```
142
139
 
143
- ### EventEmitter
140
+ ### JSON serialization with custom types
144
141
 
145
142
  ```typescript
146
- import { EventEmitter } from "@simplysm/core-common";
143
+ import { json, DateTime, Uuid } from "@simplysm/core-common";
147
144
 
148
- interface MyEvents { data: string; done: void }
145
+ const data = {
146
+ id: Uuid.generate(),
147
+ createdAt: new DateTime(2025, 6, 15, 10, 30, 0),
148
+ tags: new Set(["a", "b"]),
149
+ };
149
150
 
150
- class MyService extends EventEmitter<MyEvents> {}
151
-
152
- const svc = new MyService();
153
- svc.on("data", (msg) => console.log(msg));
154
- svc.emit("data", "hello");
155
- svc.emit("done");
151
+ const serialized = json.stringify(data);
152
+ const restored = json.parse(serialized);
153
+ // restored.id is Uuid, restored.createdAt is DateTime, restored.tags is Set
156
154
  ```
157
-
158
- ## License
159
-
160
- Apache-2.0
@@ -3,12 +3,12 @@ import { DateOnly } from "./types/date-only";
3
3
  import { Time } from "./types/time";
4
4
  import { Uuid } from "./types/uuid";
5
5
  /**
6
- * Binary type used instead of Buffer
6
+ * Buffer 대신 사용하는 바이너리 타입
7
7
  */
8
8
  export type Bytes = Uint8Array;
9
9
  /**
10
- * Primitive type mapping
11
- * Shared with orm-common
10
+ * 원시 타입 매핑
11
+ * orm-common과 공유
12
12
  */
13
13
  export type PrimitiveTypeMap = {
14
14
  string: string;
@@ -21,19 +21,19 @@ export type PrimitiveTypeMap = {
21
21
  Bytes: Bytes;
22
22
  };
23
23
  /**
24
- * Primitive type string key
24
+ * 원시 타입 문자열 key
25
25
  */
26
26
  export type PrimitiveTypeStr = keyof PrimitiveTypeMap;
27
27
  /**
28
- * Primitive type union
28
+ * 원시 타입 union
29
29
  */
30
30
  export type PrimitiveType = PrimitiveTypeMap[PrimitiveTypeStr] | undefined;
31
31
  /**
32
- * Deep Partial type
32
+ * Deep Partial 타입
33
33
  *
34
- * Recursively makes all properties of an object optional.
35
- * Primitive types (string, number, boolean, etc.) are kept as-is,
36
- * only object/array types have Partial applied recursively.
34
+ * 객체의 모든 속성을 재귀적으로 optional로 만든다.
35
+ * 원시 타입(string, number, boolean ) 그대로 유지하고,
36
+ * object/array 타입에만 재귀적으로 Partial 적용한다.
37
37
  *
38
38
  * @example
39
39
  * ```typescript
@@ -45,7 +45,7 @@ export type PrimitiveType = PrimitiveTypeMap[PrimitiveTypeStr] | undefined;
45
45
  * };
46
46
  * }
47
47
  *
48
- * // All properties at every depth become optional
48
+ * // 모든 깊이의 속성이 optional이
49
49
  * const partial: DeepPartial<User> = {
50
50
  * profile: { address: {} }
51
51
  * };
@@ -55,10 +55,10 @@ export type DeepPartial<TObject> = Partial<{
55
55
  [K in keyof TObject]: TObject[K] extends PrimitiveType ? TObject[K] : DeepPartial<TObject[K]>;
56
56
  }>;
57
57
  /**
58
- * Constructor type
58
+ * 생성자 타입
59
59
  *
60
- * Used to represent a class constructor as a type.
61
- * Primarily used in dependency injection, factory patterns, and instanceof checks.
60
+ * 클래스 생성자를 타입으로 표현할 사용한다.
61
+ * 주로 의존성 주입, 팩토리 패턴, instanceof 체크에 활용된다.
62
62
  *
63
63
  * @example
64
64
  * function create<T>(ctor: Type<T>): T {
@@ -66,7 +66,7 @@ export type DeepPartial<TObject> = Partial<{
66
66
  * }
67
67
  *
68
68
  * class MyClass { name = "test"; }
69
- * const instance = create(MyClass); // MyClass instance
69
+ * const instance = create(MyClass); // MyClass 인스턴스
70
70
  */
71
71
  export interface Type<TInstance> extends Function {
72
72
  new (...args: unknown[]): TInstance;
@@ -2,4 +2,5 @@ import { DateTime } from "./types/date-time.js";
2
2
  import { DateOnly } from "./types/date-only.js";
3
3
  import { Time } from "./types/time.js";
4
4
  import { Uuid } from "./types/uuid.js";
5
- //# sourceMappingURL=common.types.js.map
5
+ //#endregion
6
+ //# sourceMappingURL=common.types.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/common.types.ts"],
4
- "mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,YAAY;",
5
- "names": []
6
- }
1
+ {"version":3,"file":"common.types.js","sourceRoot":"","sources":["../src/common.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAuFpC,YAAY"}
package/dist/env.d.ts CHANGED
@@ -1,8 +1,15 @@
1
1
  declare global {
2
+ interface ImportMetaEnv extends Record<string, unknown> {
3
+ }
2
4
  interface ImportMeta {
3
- env?: Record<string, unknown>;
5
+ readonly env: ImportMetaEnv;
4
6
  }
5
7
  }
8
+ /**
9
+ * 환경변수 값을 boolean으로 파싱
10
+ * "true", "1", "yes", "on" (대소문자 무시) → true, 그 외 → false
11
+ */
12
+ export declare function parseBoolEnv(value: unknown): boolean;
6
13
  export declare const env: {
7
14
  DEV: boolean;
8
15
  VER?: string;
package/dist/env.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/B;CACF;AAMD,eAAO,MAAM,GAAG,EAAE;IAChB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAKxB,CAAC"}
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;KAAG;IAC1D,UAAU,UAAU;QAClB,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;KAC7B;CACF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEpD;AAMD,eAAO,MAAM,GAAG,EAAE;IAChB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAKxB,CAAC"}
package/dist/env.js CHANGED
@@ -1,12 +1,16 @@
1
- const _metaEnv = import.meta.env ?? {};
1
+ /**
2
+ * 환경변수 값을 boolean으로 파싱
3
+ * "true", "1", "yes", "on" (대소문자 무시) → true, 그 외 → false
4
+ */
5
+ export function parseBoolEnv(value) {
6
+ return ["true", "1", "yes", "on"].includes(String(value ?? "").toLowerCase());
7
+ }
8
+ const _metaEnv = { ...import.meta.env };
2
9
  const _processEnv = typeof process !== "undefined" ? process.env : {};
3
10
  const _raw = { ..._metaEnv, ..._processEnv };
4
- const env = {
5
- ..._raw,
6
- DEV: JSON.parse(String(_raw["DEV"] != null && String(_raw["DEV"]) !== "" ? _raw["DEV"] : false)),
7
- VER: _raw["VER"]
11
+ export const env = {
12
+ ..._raw,
13
+ DEV: parseBoolEnv(_raw["DEV"]),
14
+ VER: _raw["VER"],
8
15
  };
9
- export {
10
- env
11
- };
12
- //# sourceMappingURL=env.js.map
16
+ //# sourceMappingURL=env.js.map
package/dist/env.js.map CHANGED
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/env.ts"],
4
- "mappings": "AAQA,MAAM,WAAoC,YAAY,OAAO,CAAC;AAC9D,MAAM,cAAuC,OAAO,YAAY,cAAc,QAAQ,MAAM,CAAC;AAC7F,MAAM,OAAgC,EAAE,GAAG,UAAU,GAAG,YAAY;AAE7D,MAAM,MAIT;AAAA,EACF,GAAG;AAAA,EACH,KAAK,KAAK,MAAM,OAAO,KAAK,KAAK,KAAK,QAAQ,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,KAAK,KAAK,IAAI,KAAK,CAAC;AAAA,EAC/F,KAAK,KAAK,KAAK;AACjB;",
5
- "names": []
6
- }
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,QAAQ,GAA4B,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AACjE,MAAM,WAAW,GAA4B,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/F,MAAM,IAAI,GAA4B,EAAE,GAAG,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAC;AAEtE,MAAM,CAAC,MAAM,GAAG,GAIZ;IACF,GAAG,IAAI;IACP,GAAG,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,GAAG,EAAE,IAAI,CAAC,KAAK,CAAuB;CACvC,CAAC"}
@@ -1,24 +1,24 @@
1
1
  import { SdError } from "./sd-error";
2
2
  /**
3
- * Argument error
3
+ * 인자 오류
4
4
  *
5
- * An error thrown when invalid arguments are received.
6
- * Includes the argument object in YAML format in the message to facilitate debugging.
5
+ * 유효하지 않은 인자를 전달받았을 발생하는 에러.
6
+ * 디버깅을 용이하게 하기 위해 인자 객체를 YAML 형식으로 메시지에 포함한다.
7
7
  *
8
8
  * @example
9
- * // Passing only the argument object
9
+ * // 인자 객체만 전달
10
10
  * throw new ArgumentError({ userId: 123, name: null });
11
- * // Result message: "Invalid arguments.\n\nuserId: 123\nname: null"
11
+ * // 결과 메시지: "잘못된 인자입니다.\n\nuserId: 123\nname: null"
12
12
  *
13
13
  * @example
14
- * // Passing a custom message and argument object
15
- * throw new ArgumentError("Invalid user", { userId: 123 });
16
- * // Result message: "Invalid user\n\nuserId: 123"
14
+ * // 커스텀 메시지와 인자 객체를 전달
15
+ * throw new ArgumentError("잘못된 사용자", { userId: 123 });
16
+ * // 결과 메시지: "잘못된 사용자\n\nuserId: 123"
17
17
  */
18
18
  export declare class ArgumentError extends SdError {
19
- /** Output argument object in YAML format with default message ("Invalid arguments.") */
19
+ /** 기본 메시지("잘못된 인자입니다.")와 함께 인자 객체를 YAML 형식으로 출력 */
20
20
  constructor(argObj: Record<string, unknown>);
21
- /** Output argument object in YAML format with a custom message */
21
+ /** 커스텀 메시지와 함께 인자 객체를 YAML 형식으로 출력 */
22
22
  constructor(message: string, argObj: Record<string, unknown>);
23
23
  constructor(arg1: Record<string, unknown> | string, arg2?: Record<string, unknown>);
24
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"argument-error.d.ts","sourceRoot":"","sources":["../../src/errors/argument-error.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAc,SAAQ,OAAO;IACxC,wFAAwF;gBAC5E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3C,kEAAkE;gBACtD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAYnF"}
1
+ {"version":3,"file":"argument-error.d.ts","sourceRoot":"","sources":["../../src/errors/argument-error.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,aAAc,SAAQ,OAAO;IACxC,mDAAmD;gBACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3C,sCAAsC;gBAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAYnF"}
@@ -1,18 +1,35 @@
1
+ // yaml 라이브러리를 사용하는 이유:
2
+ // 중첩된 객체 구조를 읽기 쉬운 형식으로 표현하기 위함.
3
+ // JSON.stringify보다 트리 구조가 더 명확하게 보임.
1
4
  import YAML from "yaml";
2
5
  import { SdError } from "./sd-error.js";
3
- class ArgumentError extends SdError {
4
- constructor(arg1, arg2) {
5
- const message = typeof arg1 === "string" ? arg1 : void 0;
6
- const argObj = typeof arg1 === "string" ? arg2 : arg1;
7
- if (argObj != null) {
8
- super((message ?? "Invalid arguments.") + "\n\n" + YAML.stringify(argObj));
9
- } else {
10
- super(message ?? "Invalid arguments.");
6
+ /**
7
+ * 인자 오류
8
+ *
9
+ * 유효하지 않은 인자를 전달받았을 발생하는 에러.
10
+ * 디버깅을 용이하게 하기 위해 인자 객체를 YAML 형식으로 메시지에 포함한다.
11
+ *
12
+ * @example
13
+ * // 인자 객체만 전달
14
+ * throw new ArgumentError({ userId: 123, name: null });
15
+ * // 결과 메시지: "잘못된 인자입니다.\n\nuserId: 123\nname: null"
16
+ *
17
+ * @example
18
+ * // 커스텀 메시지와 인자 객체를 전달
19
+ * throw new ArgumentError("잘못된 사용자", { userId: 123 });
20
+ * // 결과 메시지: "잘못된 사용자\n\nuserId: 123"
21
+ */
22
+ export class ArgumentError extends SdError {
23
+ constructor(arg1, arg2) {
24
+ const message = typeof arg1 === "string" ? arg1 : undefined;
25
+ const argObj = typeof arg1 === "string" ? arg2 : arg1;
26
+ if (argObj != null) {
27
+ super((message ?? "잘못된 인자입니다.") + "\n\n" + YAML.stringify(argObj));
28
+ }
29
+ else {
30
+ super(message ?? "잘못된 인자입니다.");
31
+ }
32
+ this.name = "ArgumentError";
11
33
  }
12
- this.name = "ArgumentError";
13
- }
14
34
  }
15
- export {
16
- ArgumentError
17
- };
18
- //# sourceMappingURL=argument-error.js.map
35
+ //# sourceMappingURL=argument-error.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/errors/argument-error.ts"],
4
- "mappings": "AAGA,OAAO,UAAU;AACjB,SAAS,eAAe;AAkBjB,MAAM,sBAAsB,QAAQ;AAAA,EAMzC,YAAY,MAAwC,MAAgC;AAClF,UAAM,UAAU,OAAO,SAAS,WAAW,OAAO;AAClD,UAAM,SAAS,OAAO,SAAS,WAAW,OAAO;AAEjD,QAAI,UAAU,MAAM;AAClB,aAAO,WAAW,wBAAwB,SAAS,KAAK,UAAU,MAAM,CAAC;AAAA,IAC3E,OAAO;AACL,YAAM,WAAW,oBAAoB;AAAA,IACvC;AACA,SAAK,OAAO;AAAA,EACd;AACF;",
5
- "names": []
6
- }
1
+ {"version":3,"file":"argument-error.js","sourceRoot":"","sources":["../../src/errors/argument-error.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,iCAAiC;AACjC,qCAAqC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,aAAc,SAAQ,OAAO;IAMxC,YAAY,IAAsC,EAAE,IAA8B;QAChF,MAAM,OAAO,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5D,MAAM,MAAM,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAEtD,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACnB,KAAK,CAAC,CAAC,OAAO,IAAI,YAAY,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QACrE,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,OAAO,IAAI,YAAY,CAAC,CAAC;QACjC,CAAC;QACD,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF"}
@@ -1,28 +1,28 @@
1
1
  import { SdError } from "./sd-error";
2
2
  /**
3
- * Not implemented error
3
+ * 미구현 오류
4
4
  *
5
- * An error thrown when a feature that has not yet been implemented is called.
6
- * Used for abstract method stubs, branches planned for future implementation, etc.
5
+ * 아직 구현되지 않은 기능이 호출되었을 발생하는 에러.
6
+ * 추상 메서드 스텁, 향후 구현 예정인 분기 등에 사용된다.
7
7
  *
8
8
  * @example
9
- * // Before abstract method implementation
9
+ * // 추상 메서드 구현
10
10
  * class BaseService {
11
11
  * process(): void {
12
- * throw new NotImplementedError("Implementation required in subclass");
12
+ * throw new NotImplementedError("서브클래스에서 구현 필요");
13
13
  * }
14
14
  * }
15
15
  *
16
16
  * @example
17
- * // Branch planned for future implementation
17
+ * // 향후 구현 예정인 분기
18
18
  * switch (type) {
19
19
  * case "A": return handleA();
20
- * case "B": throw new NotImplementedError(`Handling for type ${type}`);
20
+ * case "B": throw new NotImplementedError(`타입 ${type} 처리`);
21
21
  * }
22
22
  */
23
23
  export declare class NotImplementedError extends SdError {
24
24
  /**
25
- * @param message Additional description message
25
+ * @param message 추가 설명 메시지
26
26
  */
27
27
  constructor(message?: string);
28
28
  }
@@ -1,14 +1,32 @@
1
1
  import { SdError } from "./sd-error.js";
2
- class NotImplementedError extends SdError {
3
- /**
4
- * @param message Additional description message
5
- */
6
- constructor(message) {
7
- super("Not implemented" + (message != null ? ": " + message : ""));
8
- this.name = "NotImplementedError";
9
- }
2
+ /**
3
+ * 미구현 오류
4
+ *
5
+ * 아직 구현되지 않은 기능이 호출되었을 때 발생하는 에러.
6
+ * 추상 메서드 스텁, 향후 구현 예정인 분기 등에 사용된다.
7
+ *
8
+ * @example
9
+ * // 추상 메서드 구현 전
10
+ * class BaseService {
11
+ * process(): void {
12
+ * throw new NotImplementedError("서브클래스에서 구현 필요");
13
+ * }
14
+ * }
15
+ *
16
+ * @example
17
+ * // 향후 구현 예정인 분기
18
+ * switch (type) {
19
+ * case "A": return handleA();
20
+ * case "B": throw new NotImplementedError(`타입 ${type} 처리`);
21
+ * }
22
+ */
23
+ export class NotImplementedError extends SdError {
24
+ /**
25
+ * @param message 추가 설명 메시지
26
+ */
27
+ constructor(message) {
28
+ super("미구현" + (message != null ? ": " + message : ""));
29
+ this.name = "NotImplementedError";
30
+ }
10
31
  }
11
- export {
12
- NotImplementedError
13
- };
14
- //# sourceMappingURL=not-implemented-error.js.map
32
+ //# sourceMappingURL=not-implemented-error.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/errors/not-implemented-error.ts"],
4
- "mappings": "AAAA,SAAS,eAAe;AAuBjB,MAAM,4BAA4B,QAAQ;AAAA;AAAA;AAAA;AAAA,EAI/C,YAAY,SAAkB;AAC5B,UAAM,qBAAqB,WAAW,OAAO,OAAO,UAAU,GAAG;AACjE,SAAK,OAAO;AAAA,EACd;AACF;",
5
- "names": []
6
- }
1
+ {"version":3,"file":"not-implemented-error.js","sourceRoot":"","sources":["../../src/errors/not-implemented-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,mBAAoB,SAAQ,OAAO;IAC9C;;OAEG;IACH,YAAY,OAAgB;QAC1B,KAAK,CAAC,KAAK,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF"}
@@ -1,26 +1,26 @@
1
1
  /**
2
- * Error class supporting Tree structure composition
3
- * Utilizes ES2024 cause property
2
+ * 트리 구조 조합을 지원하는 에러 클래스
3
+ * ES2024 cause 속성을 활용
4
4
  *
5
5
  * @example
6
- * // Wrap a cause error
6
+ * // 원인 에러를 감싸기
7
7
  * try {
8
8
  * await fetch(url);
9
9
  * } catch (err) {
10
- * throw new SdError(err, "API call failed", "User load failed");
10
+ * throw new SdError(err, "API 호출 실패", "사용자 로드 실패");
11
11
  * }
12
- * // Result message: "User load failed => API call failed => original error message"
12
+ * // 결과 메시지: "사용자 로드 실패 => API 호출 실패 => 원본 에러 메시지"
13
13
  *
14
14
  * @example
15
- * // Create with message only
16
- * throw new SdError("invalid state", "processing not possible");
17
- * // Result message: "processing not possible => invalid state"
15
+ * // 메시지만으로 생성
16
+ * throw new SdError("잘못된 상태", "처리 불가");
17
+ * // 결과 메시지: "처리 불가 => 잘못된 상태"
18
18
  */
19
19
  export declare class SdError extends Error {
20
20
  cause?: Error;
21
- /** Create by wrapping a cause error. Messages are joined in reverse order (upper message => lower message => cause message) */
21
+ /** 원인 에러를 감싸서 생성. 메시지는 역순으로 결합됨 (상위 메시지 => 하위 메시지 => 원인 메시지) */
22
22
  constructor(cause: Error, ...messages: string[]);
23
- /** Create with messages only. Messages are joined in reverse order (upper message => lower message) */
23
+ /** 메시지만으로 생성. 메시지는 역순으로 결합됨 (상위 메시지 => 하위 메시지) */
24
24
  constructor(...messages: string[]);
25
25
  constructor(arg1?: unknown, ...messages: string[]);
26
26
  }