@ls-stack/utils 3.40.0 → 3.41.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.
Files changed (158) hide show
  1. package/dist/arrayUtils.d.cts +70 -57
  2. package/dist/arrayUtils.d.ts +70 -57
  3. package/dist/assertions.d.cts +128 -117
  4. package/dist/assertions.d.ts +128 -117
  5. package/dist/asyncQueue.cjs +117 -112
  6. package/dist/asyncQueue.d.cts +217 -215
  7. package/dist/asyncQueue.d.ts +217 -215
  8. package/dist/asyncQueue.js +117 -112
  9. package/dist/awaitDebounce.d.cts +26 -23
  10. package/dist/awaitDebounce.d.ts +26 -23
  11. package/dist/cache.cjs +2 -1
  12. package/dist/cache.d.cts +15 -9
  13. package/dist/cache.d.ts +15 -9
  14. package/dist/cache.js +2 -1
  15. package/dist/{chunk-GHAQOUA6.js → chunk-23KPGKDT.js} +22 -1
  16. package/dist/{chunk-ADM37GSC.js → chunk-7L4KCZJJ.js} +12 -10
  17. package/dist/{chunk-KW55OTUG.js → chunk-B3KFV2MH.js} +2 -2
  18. package/dist/chunk-DTE2QMWE.js +48 -0
  19. package/dist/concurrentCalls.d.cts +8 -4
  20. package/dist/concurrentCalls.d.ts +8 -4
  21. package/dist/concurrentCalls.js +1 -1
  22. package/dist/debounce.d.cts +12 -20
  23. package/dist/debounce.d.ts +12 -20
  24. package/dist/dedent.d.cts +31 -31
  25. package/dist/dedent.d.ts +31 -31
  26. package/dist/deepEqual.d.cts +10 -9
  27. package/dist/deepEqual.d.ts +10 -9
  28. package/dist/filterObjectOrArrayKeys.d.cts +44 -19
  29. package/dist/filterObjectOrArrayKeys.d.ts +44 -19
  30. package/dist/getAutoIncrementId.d.cts +25 -23
  31. package/dist/getAutoIncrementId.d.ts +25 -23
  32. package/dist/getCompositeKey.d.cts +2 -1
  33. package/dist/getCompositeKey.d.ts +2 -1
  34. package/dist/getValueStableKey.d.cts +4 -3
  35. package/dist/getValueStableKey.d.ts +4 -3
  36. package/dist/mutationUtils.d.cts +2 -2
  37. package/dist/mutationUtils.d.ts +2 -2
  38. package/dist/objUtils.cjs +51 -2
  39. package/dist/objUtils.d.cts +8 -3
  40. package/dist/objUtils.d.ts +8 -3
  41. package/dist/objUtils.js +11 -3
  42. package/dist/parallelAsyncCalls.cjs +2 -1
  43. package/dist/parallelAsyncCalls.d.cts +5 -4
  44. package/dist/parallelAsyncCalls.d.ts +5 -4
  45. package/dist/parallelAsyncCalls.js +2 -1
  46. package/dist/retryOnError.d.cts +23 -20
  47. package/dist/retryOnError.d.ts +23 -20
  48. package/dist/runShellCmd.d.cts +40 -40
  49. package/dist/runShellCmd.d.ts +40 -40
  50. package/dist/safeJson.d.cts +6 -2
  51. package/dist/safeJson.d.ts +6 -2
  52. package/dist/saferTyping.d.cts +21 -14
  53. package/dist/saferTyping.d.ts +21 -14
  54. package/dist/shallowEqual.d.cts +1 -1
  55. package/dist/shallowEqual.d.ts +1 -1
  56. package/dist/stringUtils.cjs +2 -2
  57. package/dist/stringUtils.d.cts +6 -7
  58. package/dist/stringUtils.d.ts +6 -7
  59. package/dist/stringUtils.js +1 -1
  60. package/dist/testUtils.cjs +11 -9
  61. package/dist/testUtils.d.cts +32 -14
  62. package/dist/testUtils.d.ts +32 -14
  63. package/dist/testUtils.js +4 -3
  64. package/dist/throttle.d.cts +57 -48
  65. package/dist/throttle.d.ts +57 -48
  66. package/dist/timers.d.cts +68 -63
  67. package/dist/timers.d.ts +68 -63
  68. package/dist/tsResult.d.cts +7 -6
  69. package/dist/tsResult.d.ts +7 -6
  70. package/dist/typeGuards.d.cts +65 -64
  71. package/dist/typeGuards.d.ts +65 -64
  72. package/dist/typeUtils.d.cts +18 -4
  73. package/dist/typeUtils.d.ts +18 -4
  74. package/dist/typedStrings.d.cts +68 -57
  75. package/dist/typedStrings.d.ts +68 -57
  76. package/dist/typingFnUtils.d.cts +12 -6
  77. package/dist/typingFnUtils.d.ts +12 -6
  78. package/dist/typingFnUtils.js +12 -35
  79. package/dist/typingTestUtils.cjs +7 -1
  80. package/dist/typingTestUtils.d.cts +52 -11
  81. package/dist/typingTestUtils.d.ts +52 -11
  82. package/dist/typingTestUtils.js +7 -1
  83. package/dist/typingUtils.d.cts +4 -1
  84. package/dist/typingUtils.d.ts +4 -1
  85. package/dist/yamlStringify.cjs +11 -9
  86. package/dist/yamlStringify.js +2 -2
  87. package/package.json +5 -1
  88. package/docs/README.md +0 -72
  89. package/docs/_media/modules.md +0 -58
  90. package/docs/arrayUtils/-internal-.md +0 -179
  91. package/docs/arrayUtils/README.md +0 -550
  92. package/docs/assertions/-internal-.md +0 -63
  93. package/docs/assertions/README.md +0 -565
  94. package/docs/asyncQueue/-internal-.md +0 -297
  95. package/docs/asyncQueue/README.md +0 -1485
  96. package/docs/awaitDebounce.md +0 -66
  97. package/docs/cache/-internal-.md +0 -168
  98. package/docs/cache/README.md +0 -360
  99. package/docs/castValues.md +0 -47
  100. package/docs/concurrentCalls/-internal-.md +0 -490
  101. package/docs/concurrentCalls/README.md +0 -299
  102. package/docs/consoleFmt.md +0 -115
  103. package/docs/conversions.md +0 -27
  104. package/docs/createThrottleController/-internal-.md +0 -73
  105. package/docs/createThrottleController/README.md +0 -31
  106. package/docs/debounce.md +0 -188
  107. package/docs/dedent/-internal-.md +0 -17
  108. package/docs/dedent/README.md +0 -204
  109. package/docs/deepEqual.md +0 -94
  110. package/docs/enhancedMap.md +0 -358
  111. package/docs/exhaustiveMatch/-internal-.md +0 -39
  112. package/docs/exhaustiveMatch/README.md +0 -146
  113. package/docs/filterObjectOrArrayKeys.md +0 -109
  114. package/docs/getAutoIncrementId.md +0 -93
  115. package/docs/getCompositeKey.md +0 -39
  116. package/docs/getValueStableKey.md +0 -57
  117. package/docs/hash.md +0 -31
  118. package/docs/interpolate/-internal-.md +0 -61
  119. package/docs/interpolate/README.md +0 -62
  120. package/docs/keepPrevIfUnchanged.md +0 -43
  121. package/docs/levenshtein.md +0 -93
  122. package/docs/main.md +0 -21
  123. package/docs/mathUtils.md +0 -137
  124. package/docs/modules.md +0 -58
  125. package/docs/mutationUtils.md +0 -44
  126. package/docs/objUtils.md +0 -237
  127. package/docs/parallelAsyncCalls/-internal-.md +0 -347
  128. package/docs/parallelAsyncCalls/README.md +0 -45
  129. package/docs/promiseUtils/-internal-.md +0 -69
  130. package/docs/promiseUtils/README.md +0 -31
  131. package/docs/retryOnError/-internal-.md +0 -111
  132. package/docs/retryOnError/README.md +0 -168
  133. package/docs/runShellCmd/-internal-.md +0 -111
  134. package/docs/runShellCmd/README.md +0 -201
  135. package/docs/safeJson.md +0 -51
  136. package/docs/saferTyping.md +0 -228
  137. package/docs/serializeXML.md +0 -100
  138. package/docs/shallowEqual.md +0 -33
  139. package/docs/sleep.md +0 -27
  140. package/docs/stringUtils/-internal-.md +0 -17
  141. package/docs/stringUtils/README.md +0 -270
  142. package/docs/testUtils.md +0 -382
  143. package/docs/throttle/-internal-.md +0 -47
  144. package/docs/throttle/README.md +0 -178
  145. package/docs/time.md +0 -274
  146. package/docs/timers.md +0 -256
  147. package/docs/tsResult/-internal-.md +0 -327
  148. package/docs/tsResult/README.md +0 -702
  149. package/docs/typeGuards.md +0 -399
  150. package/docs/typeUtils/-internal-.md +0 -99
  151. package/docs/typeUtils/README.md +0 -195
  152. package/docs/typeUtils.typesTest.md +0 -7
  153. package/docs/typedStrings.md +0 -458
  154. package/docs/typingFnUtils/-internal-.md +0 -43
  155. package/docs/typingFnUtils/README.md +0 -317
  156. package/docs/typingTestUtils.md +0 -172
  157. package/docs/typingUtils.md +0 -135
  158. package/docs/yamlStringify.md +0 -83
