@pawells/typescript-common 1.3.1 → 2.0.0
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 +69 -15
- package/build/array/array-chunk.d.ts +1 -1
- package/build/array/array-chunk.d.ts.map +1 -1
- package/build/array/array-chunk.js.map +1 -1
- package/build/array/array-contains.d.ts +4 -1
- package/build/array/array-contains.d.ts.map +1 -1
- package/build/array/array-contains.js +4 -0
- package/build/array/array-contains.js.map +1 -1
- package/build/array/array-count-by.d.ts +3 -1
- package/build/array/array-count-by.d.ts.map +1 -1
- package/build/array/array-count-by.js +4 -1
- package/build/array/array-count-by.js.map +1 -1
- package/build/array/array-difference.d.ts +20 -9
- package/build/array/array-difference.d.ts.map +1 -1
- package/build/array/array-difference.js +25 -8
- package/build/array/array-difference.js.map +1 -1
- package/build/array/array-filter.d.ts +3 -1
- package/build/array/array-filter.d.ts.map +1 -1
- package/build/array/array-filter.js +4 -1
- package/build/array/array-filter.js.map +1 -1
- package/build/array/array-flatten.d.ts +1 -1
- package/build/array/array-flatten.d.ts.map +1 -1
- package/build/array/array-flatten.js.map +1 -1
- package/build/array/array-group-by.d.ts +3 -1
- package/build/array/array-group-by.d.ts.map +1 -1
- package/build/array/array-group-by.js +4 -1
- package/build/array/array-group-by.js.map +1 -1
- package/build/array/array-intersection.d.ts +20 -9
- package/build/array/array-intersection.d.ts.map +1 -1
- package/build/array/array-intersection.js +30 -12
- package/build/array/array-intersection.js.map +1 -1
- package/build/array/array-partition.d.ts +3 -1
- package/build/array/array-partition.d.ts.map +1 -1
- package/build/array/array-partition.js +4 -1
- package/build/array/array-partition.js.map +1 -1
- package/build/array/array-sample.d.ts +6 -2
- package/build/array/array-sample.d.ts.map +1 -1
- package/build/array/array-sample.js +8 -6
- package/build/array/array-sample.js.map +1 -1
- package/build/array/array-shuffle.d.ts +4 -2
- package/build/array/array-shuffle.d.ts.map +1 -1
- package/build/array/array-shuffle.js +6 -3
- package/build/array/array-shuffle.js.map +1 -1
- package/build/array/array-sort-by.d.ts +1 -1
- package/build/array/array-sort-by.d.ts.map +1 -1
- package/build/array/array-sort-by.js.map +1 -1
- package/build/array/assert.d.ts +22 -18
- package/build/array/assert.d.ts.map +1 -1
- package/build/array/assert.js +27 -23
- package/build/array/assert.js.map +1 -1
- package/build/array/types.d.ts +11 -0
- package/build/array/types.d.ts.map +1 -1
- package/build/array/unique.d.ts +3 -1
- package/build/array/unique.d.ts.map +1 -1
- package/build/array/unique.js +4 -1
- package/build/array/unique.js.map +1 -1
- package/build/asserts/generic.d.ts +9 -0
- package/build/asserts/generic.d.ts.map +1 -1
- package/build/asserts/generic.js +30 -8
- package/build/asserts/generic.js.map +1 -1
- package/build/asserts/utils.d.ts +32 -0
- package/build/asserts/utils.d.ts.map +1 -1
- package/build/asserts/utils.js +79 -0
- package/build/asserts/utils.js.map +1 -1
- package/build/boolean/assert.d.ts.map +1 -1
- package/build/boolean/assert.js +2 -5
- package/build/boolean/assert.js.map +1 -1
- package/build/function/compose.d.ts +3 -2
- package/build/function/compose.d.ts.map +1 -1
- package/build/function/compose.js.map +1 -1
- package/build/function/debounce.d.ts +2 -1
- package/build/function/debounce.d.ts.map +1 -1
- package/build/function/debounce.js.map +1 -1
- package/build/function/once.d.ts +1 -0
- package/build/function/once.d.ts.map +1 -1
- package/build/function/once.js +1 -0
- package/build/function/once.js.map +1 -1
- package/build/function/throttle.d.ts +2 -1
- package/build/function/throttle.d.ts.map +1 -1
- package/build/function/throttle.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/number/assert.d.ts.map +1 -1
- package/build/number/assert.js +38 -42
- package/build/number/assert.js.map +1 -1
- package/build/object/clone.d.ts.map +1 -1
- package/build/object/clone.js +3 -0
- package/build/object/clone.js.map +1 -1
- package/build/object/equals.d.ts +1 -1
- package/build/object/equals.d.ts.map +1 -1
- package/build/object/equals.js +14 -7
- package/build/object/equals.js.map +1 -1
- package/build/object/filter-cached.js.map +1 -1
- package/build/object/filter.d.ts +7 -1
- package/build/object/filter.d.ts.map +1 -1
- package/build/object/filter.js +36 -61
- package/build/object/filter.js.map +1 -1
- package/build/object/hash.d.ts +1 -1
- package/build/object/hash.d.ts.map +1 -1
- package/build/object/hash.js +1 -0
- package/build/object/hash.js.map +1 -1
- package/build/object/key-value-pairs.d.ts +1 -1
- package/build/object/key-value-pairs.d.ts.map +1 -1
- package/build/object/key-value-pairs.js.map +1 -1
- package/build/object/omit.d.ts +1 -1
- package/build/object/omit.d.ts.map +1 -1
- package/build/object/omit.js.map +1 -1
- package/build/object/pick.d.ts +1 -1
- package/build/object/pick.d.ts.map +1 -1
- package/build/object/pick.js.map +1 -1
- package/build/object/property-paths.d.ts +2 -2
- package/build/object/property-paths.d.ts.map +1 -1
- package/build/object/property-paths.js +7 -2
- package/build/object/property-paths.js.map +1 -1
- package/build/object/security-utils.d.ts +2 -2
- package/build/object/security-utils.d.ts.map +1 -1
- package/build/object/security-utils.js.map +1 -1
- package/build/object/types.d.ts +1 -1
- package/build/object/types.d.ts.map +1 -1
- package/build/string/assert.d.ts.map +1 -1
- package/build/string/assert.js +3 -9
- package/build/string/assert.js.map +1 -1
- package/build/string/case-conversion.d.ts +53 -24
- package/build/string/case-conversion.d.ts.map +1 -1
- package/build/string/case-conversion.js +59 -29
- package/build/string/case-conversion.js.map +1 -1
- package/build/string/comparison.d.ts +20 -0
- package/build/string/comparison.d.ts.map +1 -0
- package/build/string/comparison.js +25 -0
- package/build/string/comparison.js.map +1 -0
- package/build/string/formatting.d.ts +35 -22
- package/build/string/formatting.d.ts.map +1 -1
- package/build/string/formatting.js +35 -22
- package/build/string/formatting.js.map +1 -1
- package/build/string/index.d.ts +1 -0
- package/build/string/index.d.ts.map +1 -1
- package/build/string/index.js +1 -0
- package/build/string/index.js.map +1 -1
- package/build/string/transformation.d.ts +19 -9
- package/build/string/transformation.d.ts.map +1 -1
- package/build/string/transformation.js +21 -10
- package/build/string/transformation.js.map +1 -1
- package/build/string/validation.d.ts +21 -9
- package/build/string/validation.d.ts.map +1 -1
- package/build/string/validation.js +23 -10
- package/build/string/validation.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,50 +1,79 @@
|
|
|
1
|
-
import type { TCaseConverter } from './types.js';
|
|
2
1
|
/**
|
|
3
2
|
* Converts a string to camelCase.
|
|
4
3
|
*
|
|
5
|
-
* @param value The input string
|
|
6
|
-
* @returns The camelCased string
|
|
7
|
-
*
|
|
4
|
+
* @param value - The input string
|
|
5
|
+
* @returns The camelCased string
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* CamelCase('Hello-World'); // 'helloWorld'
|
|
10
|
+
* CamelCase('hello_world'); // 'helloWorld'
|
|
11
|
+
* ```
|
|
8
12
|
*/
|
|
9
13
|
export declare function CamelCase(value: string): string;
|
|
10
14
|
/**
|
|
11
15
|
* Capitalizes the first letter of a string.
|
|
12
16
|
*
|
|
13
|
-
* @param value The input string
|
|
14
|
-
* @returns The capitalized string
|
|
15
|
-
*
|
|
17
|
+
* @param value - The input string
|
|
18
|
+
* @returns The capitalized string
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* Capitalize('hello'); // 'Hello'
|
|
23
|
+
* Capitalize('hello world'); // 'Hello world'
|
|
24
|
+
* ```
|
|
16
25
|
*/
|
|
17
|
-
export declare
|
|
26
|
+
export declare function Capitalize(value: string): string;
|
|
18
27
|
/**
|
|
19
28
|
* Converts a string to kebab-case.
|
|
20
29
|
*
|
|
21
|
-
* @param value The input string
|
|
22
|
-
* @returns The kebab-cased string
|
|
23
|
-
*
|
|
30
|
+
* @param value - The input string
|
|
31
|
+
* @returns The kebab-cased string
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* KebabCase('HelloWorld'); // 'hello-world'
|
|
36
|
+
* KebabCase('hello_world'); // 'hello-world'
|
|
37
|
+
* ```
|
|
24
38
|
*/
|
|
25
|
-
export declare
|
|
39
|
+
export declare function KebabCase(value: string): string;
|
|
26
40
|
/**
|
|
27
41
|
* Converts a string to PascalCase.
|
|
28
42
|
*
|
|
29
|
-
* @param value The input string
|
|
30
|
-
* @returns The PascalCased string
|
|
31
|
-
*
|
|
43
|
+
* @param value - The input string
|
|
44
|
+
* @returns The PascalCased string
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* PascalCase('hello-world'); // 'HelloWorld'
|
|
49
|
+
* PascalCase('hello_world'); // 'HelloWorld'
|
|
50
|
+
* ```
|
|
32
51
|
*/
|
|
33
|
-
export declare
|
|
52
|
+
export declare function PascalCase(value: string): string;
|
|
34
53
|
/**
|
|
35
54
|
* Converts a string to snake_case.
|
|
36
55
|
*
|
|
37
|
-
* @param value The input string
|
|
38
|
-
* @returns The snake_cased string
|
|
39
|
-
*
|
|
56
|
+
* @param value - The input string
|
|
57
|
+
* @returns The snake_cased string
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* SnakeCase('HelloWorld'); // 'hello_world'
|
|
62
|
+
* SnakeCase('hello-world'); // 'hello_world'
|
|
63
|
+
* ```
|
|
40
64
|
*/
|
|
41
|
-
export declare
|
|
65
|
+
export declare function SnakeCase(value: string): string;
|
|
42
66
|
/**
|
|
43
67
|
* Converts a string to SCREAMING_SNAKE_CASE.
|
|
44
68
|
*
|
|
45
|
-
* @param value The input string
|
|
46
|
-
* @returns The SCREAMING_SNAKE_CASED string
|
|
47
|
-
*
|
|
69
|
+
* @param value - The input string
|
|
70
|
+
* @returns The SCREAMING_SNAKE_CASED string
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* ScreamingSnakeCase('HelloWorld'); // 'HELLO_WORLD'
|
|
75
|
+
* ScreamingSnakeCase('hello-world'); // 'HELLO_WORLD'
|
|
76
|
+
* ```
|
|
48
77
|
*/
|
|
49
|
-
export declare
|
|
78
|
+
export declare function ScreamingSnakeCase(value: string): string;
|
|
50
79
|
//# sourceMappingURL=case-conversion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"case-conversion.d.ts","sourceRoot":"","sources":["../../src/string/case-conversion.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"case-conversion.d.ts","sourceRoot":"","sources":["../../src/string/case-conversion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAY/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMhD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYhD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExD"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Converts a string to camelCase.
|
|
3
3
|
*
|
|
4
|
-
* @param value The input string
|
|
5
|
-
* @returns The camelCased string
|
|
6
|
-
*
|
|
4
|
+
* @param value - The input string
|
|
5
|
+
* @returns The camelCased string
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* CamelCase('Hello-World'); // 'helloWorld'
|
|
10
|
+
* CamelCase('hello_world'); // 'helloWorld'
|
|
11
|
+
* ```
|
|
7
12
|
*/
|
|
8
13
|
export function CamelCase(value) {
|
|
9
14
|
if (value && typeof value === 'string') {
|
|
@@ -20,24 +25,34 @@ export function CamelCase(value) {
|
|
|
20
25
|
/**
|
|
21
26
|
* Capitalizes the first letter of a string.
|
|
22
27
|
*
|
|
23
|
-
* @param value The input string
|
|
24
|
-
* @returns The capitalized string
|
|
25
|
-
*
|
|
28
|
+
* @param value - The input string
|
|
29
|
+
* @returns The capitalized string
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* Capitalize('hello'); // 'Hello'
|
|
34
|
+
* Capitalize('hello world'); // 'Hello world'
|
|
35
|
+
* ```
|
|
26
36
|
*/
|
|
27
|
-
export
|
|
37
|
+
export function Capitalize(value) {
|
|
28
38
|
if (value && typeof value === 'string') {
|
|
29
39
|
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
30
40
|
}
|
|
31
41
|
return '';
|
|
32
|
-
}
|
|
42
|
+
}
|
|
33
43
|
/**
|
|
34
44
|
* Converts a string to kebab-case.
|
|
35
45
|
*
|
|
36
|
-
* @param value The input string
|
|
37
|
-
* @returns The kebab-cased string
|
|
38
|
-
*
|
|
46
|
+
* @param value - The input string
|
|
47
|
+
* @returns The kebab-cased string
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* KebabCase('HelloWorld'); // 'hello-world'
|
|
52
|
+
* KebabCase('hello_world'); // 'hello-world'
|
|
53
|
+
* ```
|
|
39
54
|
*/
|
|
40
|
-
export
|
|
55
|
+
export function KebabCase(value) {
|
|
41
56
|
if (value && typeof value === 'string') {
|
|
42
57
|
return value
|
|
43
58
|
.replace(/(?<lower>[a-z])(?<upper>[A-Z])/gu, '$1-$2')
|
|
@@ -45,15 +60,20 @@ export const KEBAB_CASE = (value) => {
|
|
|
45
60
|
.toLowerCase();
|
|
46
61
|
}
|
|
47
62
|
return '';
|
|
48
|
-
}
|
|
63
|
+
}
|
|
49
64
|
/**
|
|
50
65
|
* Converts a string to PascalCase.
|
|
51
66
|
*
|
|
52
|
-
* @param value The input string
|
|
53
|
-
* @returns The PascalCased string
|
|
54
|
-
*
|
|
67
|
+
* @param value - The input string
|
|
68
|
+
* @returns The PascalCased string
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* PascalCase('hello-world'); // 'HelloWorld'
|
|
73
|
+
* PascalCase('hello_world'); // 'HelloWorld'
|
|
74
|
+
* ```
|
|
55
75
|
*/
|
|
56
|
-
export
|
|
76
|
+
export function PascalCase(value) {
|
|
57
77
|
if (value && typeof value === 'string') {
|
|
58
78
|
return value
|
|
59
79
|
.replace(/(?:^\w|[A-Z]|\b\w)/gu, (word) => {
|
|
@@ -64,15 +84,20 @@ export const PASCAL_CASE = (value) => {
|
|
|
64
84
|
});
|
|
65
85
|
}
|
|
66
86
|
return '';
|
|
67
|
-
}
|
|
87
|
+
}
|
|
68
88
|
/**
|
|
69
89
|
* Converts a string to snake_case.
|
|
70
90
|
*
|
|
71
|
-
* @param value The input string
|
|
72
|
-
* @returns The snake_cased string
|
|
73
|
-
*
|
|
91
|
+
* @param value - The input string
|
|
92
|
+
* @returns The snake_cased string
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* SnakeCase('HelloWorld'); // 'hello_world'
|
|
97
|
+
* SnakeCase('hello-world'); // 'hello_world'
|
|
98
|
+
* ```
|
|
74
99
|
*/
|
|
75
|
-
export
|
|
100
|
+
export function SnakeCase(value) {
|
|
76
101
|
if (value && typeof value === 'string') {
|
|
77
102
|
return value
|
|
78
103
|
.replace(/(?<lower>[a-z])(?<upper>[A-Z])/gu, '$1_$2')
|
|
@@ -80,15 +105,20 @@ export const SNAKE_CASE = (value) => {
|
|
|
80
105
|
.toLowerCase();
|
|
81
106
|
}
|
|
82
107
|
return '';
|
|
83
|
-
}
|
|
108
|
+
}
|
|
84
109
|
/**
|
|
85
110
|
* Converts a string to SCREAMING_SNAKE_CASE.
|
|
86
111
|
*
|
|
87
|
-
* @param value The input string
|
|
88
|
-
* @returns The SCREAMING_SNAKE_CASED string
|
|
89
|
-
*
|
|
112
|
+
* @param value - The input string
|
|
113
|
+
* @returns The SCREAMING_SNAKE_CASED string
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* ScreamingSnakeCase('HelloWorld'); // 'HELLO_WORLD'
|
|
118
|
+
* ScreamingSnakeCase('hello-world'); // 'HELLO_WORLD'
|
|
119
|
+
* ```
|
|
90
120
|
*/
|
|
91
|
-
export
|
|
92
|
-
return
|
|
93
|
-
}
|
|
121
|
+
export function ScreamingSnakeCase(value) {
|
|
122
|
+
return SnakeCase(value).toUpperCase();
|
|
123
|
+
}
|
|
94
124
|
//# sourceMappingURL=case-conversion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"case-conversion.js","sourceRoot":"","sources":["../../src/string/case-conversion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"case-conversion.js","sourceRoot":"","sources":["../../src/string/case-conversion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACtC,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,KAAK;aACV,OAAO,CAAC,sBAAsB,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAChD,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC9D,CAAC,CAAC;aACD,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACzC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC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O,CAAC,kCAAkC,EAAE,OAAO,CAAC;aACpD,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;aACxB,WAAW,EAAE,CAAC;IACjB,CAAC;IAED,OAAO,EAAE,CAAC;AACX,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC/C,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compares two strings with optional case-insensitive matching.
|
|
3
|
+
*
|
|
4
|
+
* @param a - The first string to compare
|
|
5
|
+
* @param b - The second string to compare
|
|
6
|
+
* @param caseInsensitive - Whether to perform case-insensitive comparison (default: false)
|
|
7
|
+
* @returns True if the strings match according to the comparison mode
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* StringEquals('Hello', 'Hello'); // true
|
|
12
|
+
* StringEquals('Hello', 'hello'); // false
|
|
13
|
+
* StringEquals('Hello', 'hello', true); // true
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @see {@link IsBlankString}
|
|
17
|
+
* @see {@link Capitalize}
|
|
18
|
+
*/
|
|
19
|
+
export declare function StringEquals(a: string, b: string, caseInsensitive?: boolean): boolean;
|
|
20
|
+
//# sourceMappingURL=comparison.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../src/string/comparison.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,eAAe,GAAE,OAAe,GAAG,OAAO,CAK5F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compares two strings with optional case-insensitive matching.
|
|
3
|
+
*
|
|
4
|
+
* @param a - The first string to compare
|
|
5
|
+
* @param b - The second string to compare
|
|
6
|
+
* @param caseInsensitive - Whether to perform case-insensitive comparison (default: false)
|
|
7
|
+
* @returns True if the strings match according to the comparison mode
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* StringEquals('Hello', 'Hello'); // true
|
|
12
|
+
* StringEquals('Hello', 'hello'); // false
|
|
13
|
+
* StringEquals('Hello', 'hello', true); // true
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @see {@link IsBlankString}
|
|
17
|
+
* @see {@link Capitalize}
|
|
18
|
+
*/
|
|
19
|
+
export function StringEquals(a, b, caseInsensitive = false) {
|
|
20
|
+
if (caseInsensitive) {
|
|
21
|
+
return a.toLowerCase() === b.toLowerCase();
|
|
22
|
+
}
|
|
23
|
+
return a === b;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=comparison.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../src/string/comparison.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAAC,CAAS,EAAE,CAAS,EAAE,kBAA2B,KAAK;IAClF,IAAI,eAAe,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5C,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -14,8 +14,8 @@ import type { TFormatParams, TFormatArgs } from './types.js';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function EscapeHTML(str: string): string;
|
|
16
16
|
/**
|
|
17
|
-
* Formats a string by replacing placeholders with values
|
|
18
|
-
* Supports both named placeholders {name} and positional {0}, {1}
|
|
17
|
+
* Formats a string by replacing placeholders with values.
|
|
18
|
+
* Supports both named placeholders {name} and positional {0}, {1}.
|
|
19
19
|
*
|
|
20
20
|
* @param template - The template string with placeholders
|
|
21
21
|
* @param params - Either an object with named parameters or array of positional parameters
|
|
@@ -40,27 +40,40 @@ export declare function FormatString(template: string, params: TFormatParams | T
|
|
|
40
40
|
/**
|
|
41
41
|
* Truncates a string to a specified length, appending an ellipsis if truncated.
|
|
42
42
|
*
|
|
43
|
-
* @param str The string to truncate
|
|
44
|
-
* @param maxLength The maximum length before truncation
|
|
45
|
-
* @param ellipsis The string to append when truncated (default: '...')
|
|
46
|
-
* @returns The truncated string
|
|
43
|
+
* @param str - The string to truncate
|
|
44
|
+
* @param maxLength - The maximum length before truncation
|
|
45
|
+
* @param ellipsis - The string to append when truncated (default: '...')
|
|
46
|
+
* @returns The truncated string
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* TruncateString('Hello World', 5); // 'Hello...'
|
|
51
|
+
* TruncateString('Hello World', 5, '!'); // 'Hello!'
|
|
52
|
+
* ```
|
|
47
53
|
*/
|
|
48
54
|
export declare function TruncateString(str: string, maxLength: number, ellipsis?: string): string;
|
|
49
55
|
/**
|
|
50
56
|
* Pads a string to a specified length.
|
|
51
57
|
*
|
|
52
|
-
* @param str The input string
|
|
53
|
-
* @param length The target length
|
|
54
|
-
* @param char The character to pad with (default: ' ')
|
|
55
|
-
* @param padEnd If true, pads the end; otherwise, pads the start (default: true)
|
|
56
|
-
* @returns The padded string
|
|
58
|
+
* @param str - The input string
|
|
59
|
+
* @param length - The target length
|
|
60
|
+
* @param char - The character to pad with (default: ' ')
|
|
61
|
+
* @param padEnd - If true, pads the end; otherwise, pads the start (default: true)
|
|
62
|
+
* @returns The padded string
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* PadString('hello', 10); // 'hello '
|
|
67
|
+
* PadString('hello', 10, '*'); // 'hello*****'
|
|
68
|
+
* PadString('hello', 10, '*', false); // '*****hello'
|
|
69
|
+
* ```
|
|
57
70
|
*/
|
|
58
71
|
export declare function PadString(str: string, length: number, char?: string, padEnd?: boolean): string;
|
|
59
72
|
/**
|
|
60
73
|
* Removes all HTML tags from a string.
|
|
61
74
|
*
|
|
62
|
-
* @param str The input string
|
|
63
|
-
* @returns The string with all HTML tags stripped
|
|
75
|
+
* @param str - The input string
|
|
76
|
+
* @returns The string with all HTML tags stripped
|
|
64
77
|
*
|
|
65
78
|
* @example
|
|
66
79
|
* ```typescript
|
|
@@ -71,10 +84,10 @@ export declare function StripHTML(str: string): string;
|
|
|
71
84
|
/**
|
|
72
85
|
* Returns the plural form of a word based on a count.
|
|
73
86
|
*
|
|
74
|
-
* @param word The singular word
|
|
75
|
-
* @param count The count to test against
|
|
76
|
-
* @param plural Optional custom plural form (defaults to `word + 's'`)
|
|
77
|
-
* @returns The singular word when `count === 1`, otherwise the plural
|
|
87
|
+
* @param word - The singular word
|
|
88
|
+
* @param count - The count to test against
|
|
89
|
+
* @param plural - Optional custom plural form (defaults to `word + 's'`)
|
|
90
|
+
* @returns The singular word when `count === 1`, otherwise the plural
|
|
78
91
|
*
|
|
79
92
|
* @example
|
|
80
93
|
* ```typescript
|
|
@@ -88,8 +101,8 @@ export declare function Pluralize(word: string, count: number, plural?: string):
|
|
|
88
101
|
* Counts the number of words in a string.
|
|
89
102
|
* Words are separated by one or more whitespace characters.
|
|
90
103
|
*
|
|
91
|
-
* @param str The input string
|
|
92
|
-
* @returns The number of words
|
|
104
|
+
* @param str - The input string
|
|
105
|
+
* @returns The number of words
|
|
93
106
|
*
|
|
94
107
|
* @example
|
|
95
108
|
* ```typescript
|
|
@@ -101,9 +114,9 @@ export declare function WordCount(str: string): number;
|
|
|
101
114
|
/**
|
|
102
115
|
* Counts the number of non-overlapping occurrences of `substr` in `str`.
|
|
103
116
|
*
|
|
104
|
-
* @param str The string to search in
|
|
105
|
-
* @param substr The substring to count
|
|
106
|
-
* @returns The number of occurrences
|
|
117
|
+
* @param str - The string to search in
|
|
118
|
+
* @param substr - The substring to count
|
|
119
|
+
* @returns The number of occurrences
|
|
107
120
|
*
|
|
108
121
|
* @example
|
|
109
122
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/string/formatting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAW9C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,aAAa,GAAG,WAAW,GACjC,MAAM,CAoBR;AAED
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/string/formatting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAW9C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,aAAa,GAAG,WAAW,GACjC,MAAM,CAoBR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAQ,GAAG,MAAM,CAUvF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,SAAM,EAAE,MAAM,UAAO,GAAG,MAAM,CASxF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CASpE"}
|
|
@@ -23,8 +23,8 @@ export function EscapeHTML(str) {
|
|
|
23
23
|
return '';
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Formats a string by replacing placeholders with values
|
|
27
|
-
* Supports both named placeholders {name} and positional {0}, {1}
|
|
26
|
+
* Formats a string by replacing placeholders with values.
|
|
27
|
+
* Supports both named placeholders {name} and positional {0}, {1}.
|
|
28
28
|
*
|
|
29
29
|
* @param template - The template string with placeholders
|
|
30
30
|
* @param params - Either an object with named parameters or array of positional parameters
|
|
@@ -66,10 +66,16 @@ export function FormatString(template, params) {
|
|
|
66
66
|
/**
|
|
67
67
|
* Truncates a string to a specified length, appending an ellipsis if truncated.
|
|
68
68
|
*
|
|
69
|
-
* @param str The string to truncate
|
|
70
|
-
* @param maxLength The maximum length before truncation
|
|
71
|
-
* @param ellipsis The string to append when truncated (default: '...')
|
|
72
|
-
* @returns The truncated string
|
|
69
|
+
* @param str - The string to truncate
|
|
70
|
+
* @param maxLength - The maximum length before truncation
|
|
71
|
+
* @param ellipsis - The string to append when truncated (default: '...')
|
|
72
|
+
* @returns The truncated string
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* TruncateString('Hello World', 5); // 'Hello...'
|
|
77
|
+
* TruncateString('Hello World', 5, '!'); // 'Hello!'
|
|
78
|
+
* ```
|
|
73
79
|
*/
|
|
74
80
|
export function TruncateString(str, maxLength, ellipsis = '...') {
|
|
75
81
|
if (str && typeof str === 'string' && maxLength > 0) {
|
|
@@ -83,11 +89,18 @@ export function TruncateString(str, maxLength, ellipsis = '...') {
|
|
|
83
89
|
/**
|
|
84
90
|
* Pads a string to a specified length.
|
|
85
91
|
*
|
|
86
|
-
* @param str The input string
|
|
87
|
-
* @param length The target length
|
|
88
|
-
* @param char The character to pad with (default: ' ')
|
|
89
|
-
* @param padEnd If true, pads the end; otherwise, pads the start (default: true)
|
|
90
|
-
* @returns The padded string
|
|
92
|
+
* @param str - The input string
|
|
93
|
+
* @param length - The target length
|
|
94
|
+
* @param char - The character to pad with (default: ' ')
|
|
95
|
+
* @param padEnd - If true, pads the end; otherwise, pads the start (default: true)
|
|
96
|
+
* @returns The padded string
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* PadString('hello', 10); // 'hello '
|
|
101
|
+
* PadString('hello', 10, '*'); // 'hello*****'
|
|
102
|
+
* PadString('hello', 10, '*', false); // '*****hello'
|
|
103
|
+
* ```
|
|
91
104
|
*/
|
|
92
105
|
export function PadString(str, length, char = ' ', padEnd = true) {
|
|
93
106
|
if (typeof str === 'string' && length > str.length) {
|
|
@@ -100,8 +113,8 @@ export function PadString(str, length, char = ' ', padEnd = true) {
|
|
|
100
113
|
/**
|
|
101
114
|
* Removes all HTML tags from a string.
|
|
102
115
|
*
|
|
103
|
-
* @param str The input string
|
|
104
|
-
* @returns The string with all HTML tags stripped
|
|
116
|
+
* @param str - The input string
|
|
117
|
+
* @returns The string with all HTML tags stripped
|
|
105
118
|
*
|
|
106
119
|
* @example
|
|
107
120
|
* ```typescript
|
|
@@ -116,10 +129,10 @@ export function StripHTML(str) {
|
|
|
116
129
|
/**
|
|
117
130
|
* Returns the plural form of a word based on a count.
|
|
118
131
|
*
|
|
119
|
-
* @param word The singular word
|
|
120
|
-
* @param count The count to test against
|
|
121
|
-
* @param plural Optional custom plural form (defaults to `word + 's'`)
|
|
122
|
-
* @returns The singular word when `count === 1`, otherwise the plural
|
|
132
|
+
* @param word - The singular word
|
|
133
|
+
* @param count - The count to test against
|
|
134
|
+
* @param plural - Optional custom plural form (defaults to `word + 's'`)
|
|
135
|
+
* @returns The singular word when `count === 1`, otherwise the plural
|
|
123
136
|
*
|
|
124
137
|
* @example
|
|
125
138
|
* ```typescript
|
|
@@ -137,8 +150,8 @@ export function Pluralize(word, count, plural) {
|
|
|
137
150
|
* Counts the number of words in a string.
|
|
138
151
|
* Words are separated by one or more whitespace characters.
|
|
139
152
|
*
|
|
140
|
-
* @param str The input string
|
|
141
|
-
* @returns The number of words
|
|
153
|
+
* @param str - The input string
|
|
154
|
+
* @returns The number of words
|
|
142
155
|
*
|
|
143
156
|
* @example
|
|
144
157
|
* ```typescript
|
|
@@ -154,9 +167,9 @@ export function WordCount(str) {
|
|
|
154
167
|
/**
|
|
155
168
|
* Counts the number of non-overlapping occurrences of `substr` in `str`.
|
|
156
169
|
*
|
|
157
|
-
* @param str The string to search in
|
|
158
|
-
* @param substr The substring to count
|
|
159
|
-
* @returns The number of occurrences
|
|
170
|
+
* @param str - The string to search in
|
|
171
|
+
* @param substr - The substring to count
|
|
172
|
+
* @returns The number of occurrences
|
|
160
173
|
*
|
|
161
174
|
* @example
|
|
162
175
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.js","sourceRoot":"","sources":["../../src/string/formatting.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACrC,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,GAAG;aACR,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC;aACvB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;aACtB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC;aACtB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC;aACxB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;I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EAAE,EAAE,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,KAAa,EAAE,MAAe;IACrE,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACjD,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW;IACpC,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IAC9C,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;AACxD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,MAAc;IAC3D,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM;QAAE,OAAO,CAAC,CAAC;IAC9B,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAChD,KAAK,EAAE,CAAC;QACR,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC;IACtB,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
package/build/string/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './case-conversion.js';
|
|
|
11
11
|
export * from './validation.js';
|
|
12
12
|
export * from './formatting.js';
|
|
13
13
|
export * from './transformation.js';
|
|
14
|
+
export * from './comparison.js';
|
|
14
15
|
export type { TStringValidator, TStringFormatter, TStringTransformer, TCaseConverter, TStringPredicate, TFormatValue, TFormatParams, TFormatArgs } from './types.js';
|
|
15
16
|
export * from './assert.js';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/string/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/string/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAEhC,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACrK,cAAc,aAAa,CAAC"}
|
package/build/string/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/string/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/string/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,aAAa,CAAC"}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import type { TStringTransformer } from './types.js';
|
|
2
1
|
/**
|
|
3
2
|
* Reverses a string.
|
|
4
3
|
*
|
|
5
|
-
* @param input The input string
|
|
6
|
-
* @returns The reversed string
|
|
7
|
-
*
|
|
4
|
+
* @param input - The input string
|
|
5
|
+
* @returns The reversed string
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* ReverseString('hello'); // 'olleh'
|
|
10
|
+
* ReverseString('12345'); // '54321'
|
|
11
|
+
* ```
|
|
8
12
|
*/
|
|
9
|
-
export declare
|
|
13
|
+
export declare function ReverseString(input: string): string;
|
|
10
14
|
/**
|
|
11
15
|
* Converts a string to a URL-friendly slug.
|
|
12
16
|
*
|
|
13
|
-
* @param input The input string
|
|
14
|
-
* @returns The URL-friendly slug
|
|
15
|
-
*
|
|
17
|
+
* @param input - The input string
|
|
18
|
+
* @returns The URL-friendly slug
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* Slugify('Hello World!'); // 'hello-world'
|
|
23
|
+
* Slugify('The Quick Brown Fox'); // 'the-quick-brown-fox'
|
|
24
|
+
* Slugify('CamelCaseText'); // 'camelcasetext'
|
|
25
|
+
* ```
|
|
16
26
|
*/
|
|
17
|
-
export declare
|
|
27
|
+
export declare function Slugify(input: string): string;
|
|
18
28
|
//# sourceMappingURL=transformation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformation.d.ts","sourceRoot":"","sources":["../../src/string/transformation.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"transformation.d.ts","sourceRoot":"","sources":["../../src/string/transformation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAW7C"}
|