@ls-stack/utils 3.17.1 → 3.19.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 (114) hide show
  1. package/README.md +1 -15
  2. package/docs/README.md +72 -0
  3. package/docs/_media/modules.md +52 -0
  4. package/docs/arrayUtils/-internal-.md +17 -0
  5. package/docs/arrayUtils/README.md +423 -0
  6. package/docs/assertions/-internal-.md +63 -0
  7. package/docs/assertions/README.md +565 -0
  8. package/docs/asyncQueue/-internal-.md +815 -0
  9. package/docs/asyncQueue/README.md +75 -0
  10. package/docs/awaitDebounce.md +66 -0
  11. package/docs/cache/-internal-.md +168 -0
  12. package/docs/cache/README.md +360 -0
  13. package/docs/castValues.md +47 -0
  14. package/docs/concurrentCalls/-internal-.md +416 -0
  15. package/docs/concurrentCalls/README.md +77 -0
  16. package/docs/consoleFmt.md +91 -0
  17. package/docs/conversions.md +27 -0
  18. package/docs/createThrottleController/-internal-.md +73 -0
  19. package/docs/createThrottleController/README.md +31 -0
  20. package/docs/debounce.md +188 -0
  21. package/docs/dedent.md +117 -0
  22. package/docs/deepEqual.md +94 -0
  23. package/docs/enhancedMap.md +358 -0
  24. package/docs/exhaustiveMatch/-internal-.md +39 -0
  25. package/docs/exhaustiveMatch/README.md +146 -0
  26. package/docs/getAutoIncrementId.md +93 -0
  27. package/docs/getCompositeKey.md +39 -0
  28. package/docs/getValueStableKey.md +57 -0
  29. package/docs/hash.md +31 -0
  30. package/docs/interpolate/-internal-.md +61 -0
  31. package/docs/interpolate/README.md +62 -0
  32. package/docs/levenshtein.md +93 -0
  33. package/docs/main.md +21 -0
  34. package/docs/mathUtils.md +137 -0
  35. package/docs/modules.md +52 -0
  36. package/docs/objUtils.md +237 -0
  37. package/docs/parallelAsyncCalls/-internal-.md +347 -0
  38. package/docs/parallelAsyncCalls/README.md +45 -0
  39. package/docs/promiseUtils/-internal-.md +69 -0
  40. package/docs/promiseUtils/README.md +31 -0
  41. package/docs/retryOnError.md +67 -0
  42. package/docs/runShellCmd/-internal-.md +111 -0
  43. package/docs/runShellCmd/README.md +201 -0
  44. package/docs/safeJson.md +51 -0
  45. package/docs/saferTyping.md +228 -0
  46. package/docs/serializeXML.md +100 -0
  47. package/docs/shallowEqual.md +33 -0
  48. package/docs/sleep.md +27 -0
  49. package/docs/stringUtils/-internal-.md +17 -0
  50. package/docs/stringUtils/README.md +166 -0
  51. package/docs/testUtils.md +315 -0
  52. package/docs/throttle/-internal-.md +47 -0
  53. package/docs/throttle/README.md +178 -0
  54. package/docs/time.md +274 -0
  55. package/docs/timers.md +256 -0
  56. package/docs/tsResult/-internal-.md +327 -0
  57. package/docs/tsResult/README.md +696 -0
  58. package/docs/typeGuards.md +399 -0
  59. package/docs/typingFnUtils/-internal-.md +27 -0
  60. package/docs/typingFnUtils/README.md +293 -0
  61. package/docs/typingTestUtils.md +172 -0
  62. package/docs/typingUtils.md +111 -0
  63. package/docs/yamlStringify.md +45 -0
  64. package/lib/arrayUtils.js +3 -3
  65. package/lib/assertions.js +2 -2
  66. package/lib/awaitDebounce.cjs +106 -0
  67. package/lib/awaitDebounce.d.cts +38 -0
  68. package/lib/awaitDebounce.d.ts +38 -0
  69. package/lib/awaitDebounce.js +28 -0
  70. package/lib/cache.js +2 -2
  71. package/lib/{chunk-NH2LCAQS.js → chunk-6FIBVC2P.js} +1 -1
  72. package/lib/{chunk-GKOTKAIV.js → chunk-7CQPOM5I.js} +1 -1
  73. package/lib/{chunk-WS4WEVHU.js → chunk-C2SVCIWE.js} +1 -1
  74. package/lib/{chunk-SSKW673U.js → chunk-JF2MDHOJ.js} +5 -1
  75. package/lib/chunk-NW5H5EW7.js +100 -0
  76. package/lib/{chunk-DMW5Q4T2.js → chunk-SRVMMYSW.js} +1 -1
  77. package/lib/concurrentCalls.js +3 -3
  78. package/lib/createThrottleController.js +3 -3
  79. package/lib/debounce.js +4 -95
  80. package/lib/enhancedMap.js +3 -3
  81. package/lib/getAutoIncrementId.cjs +44 -0
  82. package/lib/getAutoIncrementId.d.cts +44 -0
  83. package/lib/getAutoIncrementId.d.ts +44 -0
  84. package/lib/getAutoIncrementId.js +18 -0
  85. package/lib/getCompositeKey.js +3 -3
  86. package/lib/getValueStableKey.js +3 -3
  87. package/lib/interpolate.js +2 -2
  88. package/lib/parallelAsyncCalls.js +2 -2
  89. package/lib/runShellCmd.d.cts +50 -0
  90. package/lib/runShellCmd.d.ts +50 -0
  91. package/lib/serializeXML.cjs +7 -2
  92. package/lib/serializeXML.d.cts +1 -1
  93. package/lib/serializeXML.d.ts +1 -1
  94. package/lib/serializeXML.js +7 -5
  95. package/lib/testUtils.js +3 -3
  96. package/lib/throttle.cjs +250 -0
  97. package/lib/throttle.d.cts +89 -0
  98. package/lib/throttle.d.ts +89 -0
  99. package/lib/throttle.js +38 -0
  100. package/lib/timers.cjs +93 -0
  101. package/lib/timers.d.cts +110 -0
  102. package/lib/timers.d.ts +110 -0
  103. package/lib/timers.js +65 -0
  104. package/lib/tsResult.js +2 -2
  105. package/lib/typeGuards.cjs +7 -2
  106. package/lib/typeGuards.d.cts +2 -1
  107. package/lib/typeGuards.d.ts +2 -1
  108. package/lib/typeGuards.js +5 -3
  109. package/lib/typingFnUtils.cjs +5 -1
  110. package/lib/typingFnUtils.d.cts +1 -1
  111. package/lib/typingFnUtils.d.ts +1 -1
  112. package/lib/typingFnUtils.js +5 -1
  113. package/lib/yamlStringify.js +5 -5
  114. package/package.json +26 -12