package/docs/safeJson.md DELETED
@@ -1,51 +0,0 @@
1
- [**@ls-stack/utils**](README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](modules.md) / safeJson
6
-
7
- # safeJson
8
-
9
- ## Functions
10
-
11
- ### safeJsonParse()
12
-
13
- ```ts
14
- function safeJsonParse(value): unknown;
15
- ```
16
-
17
- Defined in: [packages/utils/src/safeJson.ts:17](https://github.com/lucasols/utils/blob/main/packages/utils/src/safeJson.ts#L17)
18
-
19
- JSON.parse can throw if the value is not valid JSON, this function catches those errors and returns undefined
20
-
21
- #### Parameters
22
-
23
- ##### value
24
-
25
- `string`
26
-
27
- #### Returns
28
-
29
- `unknown`
30
-
31
- ***
32
-
33
- ### safeJsonStringify()
34
-
35
- ```ts
36
- function safeJsonStringify(value): undefined | string;
37
- ```
38
-
39
- Defined in: [packages/utils/src/safeJson.ts:5](https://github.com/lucasols/utils/blob/main/packages/utils/src/safeJson.ts#L5)
40
-
41
- JSON.stringify can throw if the value is circular or contains functions, this function catches those errors and returns undefined
42
-
43
- #### Parameters
44
-
45
- ##### value
46
-
47
- `unknown`
48
-
49
- #### Returns
50
-
51
- `undefined` \| `string`
@@ -1,228 +0,0 @@
1
- [**@ls-stack/utils**](README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](modules.md) / saferTyping
6
-
7
- # saferTyping
8
-
9
- ## Type Aliases
10
-
11
- ### \_\_FIX\_THIS\_TYPING\_\_
12
-
13
- ```ts
14
- type __FIX_THIS_TYPING__ = any;
15
- ```
16
-
17
- Defined in: [packages/utils/src/saferTyping.ts:51](https://github.com/lucasols/utils/blob/main/packages/utils/src/saferTyping.ts#L51)
18
-
19
- ***
20
-
21
- ### \_\_LEGIT\_ANY\_\_
22
-
23
- ```ts
24
- type __LEGIT_ANY__ = any;
25
- ```
26
-
27
- Defined in: [packages/utils/src/saferTyping.ts:4](https://github.com/lucasols/utils/blob/main/packages/utils/src/saferTyping.ts#L4)
28
-
29
- Use this only when you have 100% of certainty that this will not break the types
30
-
31
- ***
32
-
33
- ### \_\_LEGIT\_ANY\_FUNCTION\_\_()
34
-
35
- ```ts
36
- type __LEGIT_ANY_FUNCTION__ = (...params) => __LEGIT_ANY__;
37
- ```
38
-
39
- Defined in: [packages/utils/src/saferTyping.ts:8](https://github.com/lucasols/utils/blob/main/packages/utils/src/saferTyping.ts#L8)
40
-
41
- #### Parameters
42
-
43
- ##### params
44
-
45
- ...`any`
46
-
47
- #### Returns
48
-
49
- [`__LEGIT_ANY__`](#__legit_any__)
50
-
51
- ***
52
-
53
- ### AnyNonPrimitiveValue
54
-
55
- ```ts
56
- type AnyNonPrimitiveValue = object;
57
- ```
58
-
59
- Defined in: [packages/utils/src/saferTyping.ts:59](https://github.com/lucasols/utils/blob/main/packages/utils/src/saferTyping.ts#L59)
60
-
61
- Any type that is not a primitive (number, string, boolean, null, undefined, symbol, bigint, ...)
62
- Equivalent to `object` type
63
-
64
- ***
65
-
66
- ### EmptyObject
67
-
68
- ```ts
69
- type EmptyObject = Record<string, never>;
70
- ```
71
-
72
- Defined in: [packages/utils/src/saferTyping.ts:13](https://github.com/lucasols/utils/blob/main/packages/utils/src/saferTyping.ts#L13)
73
-
74
- An empty object type, equivalent to `{}` but with safer typing
75
-
76
- ## Functions
77
-
78
- ### \_\_FIX\_THIS\_CASTING\_\_()
79
-
80
- ```ts
81
- function __FIX_THIS_CASTING__<T>(value): T;
82
- ```
83
-
84
- Defined in: [packages/utils/src/saferTyping.ts:47](https://github.com/lucasols/utils/blob/main/packages/utils/src/saferTyping.ts#L47)
85
-
86
- #### Type Parameters
87
-
88
- ##### T
89
-
90
- `T`
91
-
92
- #### Parameters
93
-
94
- ##### value
95
-
96
- `unknown`
97
-
98
- #### Returns
99
-
100
- `T`
101
-
102
- ***
103
-
104
- ### \_\_FIX\_THIS\_TYPING\_\_()
105
-
106
- ```ts
107
- function __FIX_THIS_TYPING__(value): any;
108
- ```
109
-
110
- Defined in: [packages/utils/src/saferTyping.ts:51](https://github.com/lucasols/utils/blob/main/packages/utils/src/saferTyping.ts#L51)
111
-
112
- #### Parameters
113
-
114
- ##### value
115
-
116
- `unknown`
117
-
118
- #### Returns
119
-
120
- `any`
121
-
122
- ***
123
-
124
- ### \_\_LEGIT\_ANY\_CAST\_\_()
125
-
126
- ```ts
127
- function __LEGIT_ANY_CAST__<V>(value): any;
128
- ```
129
-
130
- Defined in: [packages/utils/src/saferTyping.ts:21](https://github.com/lucasols/utils/blob/main/packages/utils/src/saferTyping.ts#L21)
131
-
132
- Cast a value to `any` type. Use this when you have legit usage of `any` casting.
133
-
134
- #### Type Parameters
135
-
136
- ##### V
137
-
138
- `V` = `unknown`
139
-
140
- (optional) - When used enforces that the casted value is assignable to the type V, use it for safer casts
141
-
142
- #### Parameters
143
-
144
- ##### value
145
-
146
- `V`
147
-
148
- #### Returns
149
-
150
- `any`
151
-
152
- ***
153
-
154
- ### \_\_LEGIT\_CAST\_\_()
155
-
156
- ```ts
157
- function __LEGIT_CAST__<T, V>(value): T;
158
- ```
159
-
160
- Defined in: [packages/utils/src/saferTyping.ts:32](https://github.com/lucasols/utils/blob/main/packages/utils/src/saferTyping.ts#L32)
161
-
162
- Cast a value to a specific type T. Use this when you have legit usage of type assertion.
163
-
164
- #### Type Parameters
165
-
166
- ##### T
167
-
168
- `T`
169
-
170
- The type to cast to
171
-
172
- ##### V
173
-
174
- `V` = `unknown`
175
-
176
- (optional) - When used enforces that the casted value is assignable to the type V, use it for safer casts
177
-
178
- #### Parameters
179
-
180
- ##### value
181
-
182
- `V`
183
-
184
- #### Returns
185
-
186
- `T`
187
-
188
- ***
189
-
190
- ### \_\_REFINE\_CAST\_\_()
191
-
192
- ```ts
193
- function __REFINE_CAST__<T>(value): <R>() => R;
194
- ```
195
-
196
- Defined in: [packages/utils/src/saferTyping.ts:43](https://github.com/lucasols/utils/blob/main/packages/utils/src/saferTyping.ts#L43)
197
-
198
- Refine a value to a specific type T. Use this when you have legit usage of type assertion.
199
-
200
- #### Type Parameters
201
-
202
- ##### T
203
-
204
- `T`
205
-
206
- The type to cast to
207
-
208
- #### Parameters
209
-
210
- ##### value
211
-
212
- `T`
213
-
214
- #### Returns
215
-
216
- ```ts
217
- <R>(): R;
218
- ```
219
-
220
- ##### Type Parameters
221
-
222
- ###### R
223
-
224
- `R`
225
-
226
- ##### Returns
227
-
228
- `R`
@@ -1,100 +0,0 @@
1
- [**@ls-stack/utils**](README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](modules.md) / serializeXML
6
-
7
- # serializeXML
8
-
9
- ## Type Aliases
10
-
11
- ### SerializeOptions
12
-
13
- ```ts
14
- type SerializeOptions = object;
15
- ```
16
-
17
- Defined in: [packages/utils/src/serializeXML.ts:36](https://github.com/lucasols/utils/blob/main/packages/utils/src/serializeXML.ts#L36)
18
-
19
- #### Properties
20
-
21
- ##### escapeText?
22
-
23
- ```ts
24
- optional escapeText: boolean;
25
- ```
26
-
27
- Defined in: [packages/utils/src/serializeXML.ts:38](https://github.com/lucasols/utils/blob/main/packages/utils/src/serializeXML.ts#L38)
28
-
29
- ##### indent?
30
-
31
- ```ts
32
- optional indent: number | string;
33
- ```
34
-
35
- Defined in: [packages/utils/src/serializeXML.ts:37](https://github.com/lucasols/utils/blob/main/packages/utils/src/serializeXML.ts#L37)
36
-
37
- ##### invalidNodes?
38
-
39
- ```ts
40
- optional invalidNodes: "throw" | "reject";
41
- ```
42
-
43
- Defined in: [packages/utils/src/serializeXML.ts:40](https://github.com/lucasols/utils/blob/main/packages/utils/src/serializeXML.ts#L40)
44
-
45
- ##### validateTagName?
46
-
47
- ```ts
48
- optional validateTagName: boolean;
49
- ```
50
-
51
- Defined in: [packages/utils/src/serializeXML.ts:39](https://github.com/lucasols/utils/blob/main/packages/utils/src/serializeXML.ts#L39)
52
-
53
- ***
54
-
55
- ### XMLNode
56
-
57
- ```ts
58
- type XMLNode =
59
- | {
60
- attrs?: Record<string, string | number | boolean | null | undefined>;
61
- children?: (XMLNode | null | undefined | false)[] | string;
62
- escapeText?: boolean;
63
- name: string;
64
- type?: "node";
65
- }
66
- | {
67
- content: string;
68
- escapeText?: boolean;
69
- type: "comment";
70
- }
71
- | {
72
- type: "emptyLine";
73
- };
74
- ```
75
-
76
- Defined in: [packages/utils/src/serializeXML.ts:19](https://github.com/lucasols/utils/blob/main/packages/utils/src/serializeXML.ts#L19)
77
-
78
- ## Functions
79
-
80
- ### serializeXML()
81
-
82
- ```ts
83
- function serializeXML(node, options?): string;
84
- ```
85
-
86
- Defined in: [packages/utils/src/serializeXML.ts:43](https://github.com/lucasols/utils/blob/main/packages/utils/src/serializeXML.ts#L43)
87
-
88
- #### Parameters
89
-
90
- ##### node
91
-
92
- [`XMLNode`](#xmlnode) | false \| XMLNode \| null \| undefined[]
93
-
94
- ##### options?
95
-
96
- [`SerializeOptions`](#serializeoptions)
97
-
98
- #### Returns
99
-
100
- `string`
@@ -1,33 +0,0 @@
1
- [**@ls-stack/utils**](README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](modules.md) / shallowEqual
6
-
7
- # shallowEqual
8
-
9
- ## Functions
10
-
11
- ### shallowEqual()
12
-
13
- ```ts
14
- function shallowEqual(foo, bar): boolean;
15
- ```
16
-
17
- Defined in: [packages/utils/src/shallowEqual.ts:11](https://github.com/lucasols/utils/blob/main/packages/utils/src/shallowEqual.ts#L11)
18
-
19
- shallow equal version of https://github.com/lukeed/dequal
20
-
21
- #### Parameters
22
-
23
- ##### foo
24
-
25
- `any`
26
-
27
- ##### bar
28
-
29
- `any`
30
-
31
- #### Returns
32
-
33
- `boolean`
package/docs/sleep.md DELETED
@@ -1,27 +0,0 @@
1
- [**@ls-stack/utils**](README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](modules.md) / sleep
6
-
7
- # sleep
8
-
9
- ## Functions
10
-
11
- ### sleep()
12
-
13
- ```ts
14
- function sleep(ms): Promise<unknown>;
15
- ```
16
-
17
- Defined in: [packages/utils/src/sleep.ts:1](https://github.com/lucasols/utils/blob/main/packages/utils/src/sleep.ts#L1)
18
-
19
- #### Parameters
20
-
21
- ##### ms
22
-
23
- `number`
24
-
25
- #### Returns
26
-
27
- `Promise`\<`unknown`\>
@@ -1,17 +0,0 @@
1
- [**@ls-stack/utils**](../README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](../modules.md) / [stringUtils](README.md) / \<internal\>
6
-
7
- # \<internal\>
8
-
9
- ## Type Aliases
10
-
11
- ### Arg
12
-
13
- ```ts
14
- type Arg = string | false | undefined | null;
15
- ```
16
-
17
- Defined in: [packages/utils/src/stringUtils.ts:1](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L1)
@@ -1,270 +0,0 @@
1
- [**@ls-stack/utils**](../README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](../modules.md) / stringUtils
6
-
7
- # stringUtils
8
-
9
- ## Modules
10
-
11
- - [\<internal\>](-internal-.md)
12
-
13
- ## Variables
14
-
15
- ### ~~joinStrings()~~
16
-
17
- ```ts
18
- const joinStrings: (...args) => string = concatStrings;
19
- ```
20
-
21
- Defined in: [packages/utils/src/stringUtils.ts:34](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L34)
22
-
23
- A util to create more legible conditional concatenated strings
24
-
25
- #### Parameters
26
-
27
- ##### args
28
-
29
- ...([`Arg`](-internal-.md#arg) \| [`Arg`](-internal-.md#arg)[])[]
30
-
31
- #### Returns
32
-
33
- `string`
34
-
35
- #### Example
36
-
37
- ```ts
38
- joinStrings('a', 'b', 'c') // 'abc'
39
- joinStrings('a', false, 'c') // 'ac'
40
- joinStrings('a', addBString ? 'b' : null, 'c') // 'ac' if addBString is false, 'abc' if addBString is true
41
- ```
42
-
43
- #### Deprecated
44
-
45
- Use [concatStrings](#concatstrings) instead
46
-
47
- ## Functions
48
-
49
- ### concatStrings()
50
-
51
- ```ts
52
- function concatStrings(...args): string;
53
- ```
54
-
55
- Defined in: [packages/utils/src/stringUtils.ts:12](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L12)
56
-
57
- A util to create more legible conditional concatenated strings
58
-
59
- #### Parameters
60
-
61
- ##### args
62
-
63
- ...([`Arg`](-internal-.md#arg) \| [`Arg`](-internal-.md#arg)[])[]
64
-
65
- #### Returns
66
-
67
- `string`
68
-
69
- #### Example
70
-
71
- ```ts
72
- joinStrings('a', 'b', 'c') // 'abc'
73
- joinStrings('a', false, 'c') // 'ac'
74
- joinStrings('a', addBString ? 'b' : null, 'c') // 'ac' if addBString is false, 'abc' if addBString is true
75
- ```
76
-
77
- ***
78
-
79
- ### convertToCamelCase()
80
-
81
- ```ts
82
- function convertToCamelCase(str): string;
83
- ```
84
-
85
- Defined in: [packages/utils/src/stringUtils.ts:72](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L72)
86
-
87
- #### Parameters
88
-
89
- ##### str
90
-
91
- `string`
92
-
93
- #### Returns
94
-
95
- `string`
96
-
97
- ***
98
-
99
- ### convertToPascalCase()
100
-
101
- ```ts
102
- function convertToPascalCase(str): string;
103
- ```
104
-
105
- Defined in: [packages/utils/src/stringUtils.ts:65](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L65)
106
-
107
- #### Parameters
108
-
109
- ##### str
110
-
111
- `string`
112
-
113
- #### Returns
114
-
115
- `string`
116
-
117
- ***
118
-
119
- ### convertToSentenceCase()
120
-
121
- ```ts
122
- function convertToSentenceCase(str): string;
123
- ```
124
-
125
- Defined in: [packages/utils/src/stringUtils.ts:77](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L77)
126
-
127
- #### Parameters
128
-
129
- ##### str
130
-
131
- `string`
132
-
133
- #### Returns
134
-
135
- `string`
136
-
137
- ***
138
-
139
- ### convertToSnakeCase()
140
-
141
- ```ts
142
- function convertToSnakeCase(str): string;
143
- ```
144
-
145
- Defined in: [packages/utils/src/stringUtils.ts:54](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L54)
146
-
147
- #### Parameters
148
-
149
- ##### str
150
-
151
- `string`
152
-
153
- #### Returns
154
-
155
- `string`
156
-
157
- ***
158
-
159
- ### convertToTitleCase()
160
-
161
- ```ts
162
- function convertToTitleCase(str): string;
163
- ```
164
-
165
- Defined in: [packages/utils/src/stringUtils.ts:85](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L85)
166
-
167
- #### Parameters
168
-
169
- ##### str
170
-
171
- `string`
172
-
173
- #### Returns
174
-
175
- `string`
176
-
177
- ***
178
-
179
- ### formatNum()
180
-
181
- ```ts
182
- function formatNum(num, maxDecimalsOrOptions): string;
183
- ```
184
-
185
- Defined in: [packages/utils/src/stringUtils.ts:36](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L36)
186
-
187
- #### Parameters
188
-
189
- ##### num
190
-
191
- `number`
192
-
193
- ##### maxDecimalsOrOptions
194
-
195
- `number` | `NumberFormatOptions`
196
-
197
- #### Returns
198
-
199
- `string`
200
-
201
- ***
202
-
203
- ### isSnakeCase()
204
-
205
- ```ts
206
- function isSnakeCase(str): boolean;
207
- ```
208
-
209
- Defined in: [packages/utils/src/stringUtils.ts:50](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L50)
210
-
211
- #### Parameters
212
-
213
- ##### str
214
-
215
- `string`
216
-
217
- #### Returns
218
-
219
- `boolean`
220
-
221
- ***
222
-
223
- ### removeANSIColors()
224
-
225
- ```ts
226
- function removeANSIColors(str): string;
227
- ```
228
-
229
- Defined in: [packages/utils/src/stringUtils.ts:98](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L98)
230
-
231
- #### Parameters
232
-
233
- ##### str
234
-
235
- `string`
236
-
237
- #### Returns
238
-
239
- `string`
240
-
241
- ***
242
-
243
- ### truncateString()
244
-
245
- ```ts
246
- function truncateString(
247
- str,
248
- length,
249
- ellipsis): string;
250
- ```
251
-
252
- Defined in: [packages/utils/src/stringUtils.ts:92](https://github.com/lucasols/utils/blob/main/packages/utils/src/stringUtils.ts#L92)
253
-
254
- #### Parameters
255
-
256
- ##### str
257
-
258
- `string`
259
-
260
- ##### length
261
-
262
- `number`
263
-
264
- ##### ellipsis
265
-
266
- `string` = `'…'`
267
-
268
- #### Returns
269
-
270
- `string`