@simplysm/core-common 13.0.69 → 13.0.71
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 +66 -267
- package/dist/common.types.d.ts +14 -14
- package/dist/errors/argument-error.d.ts +10 -10
- package/dist/errors/argument-error.d.ts.map +1 -1
- package/dist/errors/argument-error.js +2 -2
- package/dist/errors/argument-error.js.map +1 -1
- package/dist/errors/not-implemented-error.d.ts +8 -8
- package/dist/errors/not-implemented-error.js +2 -2
- package/dist/errors/not-implemented-error.js.map +1 -1
- package/dist/errors/sd-error.d.ts +10 -10
- package/dist/errors/sd-error.d.ts.map +1 -1
- package/dist/errors/timeout-error.d.ts +10 -10
- package/dist/errors/timeout-error.js +3 -3
- package/dist/errors/timeout-error.js.map +1 -1
- package/dist/extensions/arr-ext.d.ts +2 -2
- package/dist/extensions/arr-ext.helpers.d.ts +8 -8
- package/dist/extensions/arr-ext.helpers.js +1 -1
- package/dist/extensions/arr-ext.helpers.js.map +1 -1
- package/dist/extensions/arr-ext.js +13 -13
- package/dist/extensions/arr-ext.js.map +1 -1
- package/dist/extensions/arr-ext.types.d.ts +57 -57
- package/dist/extensions/arr-ext.types.d.ts.map +1 -1
- package/dist/extensions/map-ext.d.ts +16 -16
- package/dist/extensions/set-ext.d.ts +11 -11
- package/dist/features/debounce-queue.d.ts +17 -15
- package/dist/features/debounce-queue.d.ts.map +1 -1
- package/dist/features/debounce-queue.js +6 -6
- package/dist/features/debounce-queue.js.map +1 -1
- package/dist/features/event-emitter.d.ts +20 -20
- package/dist/features/event-emitter.js +17 -17
- package/dist/features/serial-queue.d.ts +11 -11
- package/dist/features/serial-queue.js +5 -5
- package/dist/features/serial-queue.js.map +1 -1
- package/dist/globals.d.ts +4 -4
- package/dist/types/date-only.d.ts +64 -64
- package/dist/types/date-only.d.ts.map +1 -1
- package/dist/types/date-only.js +63 -63
- package/dist/types/date-time.d.ts +37 -37
- package/dist/types/date-time.d.ts.map +1 -1
- package/dist/types/date-time.js +54 -37
- package/dist/types/date-time.js.map +1 -1
- package/dist/types/lazy-gc-map.d.ts +26 -26
- package/dist/types/lazy-gc-map.d.ts.map +1 -1
- package/dist/types/lazy-gc-map.js +26 -26
- package/dist/types/lazy-gc-map.js.map +1 -1
- package/dist/types/time.d.ts +25 -25
- package/dist/types/time.d.ts.map +1 -1
- package/dist/types/time.js +25 -25
- package/dist/types/time.js.map +1 -1
- package/dist/types/uuid.d.ts +11 -11
- package/dist/types/uuid.d.ts.map +1 -1
- package/dist/types/uuid.js +12 -12
- package/dist/types/uuid.js.map +1 -1
- package/dist/utils/bytes.d.ts +17 -17
- package/dist/utils/bytes.js +4 -4
- package/dist/utils/bytes.js.map +1 -1
- package/dist/utils/date-format.d.ts +45 -45
- package/dist/utils/date-format.js +1 -1
- package/dist/utils/date-format.js.map +1 -1
- package/dist/utils/error.d.ts +4 -4
- package/dist/utils/json.d.ts +17 -17
- package/dist/utils/json.js +3 -3
- package/dist/utils/json.js.map +1 -1
- package/dist/utils/num.d.ts +23 -23
- package/dist/utils/obj.d.ts +111 -111
- package/dist/utils/obj.d.ts.map +1 -1
- package/dist/utils/obj.js +3 -3
- package/dist/utils/obj.js.map +1 -1
- package/dist/utils/path.d.ts +10 -10
- package/dist/utils/primitive.d.ts +5 -5
- package/dist/utils/primitive.js +1 -1
- package/dist/utils/primitive.js.map +1 -1
- package/dist/utils/str.d.ts +46 -46
- package/dist/utils/str.d.ts.map +1 -1
- package/dist/utils/str.js +5 -5
- package/dist/utils/str.js.map +1 -1
- package/dist/utils/template-strings.d.ts +26 -26
- package/dist/utils/transferable.d.ts +18 -18
- package/dist/utils/transferable.js +1 -1
- package/dist/utils/transferable.js.map +1 -1
- package/dist/utils/wait.d.ts +9 -9
- package/dist/utils/xml.d.ts +13 -13
- package/dist/utils/xml.d.ts.map +1 -1
- package/dist/utils/xml.js +1 -0
- package/dist/utils/xml.js.map +1 -1
- package/dist/zip/sd-zip.d.ts +22 -22
- package/dist/zip/sd-zip.js +16 -16
- package/package.json +4 -4
- package/src/common.types.ts +17 -17
- package/src/errors/argument-error.ts +15 -15
- package/src/errors/not-implemented-error.ts +9 -9
- package/src/errors/sd-error.ts +12 -12
- package/src/errors/timeout-error.ts +12 -12
- package/src/extensions/arr-ext.helpers.ts +10 -10
- package/src/extensions/arr-ext.ts +57 -57
- package/src/extensions/arr-ext.types.ts +59 -59
- package/src/extensions/map-ext.ts +16 -16
- package/src/extensions/set-ext.ts +11 -11
- package/src/features/debounce-queue.ts +21 -19
- package/src/features/event-emitter.ts +25 -25
- package/src/features/serial-queue.ts +13 -13
- package/src/globals.ts +4 -4
- package/src/index.ts +1 -1
- package/src/types/date-only.ts +83 -83
- package/src/types/date-time.ts +64 -44
- package/src/types/lazy-gc-map.ts +45 -45
- package/src/types/time.ts +34 -34
- package/src/types/uuid.ts +17 -17
- package/src/utils/bytes.ts +35 -35
- package/src/utils/date-format.ts +65 -65
- package/src/utils/error.ts +4 -4
- package/src/utils/json.ts +39 -39
- package/src/utils/num.ts +23 -23
- package/src/utils/obj.ts +138 -138
- package/src/utils/path.ts +10 -10
- package/src/utils/primitive.ts +6 -6
- package/src/utils/str.ts +260 -261
- package/src/utils/template-strings.ts +29 -29
- package/src/utils/transferable.ts +284 -284
- package/src/utils/wait.ts +10 -10
- package/src/utils/xml.ts +20 -19
- package/src/zip/sd-zip.ts +25 -25
- package/tests/errors/errors.spec.ts +80 -0
- package/tests/extensions/array-extension.spec.ts +796 -0
- package/tests/extensions/map-extension.spec.ts +147 -0
- package/tests/extensions/set-extension.spec.ts +74 -0
- package/tests/types/date-only.spec.ts +638 -0
- package/tests/types/date-time.spec.ts +391 -0
- package/tests/types/lazy-gc-map.spec.ts +692 -0
- package/tests/types/time.spec.ts +559 -0
- package/tests/types/uuid.spec.ts +74 -0
- package/tests/utils/bytes-utils.spec.ts +230 -0
- package/tests/utils/date-format.spec.ts +373 -0
- package/tests/utils/debounce-queue.spec.ts +272 -0
- package/tests/utils/json.spec.ts +486 -0
- package/tests/utils/number.spec.ts +157 -0
- package/tests/utils/object.spec.ts +829 -0
- package/tests/utils/path.spec.ts +78 -0
- package/tests/utils/primitive.spec.ts +43 -0
- package/tests/utils/sd-event-emitter.spec.ts +216 -0
- package/tests/utils/serial-queue.spec.ts +365 -0
- package/tests/utils/string.spec.ts +281 -0
- package/tests/utils/template-strings.spec.ts +57 -0
- package/tests/utils/transferable.spec.ts +703 -0
- package/tests/utils/wait.spec.ts +145 -0
- package/tests/utils/xml.spec.ts +146 -0
- package/tests/zip/sd-zip.spec.ts +238 -0
- package/docs/extensions.md +0 -503
- package/docs/features.md +0 -109
- package/docs/types.md +0 -486
- package/docs/utils.md +0 -780
package/dist/utils/path.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Node.js path
|
|
2
|
+
* Path utility functions
|
|
3
|
+
* Replacement for Node.js path module (supports browser environments)
|
|
4
4
|
*
|
|
5
|
-
* @note
|
|
6
|
-
* Windows
|
|
7
|
-
*
|
|
5
|
+
* @note This utility supports POSIX style paths (slash `/`) only.
|
|
6
|
+
* Windows backslash (`\`) paths are not supported.
|
|
7
|
+
* Designed for browser environments and Capacitor plugins.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @note POSIX
|
|
10
|
+
* Combine paths (path.join replacement)
|
|
11
|
+
* @note Supports POSIX style paths only (slash `/`)
|
|
12
12
|
*/
|
|
13
13
|
export declare function pathJoin(...segments: string[]): string;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Extract filename (path.basename replacement)
|
|
16
16
|
*/
|
|
17
17
|
export declare function pathBasename(filePath: string, ext?: string): string;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @note
|
|
19
|
+
* Extract file extension (path.extname replacement)
|
|
20
|
+
* @note Hidden files (e.g., `.gitignore`) return empty string (same as Node.js path.extname)
|
|
21
21
|
*/
|
|
22
22
|
export declare function pathExtname(filePath: string): string;
|
|
23
23
|
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { PrimitiveTypeMap, PrimitiveTypeStr } from "../common.types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Infer PrimitiveTypeStr from a value
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* Checks the type of a value at runtime and returns the corresponding PrimitiveTypeStr.
|
|
6
6
|
*
|
|
7
|
-
* @param value
|
|
8
|
-
* @returns
|
|
9
|
-
* @throws ArgumentError
|
|
7
|
+
* @param value The value to infer the type from
|
|
8
|
+
* @returns The PrimitiveTypeStr corresponding to the value
|
|
9
|
+
* @throws ArgumentError If the type is not supported
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* getPrimitiveTypeStr("hello") // "string"
|
package/dist/utils/primitive.js
CHANGED
|
@@ -12,7 +12,7 @@ function getPrimitiveTypeStr(value) {
|
|
|
12
12
|
if (value instanceof Time) return "Time";
|
|
13
13
|
if (value instanceof Uuid) return "Uuid";
|
|
14
14
|
if (value instanceof Uint8Array) return "Bytes";
|
|
15
|
-
throw new ArgumentError("
|
|
15
|
+
throw new ArgumentError("Unknown value type.", { type: typeof value });
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
18
|
getPrimitiveTypeStr
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/primitive.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAkBvB,SAAS,oBAAoB,OAA6D;AAC/F,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,OAAO,UAAU,UAAW,QAAO;AACvC,MAAI,iBAAiB,SAAU,QAAO;AACtC,MAAI,iBAAiB,SAAU,QAAO;AACtC,MAAI,iBAAiB,KAAM,QAAO;AAClC,MAAI,iBAAiB,KAAM,QAAO;AAClC,MAAI,iBAAiB,WAAY,QAAO;AACxC,QAAM,IAAI,cAAc,
|
|
4
|
+
"mappings": "AAAA,SAAS,gBAAgB;AACzB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAkBvB,SAAS,oBAAoB,OAA6D;AAC/F,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,OAAO,UAAU,SAAU,QAAO;AACtC,MAAI,OAAO,UAAU,UAAW,QAAO;AACvC,MAAI,iBAAiB,SAAU,QAAO;AACtC,MAAI,iBAAiB,SAAU,QAAO;AACtC,MAAI,iBAAiB,KAAM,QAAO;AAClC,MAAI,iBAAiB,KAAM,QAAO;AAClC,MAAI,iBAAiB,WAAY,QAAO;AACxC,QAAM,IAAI,cAAc,uBAAuB,EAAE,MAAM,OAAO,MAAM,CAAC;AACvE;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/utils/str.d.ts
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* String utility functions
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param text
|
|
7
|
-
* @param type
|
|
8
|
-
* - `"을"`: 을/를
|
|
9
|
-
* - `"은"`: 은/는
|
|
10
|
-
* - `"이"`: 이/가
|
|
11
|
-
* - `"와"`: 과/와
|
|
12
|
-
* - `"랑"`: 이랑/랑
|
|
13
|
-
* - `"로"`: 으로/로
|
|
14
|
-
* - `"라"`: 이라/라
|
|
5
|
+
* Return the appropriate Korean particle based on the final consonant
|
|
6
|
+
* @param text The text to check
|
|
7
|
+
* @param type The particle type
|
|
8
|
+
* - `"을"`: 을/를 (eul/reul - object particle)
|
|
9
|
+
* - `"은"`: 은/는 (eun/neun - subject particle)
|
|
10
|
+
* - `"이"`: 이/가 (i/ga - subject particle)
|
|
11
|
+
* - `"와"`: 과/와 (gwa/wa - and particle)
|
|
12
|
+
* - `"랑"`: 이랑/랑 (irang/rang - and particle)
|
|
13
|
+
* - `"로"`: 으로/로 (euro/ro - instrumental particle)
|
|
14
|
+
* - `"라"`: 이라/라 (ira/ra - copula particle)
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* koreanGetSuffix("Apple", "을") // "를"
|
|
18
|
+
* koreanGetSuffix("책", "이") // "이"
|
|
19
19
|
*/
|
|
20
|
-
export declare function
|
|
20
|
+
export declare function koreanGetSuffix(text: string, type: "을" | "은" | "이" | "와" | "랑" | "로" | "라"): string;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Convert full-width characters to half-width characters
|
|
23
23
|
*
|
|
24
|
-
*
|
|
25
|
-
* -
|
|
26
|
-
* -
|
|
27
|
-
* -
|
|
28
|
-
* -
|
|
29
|
-
* -
|
|
24
|
+
* Conversion targets:
|
|
25
|
+
* - Full-width uppercase letters (A-Z → A-Z)
|
|
26
|
+
* - Full-width lowercase letters (a-z → a-z)
|
|
27
|
+
* - Full-width digits (0-9 → 0-9)
|
|
28
|
+
* - Full-width space ( → regular space)
|
|
29
|
+
* - Full-width parentheses (() → ())
|
|
30
30
|
*
|
|
31
31
|
* @example
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* strReplaceFullWidth("A123") // "A123"
|
|
33
|
+
* strReplaceFullWidth("(株)") // "(株)"
|
|
34
34
|
*/
|
|
35
35
|
export declare function strReplaceFullWidth(str: string): string;
|
|
36
36
|
/**
|
|
37
|
-
* PascalCase
|
|
37
|
+
* Convert to PascalCase
|
|
38
38
|
* @example "hello-world" → "HelloWorld"
|
|
39
39
|
* @example "hello_world" → "HelloWorld"
|
|
40
40
|
* @example "hello.world" → "HelloWorld"
|
|
41
41
|
*/
|
|
42
42
|
export declare function strToPascalCase(str: string): string;
|
|
43
43
|
/**
|
|
44
|
-
* camelCase
|
|
44
|
+
* Convert to camelCase
|
|
45
45
|
* @example "hello-world" → "helloWorld"
|
|
46
46
|
* @example "hello_world" → "helloWorld"
|
|
47
47
|
* @example "HelloWorld" → "helloWorld"
|
|
48
48
|
*/
|
|
49
49
|
export declare function strToCamelCase(str: string): string;
|
|
50
50
|
/**
|
|
51
|
-
* kebab-case
|
|
51
|
+
* Convert to kebab-case
|
|
52
52
|
*
|
|
53
53
|
* @example "HelloWorld" → "hello-world"
|
|
54
54
|
* @example "helloWorld" → "hello-world"
|
|
55
|
-
* @example "hello_world" → "hello_world" (
|
|
56
|
-
* @example "Hello_World" → "hello-_world" (
|
|
57
|
-
* @example "Hello-World" → "hello--world" (
|
|
58
|
-
* @example "XMLParser" → "x-m-l-parser" (
|
|
55
|
+
* @example "hello_world" → "hello_world" (no conversion if only lowercase)
|
|
56
|
+
* @example "Hello_World" → "hello-_world" (existing separators are preserved)
|
|
57
|
+
* @example "Hello-World" → "hello--world" (existing separators are preserved)
|
|
58
|
+
* @example "XMLParser" → "x-m-l-parser" (consecutive uppercase letters are separated)
|
|
59
59
|
*/
|
|
60
60
|
export declare function strToKebabCase(str: string): string;
|
|
61
61
|
/**
|
|
62
|
-
* snake_case
|
|
62
|
+
* Convert to snake_case
|
|
63
63
|
*
|
|
64
64
|
* @example "HelloWorld" → "hello_world"
|
|
65
65
|
* @example "helloWorld" → "hello_world"
|
|
66
|
-
* @example "hello-world" → "hello-world" (
|
|
67
|
-
* @example "Hello-World" → "hello_-world" (
|
|
68
|
-
* @example "Hello_World" → "hello__world" (
|
|
69
|
-
* @example "XMLParser" → "x_m_l_parser" (
|
|
66
|
+
* @example "hello-world" → "hello-world" (no conversion if only lowercase)
|
|
67
|
+
* @example "Hello-World" → "hello_-world" (existing separators are preserved)
|
|
68
|
+
* @example "Hello_World" → "hello__world" (existing separators are preserved)
|
|
69
|
+
* @example "XMLParser" → "x_m_l_parser" (consecutive uppercase letters are separated)
|
|
70
70
|
*/
|
|
71
71
|
export declare function strToSnakeCase(str: string): string;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Check if string is undefined or empty (type guard)
|
|
74
74
|
*
|
|
75
|
-
* @param str
|
|
76
|
-
* @returns undefined, null,
|
|
75
|
+
* @param str The string to check
|
|
76
|
+
* @returns true if undefined, null, or empty string
|
|
77
77
|
*
|
|
78
78
|
* @example
|
|
79
79
|
* const name: string | undefined = getValue();
|
|
80
80
|
* if (strIsNullOrEmpty(name)) {
|
|
81
81
|
* // name: "" | undefined
|
|
82
|
-
* console.log("
|
|
82
|
+
* console.log("Name is empty");
|
|
83
83
|
* } else {
|
|
84
|
-
* // name: string (
|
|
85
|
-
* console.log(
|
|
84
|
+
* // name: string (non-empty string)
|
|
85
|
+
* console.log(`Name: ${name}`);
|
|
86
86
|
* }
|
|
87
87
|
*/
|
|
88
88
|
export declare function strIsNullOrEmpty(str: string | undefined): str is "" | undefined;
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
90
|
+
* Insert a string at a specific position
|
|
91
91
|
*
|
|
92
|
-
* @param str
|
|
93
|
-
* @param index
|
|
94
|
-
* @param insertString
|
|
95
|
-
* @returns
|
|
92
|
+
* @param str The original string
|
|
93
|
+
* @param index The position to insert at (0-based)
|
|
94
|
+
* @param insertString The string to insert
|
|
95
|
+
* @returns A new string with the insertion applied
|
|
96
96
|
*
|
|
97
97
|
* @example
|
|
98
98
|
* strInsert("Hello World", 5, ","); // "Hello, World"
|
package/dist/utils/str.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"str.d.ts","sourceRoot":"","sources":["../../src/utils/str.ts"],"names":[],"mappings":"AAAA;;GAEG;AAeH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"str.d.ts","sourceRoot":"","sources":["../../src/utils/str.ts"],"names":[],"mappings":"AAAA;;GAEG;AAeH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAC5C,MAAM,CAwBR;AA8ED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAMD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAInD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIlD;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAYD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,IAAI,EAAE,GAAG,SAAS,CAE/E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAElF"}
|
package/dist/utils/str.js
CHANGED
|
@@ -7,7 +7,7 @@ const suffixTable = {
|
|
|
7
7
|
\uB85C: { t: "\uC73C\uB85C", f: "\uB85C" },
|
|
8
8
|
\uB77C: { t: "\uC774\uB77C", f: "\uB77C" }
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function koreanGetSuffix(text, type) {
|
|
11
11
|
const table = suffixTable;
|
|
12
12
|
if (text.length === 0) {
|
|
13
13
|
return table[type].f;
|
|
@@ -23,7 +23,7 @@ function strGetSuffix(text, type) {
|
|
|
23
23
|
}
|
|
24
24
|
return hasLast ? table[type].t : table[type].f;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const fullWidthCharMap = {
|
|
27
27
|
"\uFF21": "A",
|
|
28
28
|
"\uFF22": "B",
|
|
29
29
|
"\uFF23": "C",
|
|
@@ -90,9 +90,9 @@ const specialCharMap = {
|
|
|
90
90
|
"\uFF09": ")",
|
|
91
91
|
"\uFF08": "("
|
|
92
92
|
};
|
|
93
|
-
const
|
|
93
|
+
const fullWidthCharRegex = new RegExp(`[${Object.keys(fullWidthCharMap).join("")}]`, "g");
|
|
94
94
|
function strReplaceFullWidth(str) {
|
|
95
|
-
return str.replace(
|
|
95
|
+
return str.replace(fullWidthCharRegex, (char) => fullWidthCharMap[char] ?? char);
|
|
96
96
|
}
|
|
97
97
|
function strToPascalCase(str) {
|
|
98
98
|
return str.replace(/[-._][a-z]/g, (m) => m[1].toUpperCase()).replace(/^[a-z]/, (m) => m.toUpperCase());
|
|
@@ -116,7 +116,7 @@ function strInsert(str, index, insertString) {
|
|
|
116
116
|
return str.substring(0, index) + insertString + str.substring(index);
|
|
117
117
|
}
|
|
118
118
|
export {
|
|
119
|
-
|
|
119
|
+
koreanGetSuffix,
|
|
120
120
|
strInsert,
|
|
121
121
|
strIsNullOrEmpty,
|
|
122
122
|
strReplaceFullWidth,
|
package/dist/utils/str.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/str.ts"],
|
|
4
|
-
"mappings": "AAOA,MAAM,cAAc;AAAA,EAClB,QAAG,EAAE,GAAG,UAAK,GAAG,SAAI;AAAA,EACpB,QAAG,EAAE,GAAG,UAAK,GAAG,SAAI;AAAA,EACpB,QAAG,EAAE,GAAG,UAAK,GAAG,SAAI;AAAA,EACpB,QAAG,EAAE,GAAG,UAAK,GAAG,SAAI;AAAA,EACpB,QAAG,EAAE,GAAG,gBAAM,GAAG,SAAI;AAAA,EACrB,QAAG,EAAE,GAAG,gBAAM,GA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C,MAAM,EAAE,CAAC,EAAE,YAAY,CAAC,EAChD,QAAQ,UAAU,CAAC,MAAM,EAAE,YAAY,CAAC;AAC7C;AAYO,SAAS,eAAe,KAAqB;AAClD,SAAO,oBAAoB,KAAK,GAAG;AACrC;AAYO,SAAS,eAAe,KAAqB;AAClD,SAAO,oBAAoB,KAAK,GAAG;AACrC;AAEA,SAAS,oBAAoB,KAAa,WAA2B;AACnE,SAAO,IACJ,QAAQ,UAAU,CAAC,MAAM,EAAE,YAAY,CAAC,EACxC,QAAQ,eAAe,CAAC,MAAM,YAAY,EAAE,YAAY,CAAC;AAC9D;AAsBO,SAAS,iBAAiB,KAAgD;AAC/E,SAAO,OAAO,QAAQ,QAAQ;AAChC;AAeO,SAAS,UAAU,KAAa,OAAe,cAA8B;AAClF,SAAO,IAAI,UAAU,GAAG,KAAK,IAAI,eAAe,IAAI,UAAU,KAAK;AACrE;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* IDE
|
|
2
|
+
* Template string tag functions
|
|
3
|
+
* For IDE code highlighting support (actual behavior is string concatenation + indent normalization)
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* @param strings
|
|
8
|
-
* @param values
|
|
9
|
-
* @returns
|
|
6
|
+
* Template tag for JavaScript code highlighting
|
|
7
|
+
* @param strings Template string array
|
|
8
|
+
* @param values Interpolated values
|
|
9
|
+
* @returns String with normalized indentation
|
|
10
10
|
* @example
|
|
11
11
|
* const code = js`
|
|
12
12
|
* function hello() {
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function js(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @param strings
|
|
21
|
-
* @param values
|
|
22
|
-
* @returns
|
|
19
|
+
* Template tag for TypeScript code highlighting
|
|
20
|
+
* @param strings Template string array
|
|
21
|
+
* @param values Interpolated values
|
|
22
|
+
* @returns String with normalized indentation
|
|
23
23
|
* @example
|
|
24
24
|
* const code = ts`
|
|
25
25
|
* interface User {
|
|
@@ -30,10 +30,10 @@ export declare function js(strings: TemplateStringsArray, ...values: unknown[]):
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function ts(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
* @param strings
|
|
35
|
-
* @param values
|
|
36
|
-
* @returns
|
|
33
|
+
* Template tag for HTML markup highlighting
|
|
34
|
+
* @param strings Template string array
|
|
35
|
+
* @param values Interpolated values
|
|
36
|
+
* @returns String with normalized indentation
|
|
37
37
|
* @example
|
|
38
38
|
* const markup = html`
|
|
39
39
|
* <div class="container">
|
|
@@ -43,10 +43,10 @@ export declare function ts(strings: TemplateStringsArray, ...values: unknown[]):
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function html(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
45
45
|
/**
|
|
46
|
-
* MSSQL T-SQL
|
|
47
|
-
* @param strings
|
|
48
|
-
* @param values
|
|
49
|
-
* @returns
|
|
46
|
+
* Template tag for MSSQL T-SQL highlighting
|
|
47
|
+
* @param strings Template string array
|
|
48
|
+
* @param values Interpolated values
|
|
49
|
+
* @returns String with normalized indentation
|
|
50
50
|
* @example
|
|
51
51
|
* const query = tsql`
|
|
52
52
|
* SELECT TOP 10 *
|
|
@@ -56,10 +56,10 @@ export declare function html(strings: TemplateStringsArray, ...values: unknown[]
|
|
|
56
56
|
*/
|
|
57
57
|
export declare function tsql(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
58
58
|
/**
|
|
59
|
-
* MySQL SQL
|
|
60
|
-
* @param strings
|
|
61
|
-
* @param values
|
|
62
|
-
* @returns
|
|
59
|
+
* Template tag for MySQL SQL highlighting
|
|
60
|
+
* @param strings Template string array
|
|
61
|
+
* @param values Interpolated values
|
|
62
|
+
* @returns String with normalized indentation
|
|
63
63
|
* @example
|
|
64
64
|
* const query = mysql`
|
|
65
65
|
* SELECT *
|
|
@@ -69,10 +69,10 @@ export declare function tsql(strings: TemplateStringsArray, ...values: unknown[]
|
|
|
69
69
|
*/
|
|
70
70
|
export declare function mysql(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
71
71
|
/**
|
|
72
|
-
* PostgreSQL SQL
|
|
73
|
-
* @param strings
|
|
74
|
-
* @param values
|
|
75
|
-
* @returns
|
|
72
|
+
* Template tag for PostgreSQL SQL highlighting
|
|
73
|
+
* @param strings Template string array
|
|
74
|
+
* @param values Interpolated values
|
|
75
|
+
* @returns String with normalized indentation
|
|
76
76
|
* @example
|
|
77
77
|
* const query = pgsql`
|
|
78
78
|
* SELECT *
|
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Object types that can be transferred between Workers
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Only ArrayBuffer is used in this code.
|
|
5
5
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Transferable_objects
|
|
6
6
|
*/
|
|
7
7
|
type Transferable = ArrayBuffer;
|
|
8
8
|
/**
|
|
9
|
-
* Transferable
|
|
9
|
+
* Transferable conversion utility functions
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Performs serialization/deserialization for data transfer between Workers.
|
|
12
|
+
* Handles custom types that structuredClone does not support.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* Supported types:
|
|
15
15
|
* - Date, DateTime, DateOnly, Time, Uuid, RegExp
|
|
16
|
-
* - Error (cause, code, detail
|
|
17
|
-
* - Uint8Array (
|
|
18
|
-
* - Array, Map, Set,
|
|
16
|
+
* - Error (including cause, code, detail)
|
|
17
|
+
* - Uint8Array (other TypedArrays not supported, handled as plain objects)
|
|
18
|
+
* - Array, Map, Set, plain objects
|
|
19
19
|
*
|
|
20
|
-
* @note
|
|
21
|
-
* @note
|
|
20
|
+
* @note Circular references cause TypeError in transferableEncode (includes path info)
|
|
21
|
+
* @note If the same object is referenced from multiple places, the cached encoding result is reused
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
|
-
* //
|
|
24
|
+
* // Send data to Worker
|
|
25
25
|
* const { result, transferList } = transferableEncode(data);
|
|
26
26
|
* worker.postMessage(result, transferList);
|
|
27
27
|
*
|
|
28
|
-
* //
|
|
28
|
+
* // Receive data from Worker
|
|
29
29
|
* const decoded = transferableDecode(event.data);
|
|
30
30
|
*/
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* Convert objects using Simplysm types to plain objects
|
|
33
|
+
* Serializes in a form that can be sent to a Worker
|
|
34
34
|
*
|
|
35
|
-
* @throws
|
|
35
|
+
* @throws TypeError if circular reference is detected
|
|
36
36
|
*/
|
|
37
37
|
export declare function transferableEncode(obj: unknown): {
|
|
38
38
|
result: unknown;
|
|
39
39
|
transferList: Transferable[];
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
42
|
+
* Convert serialized objects to objects using Simplysm types
|
|
43
|
+
* Deserialize data received from a Worker
|
|
44
44
|
*/
|
|
45
45
|
export declare function transferableDecode(obj: unknown): unknown;
|
|
46
46
|
export {};
|
|
@@ -14,7 +14,7 @@ function encodeImpl(obj, transferList, path, ancestors, cache) {
|
|
|
14
14
|
if (typeof obj === "object") {
|
|
15
15
|
if (ancestors.has(obj)) {
|
|
16
16
|
const currentPath = path.length > 0 ? path.join(".") : "root";
|
|
17
|
-
throw new TypeError(
|
|
17
|
+
throw new TypeError(`Circular reference detected: ${currentPath}`);
|
|
18
18
|
}
|
|
19
19
|
const cached = cache.get(obj);
|
|
20
20
|
if (cached !== void 0) return cached;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/transferable.ts"],
|
|
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,mBAAmB,IAAI,CAAC;AAAA,EACnD;AAGA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAsB;AACzC,eAAW,CAAC,GAAG,CAAC,KAAK,KAAK;AACxB,aAAO,IAAI,mBAAmB,CAAC,GAAG,mBAAmB,CAAC,CAAC;AAAA,IACzD;AACA,WAAO;AAAA,EACT;AAGA,MAAI,eAAe,KAAK;AACtB,UAAM,SAAS,oBAAI,IAAa;AAChC,eAAW,KAAK,KAAK;AACnB,aAAO,IAAI,mBAAmB,CAAC,CAAC;AAAA,IAClC;AACA,WAAO;AAAA,EACT;AAGA,MAAI,OAAO,QAAQ,UAAU;AAC3B,UAAM,SAAS;AACf,UAAM,SAAkC,CAAC;AACzC,eAAW,OAAO,OAAO,KAAK,MAAM,GAAG;AACrC,aAAO,GAAG,IAAI,mBAAmB,OAAO,GAAG,CAAC;AAAA,IAC9C;AACA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/utils/wait.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param forwarder
|
|
4
|
-
* @param milliseconds
|
|
5
|
-
* @param maxCount
|
|
2
|
+
* Wait until a condition becomes true
|
|
3
|
+
* @param forwarder Condition function
|
|
4
|
+
* @param milliseconds Check interval (default: 100ms)
|
|
5
|
+
* @param maxCount Maximum number of attempts (undefined for unlimited)
|
|
6
6
|
*
|
|
7
|
-
* @note
|
|
7
|
+
* @note Returns immediately if the condition is true on the first call.
|
|
8
8
|
* @example
|
|
9
|
-
* // maxCount=3:
|
|
9
|
+
* // maxCount=3: checks condition up to 3 times, throws TimeoutError if all are false
|
|
10
10
|
* await waitUntil(() => someCondition, 100, 3);
|
|
11
|
-
* @throws TimeoutError
|
|
11
|
+
* @throws TimeoutError when maximum number of attempts is exceeded
|
|
12
12
|
*/
|
|
13
13
|
export declare function waitUntil(forwarder: () => boolean | Promise<boolean>, milliseconds?: number, maxCount?: number): Promise<void>;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @param millisecond
|
|
15
|
+
* Wait for a specified amount of time
|
|
16
|
+
* @param millisecond Wait time (ms)
|
|
17
17
|
*/
|
|
18
18
|
export declare function waitTime(millisecond: number): Promise<void>;
|
|
19
19
|
//# sourceMappingURL=wait.d.ts.map
|
package/dist/utils/xml.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* XML
|
|
2
|
+
* XML conversion utility
|
|
3
3
|
*/
|
|
4
4
|
import type { XmlBuilderOptions } from "fast-xml-parser";
|
|
5
5
|
/**
|
|
6
|
-
* XML
|
|
7
|
-
* @param str XML
|
|
8
|
-
* @param options
|
|
9
|
-
* @param options.stripTagPrefix
|
|
10
|
-
* @returns
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
6
|
+
* Parse XML string into an object
|
|
7
|
+
* @param str XML string
|
|
8
|
+
* @param options Options
|
|
9
|
+
* @param options.stripTagPrefix Whether to remove tag prefix (namespace)
|
|
10
|
+
* @returns Parsed object. Structure:
|
|
11
|
+
* - Attributes: grouped in `$` object
|
|
12
|
+
* - Text nodes: stored in `_` key
|
|
13
|
+
* - Child elements: converted to array (except root element)
|
|
14
14
|
* @example
|
|
15
15
|
* xmlParse('<root id="1"><item>hello</item></root>');
|
|
16
16
|
* // { root: { $: { id: "1" }, item: [{ _: "hello" }] } }
|
|
@@ -19,10 +19,10 @@ export declare function xmlParse(str: string, options?: {
|
|
|
19
19
|
stripTagPrefix?: boolean;
|
|
20
20
|
}): unknown;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
* @param obj
|
|
24
|
-
* @param options fast-xml-parser XmlBuilderOptions (
|
|
25
|
-
* @returns XML
|
|
22
|
+
* Serialize object to XML string
|
|
23
|
+
* @param obj Object to serialize
|
|
24
|
+
* @param options fast-xml-parser XmlBuilderOptions (optional)
|
|
25
|
+
* @returns XML string
|
|
26
26
|
* @example
|
|
27
27
|
* xmlStringify({
|
|
28
28
|
* root: {
|
package/dist/utils/xml.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xml.d.ts","sourceRoot":"","sources":["../../src/utils/xml.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKzD;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"xml.d.ts","sourceRoot":"","sources":["../../src/utils/xml.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKzD;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAcrF;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAS9E"}
|
package/dist/utils/xml.js
CHANGED
package/dist/utils/xml.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/xml.ts"],
|
|
4
|
-
"mappings": "AAIA,SAAS,YAAY,iBAAiB;AAiB/B,SAAS,SAAS,KAAa,SAAiD;AACrF,QAAM,SAAS,IAAI,UAAU;AAAA,IAC3B,kBAAkB;AAAA,IAClB,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,IACrB,qBAAqB;AAAA,IACrB,eAAe;AAAA,I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