@@ -0,0 +1,327 @@
1
+ [**@ls-stack/utils**](../README.md)
2
+
3
+ ***
4
+
5
+ [@ls-stack/utils](../modules.md) / [tsResult](README.md) / \<internal\>
6
+
7
+ # \<internal\>
8
+
9
+ ## Type Aliases
10
+
11
+ ### AnyResultMethods
12
+
13
+ ```ts
14
+ type AnyResultMethods = Record<ResultMethodsKeys, never>;
15
+ ```
16
+
17
+ Defined in: [packages/utils/src/tsResult.ts:10](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L10)
18
+
19
+ ***
20
+
21
+ ### Err\<E\>
22
+
23
+ ```ts
24
+ type Err<E> = object & AnyResultMethods;
25
+ ```
26
+
27
+ Defined in: [packages/utils/src/tsResult.ts:20](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L20)
28
+
29
+ #### Type declaration
30
+
31
+ ##### error
32
+
33
+ ```ts
34
+ error: E;
35
+ ```
36
+
37
+ ##### ~~errorResult()~~
38
+
39
+ ```ts
40
+ errorResult: () => Err<E>;
41
+ ```
42
+
43
+ ###### Returns
44
+
45
+ [`Err`](#err)\<`E`\>
46
+
47
+ ###### Deprecated
48
+
49
+ Use `t-result` library instead.
50
+
51
+ ##### ok
52
+
53
+ ```ts
54
+ ok: false;
55
+ ```
56
+
57
+ #### Type Parameters
58
+
59
+ ##### E
60
+
61
+ `E` *extends* [`ResultValidErrors`](README.md#resultvaliderrors)
62
+
63
+ ***
64
+
65
+ ### Ok\<T\>
66
+
67
+ ```ts
68
+ type Ok<T> = object & AnyResultMethods;
69
+ ```
70
+
71
+ Defined in: [packages/utils/src/tsResult.ts:4](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L4)
72
+
73
+ #### Type declaration
74
+
75
+ ##### error
76
+
77
+ ```ts
78
+ error: false;
79
+ ```
80
+
81
+ ##### ok
82
+
83
+ ```ts
84
+ ok: true;
85
+ ```
86
+
87
+ ##### value
88
+
89
+ ```ts
90
+ value: T;
91
+ ```
92
+
93
+ #### Type Parameters
94
+
95
+ ##### T
96
+
97
+ `T`
98
+
99
+ ***
100
+
101
+ ### ResultMethods\<T, E\>
102
+
103
+ ```ts
104
+ type ResultMethods<T, E> = object;
105
+ ```
106
+
107
+ Defined in: [packages/utils/src/tsResult.ts:27](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L27)
108
+
109
+ #### Type Parameters
110
+
111
+ ##### T
112
+
113
+ `T`
114
+
115
+ ##### E
116
+
117
+ `E` *extends* [`ResultValidErrors`](README.md#resultvaliderrors)
118
+
119
+ #### Properties
120
+
121
+ ##### ~~ifErr()~~
122
+
123
+ ```ts
124
+ ifErr: (fn) => Result<T, E>;
125
+ ```
126
+
127
+ Defined in: [packages/utils/src/tsResult.ts:48](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L48)
128
+
129
+ ###### Parameters
130
+
131
+ ###### fn
132
+
133
+ (`error`) => `void`
134
+
135
+ ###### Returns
136
+
137
+ [`Result`](README.md#result)\<`T`, `E`\>
138
+
139
+ ###### Deprecated
140
+
141
+ Use `t-result` library instead.
142
+
143
+ ##### ~~ifOk()~~
144
+
145
+ ```ts
146
+ ifOk: (fn) => Result<T, E>;
147
+ ```
148
+
149
+ Defined in: [packages/utils/src/tsResult.ts:46](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L46)
150
+
151
+ ###### Parameters
152
+
153
+ ###### fn
154
+
155
+ (`value`) => `void`
156
+
157
+ ###### Returns
158
+
159
+ [`Result`](README.md#result)\<`T`, `E`\>
160
+
161
+ ###### Deprecated
162
+
163
+ Use `t-result` library instead.
164
+
165
+ ##### ~~mapErr()~~
166
+
167
+ ```ts
168
+ mapErr: <NewError>(mapFn) => Result<T, NewError>;
169
+ ```
170
+
171
+ Defined in: [packages/utils/src/tsResult.ts:37](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L37)
172
+
173
+ ###### Type Parameters
174
+
175
+ ###### NewError
176
+
177
+ `NewError` *extends* [`ResultValidErrors`](README.md#resultvaliderrors)
178
+
179
+ ###### Parameters
180
+
181
+ ###### mapFn
182
+
183
+ (`error`) => `NewError`
184
+
185
+ ###### Returns
186
+
187
+ [`Result`](README.md#result)\<`T`, `NewError`\>
188
+
189
+ ###### Deprecated
190
+
191
+ Use `t-result` library instead.
192
+
193
+ ##### ~~mapOk()~~
194
+
195
+ ```ts
196
+ mapOk: <NewValue>(mapFn) => Result<NewValue, E>;
197
+ ```
198
+
199
+ Defined in: [packages/utils/src/tsResult.ts:35](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L35)
200
+
201
+ ###### Type Parameters
202
+
203
+ ###### NewValue
204
+
205
+ `NewValue`
206
+
207
+ ###### Parameters
208
+
209
+ ###### mapFn
210
+
211
+ (`value`) => `NewValue`
212
+
213
+ ###### Returns
214
+
215
+ [`Result`](README.md#result)\<`NewValue`, `E`\>
216
+
217
+ ###### Deprecated
218
+
219
+ Use `t-result` library instead.
220
+
221
+ ##### ~~mapOkAndErr()~~
222
+
223
+ ```ts
224
+ mapOkAndErr: <NewValue, NewError>(mapFns) => Result<NewValue, NewError>;
225
+ ```
226
+
227
+ Defined in: [packages/utils/src/tsResult.ts:41](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L41)
228
+
229
+ ###### Type Parameters
230
+
231
+ ###### NewValue
232
+
233
+ `NewValue`
234
+
235
+ ###### NewError
236
+
237
+ `NewError` *extends* [`ResultValidErrors`](README.md#resultvaliderrors)
238
+
239
+ ###### Parameters
240
+
241
+ ###### mapFns
242
+
243
+ ###### err
244
+
245
+ (`error`) => `NewError`
246
+
247
+ ###### ok
248
+
249
+ (`value`) => `NewValue`
250
+
251
+ ###### Returns
252
+
253
+ [`Result`](README.md#result)\<`NewValue`, `NewError`\>
254
+
255
+ ###### Deprecated
256
+
257
+ Use `t-result` library instead.
258
+
259
+ ##### ~~unwrap()~~
260
+
261
+ ```ts
262
+ unwrap: () => T;
263
+ ```
264
+
265
+ Defined in: [packages/utils/src/tsResult.ts:33](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L33)
266
+
267
+ ###### Returns
268
+
269
+ `T`
270
+
271
+ ###### Deprecated
272
+
273
+ Use `t-result` library instead.
274
+
275
+ ##### ~~unwrapOr()~~
276
+
277
+ ```ts
278
+ unwrapOr: <R>(defaultValue) => T | R;
279
+ ```
280
+
281
+ Defined in: [packages/utils/src/tsResult.ts:31](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L31)
282
+
283
+ ###### Type Parameters
284
+
285
+ ###### R
286
+
287
+ `R` *extends* `T`
288
+
289
+ ###### Parameters
290
+
291
+ ###### defaultValue
292
+
293
+ `R`
294
+
295
+ ###### Returns
296
+
297
+ `T` \| `R`
298
+
299
+ ###### Deprecated
300
+
301
+ Use `t-result` library instead.
302
+
303
+ ##### ~~unwrapOrNull()~~
304
+
305
+ ```ts
306
+ unwrapOrNull: () => T | null;
307
+ ```
308
+
309
+ Defined in: [packages/utils/src/tsResult.ts:29](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L29)
310
+
311
+ ###### Returns
312
+
313
+ `T` \| `null`
314
+
315
+ ###### Deprecated
316
+
317
+ Use `t-result` library instead.
318
+
319
+ ***
320
+
321
+ ### ResultMethodsKeys
322
+
323
+ ```ts
324
+ type ResultMethodsKeys = keyof ResultMethods<any, any>;
325
+ ```
326
+
327
+ Defined in: [packages/utils/src/tsResult.ts:58](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L58)