@ls-stack/utils 3.39.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 (162) 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/consoleFmt.cjs +1 -0
  23. package/dist/consoleFmt.d.cts +6 -0
  24. package/dist/consoleFmt.d.ts +6 -0
  25. package/dist/consoleFmt.js +1 -0
  26. package/dist/debounce.d.cts +12 -20
  27. package/dist/debounce.d.ts +12 -20
  28. package/dist/dedent.d.cts +31 -31
  29. package/dist/dedent.d.ts +31 -31
  30. package/dist/deepEqual.d.cts +10 -9
  31. package/dist/deepEqual.d.ts +10 -9
  32. package/dist/filterObjectOrArrayKeys.d.cts +44 -19
  33. package/dist/filterObjectOrArrayKeys.d.ts +44 -19
  34. package/dist/getAutoIncrementId.d.cts +25 -23
  35. package/dist/getAutoIncrementId.d.ts +25 -23
  36. package/dist/getCompositeKey.d.cts +2 -1
  37. package/dist/getCompositeKey.d.ts +2 -1
  38. package/dist/getValueStableKey.d.cts +4 -3
  39. package/dist/getValueStableKey.d.ts +4 -3
  40. package/dist/mutationUtils.d.cts +2 -2
  41. package/dist/mutationUtils.d.ts +2 -2
  42. package/dist/objUtils.cjs +51 -2
  43. package/dist/objUtils.d.cts +8 -3
  44. package/dist/objUtils.d.ts +8 -3
  45. package/dist/objUtils.js +11 -3
  46. package/dist/parallelAsyncCalls.cjs +2 -1
  47. package/dist/parallelAsyncCalls.d.cts +5 -4
  48. package/dist/parallelAsyncCalls.d.ts +5 -4
  49. package/dist/parallelAsyncCalls.js +2 -1
  50. package/dist/retryOnError.d.cts +23 -20
  51. package/dist/retryOnError.d.ts +23 -20
  52. package/dist/runShellCmd.d.cts +40 -40
  53. package/dist/runShellCmd.d.ts +40 -40
  54. package/dist/safeJson.d.cts +6 -2
  55. package/dist/safeJson.d.ts +6 -2
  56. package/dist/saferTyping.d.cts +21 -14
  57. package/dist/saferTyping.d.ts +21 -14
  58. package/dist/shallowEqual.d.cts +1 -1
  59. package/dist/shallowEqual.d.ts +1 -1
  60. package/dist/stringUtils.cjs +2 -2
  61. package/dist/stringUtils.d.cts +6 -7
  62. package/dist/stringUtils.d.ts +6 -7
  63. package/dist/stringUtils.js +1 -1
  64. package/dist/testUtils.cjs +11 -9
  65. package/dist/testUtils.d.cts +32 -14
  66. package/dist/testUtils.d.ts +32 -14
  67. package/dist/testUtils.js +4 -3
  68. package/dist/throttle.d.cts +57 -48
  69. package/dist/throttle.d.ts +57 -48
  70. package/dist/timers.d.cts +68 -63
  71. package/dist/timers.d.ts +68 -63
  72. package/dist/tsResult.d.cts +7 -6
  73. package/dist/tsResult.d.ts +7 -6
  74. package/dist/typeGuards.d.cts +65 -64
  75. package/dist/typeGuards.d.ts +65 -64
  76. package/dist/typeUtils.d.cts +18 -4
  77. package/dist/typeUtils.d.ts +18 -4
  78. package/dist/typedStrings.d.cts +68 -57
  79. package/dist/typedStrings.d.ts +68 -57
  80. package/dist/typingFnUtils.d.cts +12 -6
  81. package/dist/typingFnUtils.d.ts +12 -6
  82. package/dist/typingFnUtils.js +12 -35
  83. package/dist/typingTestUtils.cjs +7 -1
  84. package/dist/typingTestUtils.d.cts +52 -11
  85. package/dist/typingTestUtils.d.ts +52 -11
  86. package/dist/typingTestUtils.js +7 -1
  87. package/dist/typingUtils.d.cts +4 -1
  88. package/dist/typingUtils.d.ts +4 -1
  89. package/dist/yamlStringify.cjs +11 -9
  90. package/dist/yamlStringify.js +2 -2
  91. package/package.json +6 -2
  92. package/docs/README.md +0 -72
  93. package/docs/_media/modules.md +0 -58
  94. package/docs/arrayUtils/-internal-.md +0 -179
  95. package/docs/arrayUtils/README.md +0 -550
  96. package/docs/assertions/-internal-.md +0 -63
  97. package/docs/assertions/README.md +0 -565
  98. package/docs/asyncQueue/-internal-.md +0 -297
  99. package/docs/asyncQueue/README.md +0 -1485
  100. package/docs/awaitDebounce.md +0 -66
  101. package/docs/cache/-internal-.md +0 -168
  102. package/docs/cache/README.md +0 -360
  103. package/docs/castValues.md +0 -47
  104. package/docs/concurrentCalls/-internal-.md +0 -490
  105. package/docs/concurrentCalls/README.md +0 -299
  106. package/docs/consoleFmt.md +0 -91
  107. package/docs/conversions.md +0 -27
  108. package/docs/createThrottleController/-internal-.md +0 -73
  109. package/docs/createThrottleController/README.md +0 -31
  110. package/docs/debounce.md +0 -188
  111. package/docs/dedent/-internal-.md +0 -17
  112. package/docs/dedent/README.md +0 -204
  113. package/docs/deepEqual.md +0 -94
  114. package/docs/enhancedMap.md +0 -358
  115. package/docs/exhaustiveMatch/-internal-.md +0 -39
  116. package/docs/exhaustiveMatch/README.md +0 -146
  117. package/docs/filterObjectOrArrayKeys.md +0 -109
  118. package/docs/getAutoIncrementId.md +0 -93
  119. package/docs/getCompositeKey.md +0 -39
  120. package/docs/getValueStableKey.md +0 -57
  121. package/docs/hash.md +0 -31
  122. package/docs/interpolate/-internal-.md +0 -61
  123. package/docs/interpolate/README.md +0 -62
  124. package/docs/keepPrevIfUnchanged.md +0 -43
  125. package/docs/levenshtein.md +0 -93
  126. package/docs/main.md +0 -21
  127. package/docs/mathUtils.md +0 -137
  128. package/docs/modules.md +0 -58
  129. package/docs/mutationUtils.md +0 -44
  130. package/docs/objUtils.md +0 -237
  131. package/docs/parallelAsyncCalls/-internal-.md +0 -347
  132. package/docs/parallelAsyncCalls/README.md +0 -45
  133. package/docs/promiseUtils/-internal-.md +0 -69
  134. package/docs/promiseUtils/README.md +0 -31
  135. package/docs/retryOnError/-internal-.md +0 -111
  136. package/docs/retryOnError/README.md +0 -168
  137. package/docs/runShellCmd/-internal-.md +0 -111
  138. package/docs/runShellCmd/README.md +0 -201
  139. package/docs/safeJson.md +0 -51
  140. package/docs/saferTyping.md +0 -228
  141. package/docs/serializeXML.md +0 -100
  142. package/docs/shallowEqual.md +0 -33
  143. package/docs/sleep.md +0 -27
  144. package/docs/stringUtils/-internal-.md +0 -17
  145. package/docs/stringUtils/README.md +0 -270
  146. package/docs/testUtils.md +0 -382
  147. package/docs/throttle/-internal-.md +0 -47
  148. package/docs/throttle/README.md +0 -178
  149. package/docs/time.md +0 -274
  150. package/docs/timers.md +0 -256
  151. package/docs/tsResult/-internal-.md +0 -327
  152. package/docs/tsResult/README.md +0 -702
  153. package/docs/typeGuards.md +0 -399
  154. package/docs/typeUtils/-internal-.md +0 -99
  155. package/docs/typeUtils/README.md +0 -195
  156. package/docs/typeUtils.typesTest.md +0 -7
  157. package/docs/typedStrings.md +0 -458
  158. package/docs/typingFnUtils/-internal-.md +0 -43
  159. package/docs/typingFnUtils/README.md +0 -317
  160. package/docs/typingTestUtils.md +0 -172
  161. package/docs/typingUtils.md +0 -135
  162. package/docs/yamlStringify.md +0 -83
@@ -1,299 +0,0 @@
1
- [**@ls-stack/utils**](../README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](../modules.md) / concurrentCalls
6
-
7
- # concurrentCalls
8
-
9
- ## Modules
10
-
11
- - [\<internal\>](-internal-.md)
12
-
13
- ## Classes
14
-
15
- ### ConcurrentCallsAggregateError
16
-
17
- Defined in: [packages/utils/src/concurrentCalls.ts:38](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L38)
18
-
19
- #### Extends
20
-
21
- - `AggregateError`
22
-
23
- #### Constructors
24
-
25
- ##### Constructor
26
-
27
- ```ts
28
- new ConcurrentCallsAggregateError(
29
- errors,
30
- total,
31
- failed): ConcurrentCallsAggregateError;
32
- ```
33
-
34
- Defined in: [packages/utils/src/concurrentCalls.ts:43](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L43)
35
-
36
- ###### Parameters
37
-
38
- ###### errors
39
-
40
- `ResultValidErrors`[]
41
-
42
- ###### total
43
-
44
- `number`
45
-
46
- ###### failed
47
-
48
- `number`
49
-
50
- ###### Returns
51
-
52
- [`ConcurrentCallsAggregateError`](#concurrentcallsaggregateerror)
53
-
54
- ###### Overrides
55
-
56
- ```ts
57
- AggregateError.constructor
58
- ```
59
-
60
- #### Properties
61
-
62
- ##### errors
63
-
64
- ```ts
65
- errors: ResultValidErrors[] = [];
66
- ```
67
-
68
- Defined in: [packages/utils/src/concurrentCalls.ts:39](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L39)
69
-
70
- ###### Overrides
71
-
72
- ```ts
73
- AggregateError.errors
74
- ```
75
-
76
- ##### failed
77
-
78
- ```ts
79
- failed: number = 0;
80
- ```
81
-
82
- Defined in: [packages/utils/src/concurrentCalls.ts:41](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L41)
83
-
84
- ##### total
85
-
86
- ```ts
87
- total: number = 0;
88
- ```
89
-
90
- Defined in: [packages/utils/src/concurrentCalls.ts:40](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L40)
91
-
92
- ***
93
-
94
- ### ConcurrentCallsWithMetadataAggregateError\<M\>
95
-
96
- Defined in: [packages/utils/src/concurrentCalls.ts:62](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L62)
97
-
98
- #### Extends
99
-
100
- - `AggregateError`
101
-
102
- #### Type Parameters
103
-
104
- ##### M
105
-
106
- `M` *extends* [`ValidMetadata`](-internal-.md#validmetadata)
107
-
108
- #### Constructors
109
-
110
- ##### Constructor
111
-
112
- ```ts
113
- new ConcurrentCallsWithMetadataAggregateError<M>(
114
- errors,
115
- total,
116
- failed): ConcurrentCallsWithMetadataAggregateError<M>;
117
- ```
118
-
119
- Defined in: [packages/utils/src/concurrentCalls.ts:70](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L70)
120
-
121
- ###### Parameters
122
-
123
- ###### errors
124
-
125
- `object`[]
126
-
127
- ###### total
128
-
129
- `number`
130
-
131
- ###### failed
132
-
133
- `number`
134
-
135
- ###### Returns
136
-
137
- [`ConcurrentCallsWithMetadataAggregateError`](#concurrentcallswithmetadataaggregateerror)\<`M`\>
138
-
139
- ###### Overrides
140
-
141
- ```ts
142
- AggregateError.constructor
143
- ```
144
-
145
- #### Properties
146
-
147
- ##### errors
148
-
149
- ```ts
150
- errors: ResultValidErrors[] = [];
151
- ```
152
-
153
- Defined in: [packages/utils/src/concurrentCalls.ts:65](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L65)
154
-
155
- ###### Overrides
156
-
157
- ```ts
158
- AggregateError.errors
159
- ```
160
-
161
- ##### errorsWithMetadata
162
-
163
- ```ts
164
- errorsWithMetadata: object[] = [];
165
- ```
166
-
167
- Defined in: [packages/utils/src/concurrentCalls.ts:66](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L66)
168
-
169
- ###### error
170
-
171
- ```ts
172
- error: ResultValidErrors;
173
- ```
174
-
175
- ###### metadata
176
-
177
- ```ts
178
- metadata: M;
179
- ```
180
-
181
- ##### failed
182
-
183
- ```ts
184
- failed: number = 0;
185
- ```
186
-
187
- Defined in: [packages/utils/src/concurrentCalls.ts:68](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L68)
188
-
189
- ##### total
190
-
191
- ```ts
192
- total: number = 0;
193
- ```
194
-
195
- Defined in: [packages/utils/src/concurrentCalls.ts:67](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L67)
196
-
197
- ## Functions
198
-
199
- ### concurrentCalls()
200
-
201
- ```ts
202
- function concurrentCalls<R>(): ConcurrentCalls<R, Error>;
203
- ```
204
-
205
- Defined in: [packages/utils/src/concurrentCalls.ts:273](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L273)
206
-
207
- Executes multiple asynchronous calls concurrently and collects the results in a easier to use format.
208
-
209
- #### Type Parameters
210
-
211
- ##### R
212
-
213
- `R` = `unknown`
214
-
215
- The type of the result value.
216
-
217
- #### Returns
218
-
219
- [`ConcurrentCalls`](-internal-.md#concurrentcalls)\<`R`, `Error`\>
220
-
221
- ***
222
-
223
- ### concurrentCallsWithMetadata()
224
-
225
- ```ts
226
- function concurrentCallsWithMetadata<M, R>(): ConcurrentCallsWithMetadata<M, R, Error>;
227
- ```
228
-
229
- Defined in: [packages/utils/src/concurrentCalls.ts:472](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L472)
230
-
231
- Executes multiple asynchronous calls concurrently with metadata for each call and collects the results in a easier to use format.
232
-
233
- #### Type Parameters
234
-
235
- ##### M
236
-
237
- `M` *extends* [`ValidMetadata`](-internal-.md#validmetadata)
238
-
239
- The type of the call metadata.
240
-
241
- ##### R
242
-
243
- `R` = `unknown`
244
-
245
- The type of the result value.
246
-
247
- #### Returns
248
-
249
- [`ConcurrentCallsWithMetadata`](-internal-.md#concurrentcallswithmetadata)\<`M`, `R`, `Error`\>
250
-
251
- ***
252
-
253
- ### concurrentResultCalls()
254
-
255
- ```ts
256
- function concurrentResultCalls<ResultFn>(): ConcurrentCalls<ValueFromResult<Awaited<ReturnType<ResultFn>>>, ErrorFromResult<Awaited<ReturnType<ResultFn>>>>;
257
- ```
258
-
259
- Defined in: [packages/utils/src/concurrentCalls.ts:487](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L487)
260
-
261
- Executes multiple asynchronous result calls concurrently and collects the results in a easier to use format.
262
-
263
- #### Type Parameters
264
-
265
- ##### ResultFn
266
-
267
- `ResultFn` *extends* (...`args`) => `Promise`\<`Result`\<`unknown`, `ResultValidErrors`\>\>
268
-
269
- #### Returns
270
-
271
- [`ConcurrentCalls`](-internal-.md#concurrentcalls)\<[`ValueFromResult`](-internal-.md#valuefromresult)\<`Awaited`\<`ReturnType`\<`ResultFn`\>\>\>, [`ErrorFromResult`](-internal-.md#errorfromresult)\<`Awaited`\<`ReturnType`\<`ResultFn`\>\>\>\>
272
-
273
- ***
274
-
275
- ### concurrentResultsWithMetadata()
276
-
277
- ```ts
278
- function concurrentResultsWithMetadata<M, ResultFn>(): ConcurrentCallsWithMetadata<M, ValueFromResult<Awaited<ReturnType<ResultFn>>>, ErrorFromResult<Awaited<ReturnType<ResultFn>>>>;
279
- ```
280
-
281
- Defined in: [packages/utils/src/concurrentCalls.ts:504](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L504)
282
-
283
- Executes multiple asynchronous result calls concurrently with metadata for each call and collects the results in a easier to use format.
284
-
285
- #### Type Parameters
286
-
287
- ##### M
288
-
289
- `M` *extends* [`ValidMetadata`](-internal-.md#validmetadata)
290
-
291
- ##### ResultFn
292
-
293
- `ResultFn` *extends* (...`args`) => `Promise`\<`Result`\<`unknown`, `ResultValidErrors`\>\>
294
-
295
- The type of the result function that will be called.
296
-
297
- #### Returns
298
-
299
- [`ConcurrentCallsWithMetadata`](-internal-.md#concurrentcallswithmetadata)\<`M`, [`ValueFromResult`](-internal-.md#valuefromresult)\<`Awaited`\<`ReturnType`\<`ResultFn`\>\>\>, [`ErrorFromResult`](-internal-.md#errorfromresult)\<`Awaited`\<`ReturnType`\<`ResultFn`\>\>\>\>
@@ -1,91 +0,0 @@
1
- [**@ls-stack/utils**](README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](modules.md) / consoleFmt
6
-
7
- # consoleFmt
8
-
9
- ## Variables
10
-
11
- ### consoleFmt
12
-
13
- ```ts
14
- const consoleFmt: object;
15
- ```
16
-
17
- Defined in: [packages/utils/src/consoleFmt.ts:56](https://github.com/lucasols/utils/blob/main/packages/utils/src/consoleFmt.ts#L56)
18
-
19
- #### Type declaration
20
-
21
- ##### bgColor()
22
-
23
- ```ts
24
- bgColor: (color, text) => string;
25
- ```
26
-
27
- ###### Parameters
28
-
29
- ###### color
30
-
31
- `"red"` | `"green"` | `"yellow"` | `"blue"` | `"magenta"` | `"cyan"` | `"white"` | `"black"` | `"gray"` | `"brightRed"` | `"brightGreen"` | `"brightYellow"` | `"brightBlue"` | `"brightMagenta"` | `"brightCyan"` | `"brightWhite"`
32
-
33
- ###### text
34
-
35
- `string`
36
-
37
- ###### Returns
38
-
39
- `string`
40
-
41
- ##### bold()
42
-
43
- ```ts
44
- bold: (text) => string;
45
- ```
46
-
47
- ###### Parameters
48
-
49
- ###### text
50
-
51
- `string`
52
-
53
- ###### Returns
54
-
55
- `string`
56
-
57
- ##### color()
58
-
59
- ```ts
60
- color: (color, text) => string = consoleColors;
61
- ```
62
-
63
- ###### Parameters
64
-
65
- ###### color
66
-
67
- `"red"` | `"green"` | `"yellow"` | `"blue"` | `"magenta"` | `"cyan"` | `"white"` | `"black"` | `"gray"` | `"brightRed"` | `"brightGreen"` | `"brightYellow"` | `"brightBlue"` | `"brightMagenta"` | `"brightCyan"` | `"brightWhite"`
68
-
69
- ###### text
70
-
71
- `string`
72
-
73
- ###### Returns
74
-
75
- `string`
76
-
77
- ##### underline()
78
-
79
- ```ts
80
- underline: (text) => string;
81
- ```
82
-
83
- ###### Parameters
84
-
85
- ###### text
86
-
87
- `string`
88
-
89
- ###### Returns
90
-
91
- `string`
@@ -1,27 +0,0 @@
1
- [**@ls-stack/utils**](README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](modules.md) / conversions
6
-
7
- # conversions
8
-
9
- ## Functions
10
-
11
- ### bytesToHumanReadable()
12
-
13
- ```ts
14
- function bytesToHumanReadable(bytes): string;
15
- ```
16
-
17
- Defined in: [packages/utils/src/conversions.ts:1](https://github.com/lucasols/utils/blob/main/packages/utils/src/conversions.ts#L1)
18
-
19
- #### Parameters
20
-
21
- ##### bytes
22
-
23
- `number`
24
-
25
- #### Returns
26
-
27
- `string`
@@ -1,73 +0,0 @@
1
- [**@ls-stack/utils**](../README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](../modules.md) / [createThrottleController](README.md) / \<internal\>
6
-
7
- # \<internal\>
8
-
9
- ## Type Aliases
10
-
11
- ### Options
12
-
13
- ```ts
14
- type Options = object;
15
- ```
16
-
17
- Defined in: [packages/utils/src/createThrottleController.ts:5](https://github.com/lucasols/utils/blob/main/packages/utils/src/createThrottleController.ts#L5)
18
-
19
- #### Properties
20
-
21
- ##### cleanupCheckSecsInterval?
22
-
23
- ```ts
24
- optional cleanupCheckSecsInterval: number;
25
- ```
26
-
27
- Defined in: [packages/utils/src/createThrottleController.ts:8](https://github.com/lucasols/utils/blob/main/packages/utils/src/createThrottleController.ts#L8)
28
-
29
- ##### maxCalls
30
-
31
- ```ts
32
- maxCalls: number;
33
- ```
34
-
35
- Defined in: [packages/utils/src/createThrottleController.ts:6](https://github.com/lucasols/utils/blob/main/packages/utils/src/createThrottleController.ts#L6)
36
-
37
- ##### per
38
-
39
- ```ts
40
- per: DurationObj;
41
- ```
42
-
43
- Defined in: [packages/utils/src/createThrottleController.ts:7](https://github.com/lucasols/utils/blob/main/packages/utils/src/createThrottleController.ts#L7)
44
-
45
- ***
46
-
47
- ### ThrottleController
48
-
49
- ```ts
50
- type ThrottleController = object;
51
- ```
52
-
53
- Defined in: [packages/utils/src/createThrottleController.ts:11](https://github.com/lucasols/utils/blob/main/packages/utils/src/createThrottleController.ts#L11)
54
-
55
- #### Properties
56
-
57
- ##### shouldSkip()
58
-
59
- ```ts
60
- shouldSkip: (callId?) => boolean;
61
- ```
62
-
63
- Defined in: [packages/utils/src/createThrottleController.ts:12](https://github.com/lucasols/utils/blob/main/packages/utils/src/createThrottleController.ts#L12)
64
-
65
- ###### Parameters
66
-
67
- ###### callId?
68
-
69
- `string` | `number` | (`string` \| `number`)[]
70
-
71
- ###### Returns
72
-
73
- `boolean`
@@ -1,31 +0,0 @@
1
- [**@ls-stack/utils**](../README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](../modules.md) / createThrottleController
6
-
7
- # createThrottleController
8
-
9
- ## Modules
10
-
11
- - [\<internal\>](-internal-.md)
12
-
13
- ## Functions
14
-
15
- ### createThrottleController()
16
-
17
- ```ts
18
- function createThrottleController(__namedParameters): ThrottleController;
19
- ```
20
-
21
- Defined in: [packages/utils/src/createThrottleController.ts:20](https://github.com/lucasols/utils/blob/main/packages/utils/src/createThrottleController.ts#L20)
22
-
23
- #### Parameters
24
-
25
- ##### \_\_namedParameters
26
-
27
- [`Options`](-internal-.md#options)
28
-
29
- #### Returns
30
-
31
- [`ThrottleController`](-internal-.md#throttlecontroller)
package/docs/debounce.md DELETED
@@ -1,188 +0,0 @@
1
- [**@ls-stack/utils**](README.md)
2
-
3
- ***
4
-
5
- [@ls-stack/utils](modules.md) / debounce
6
-
7
- # debounce
8
-
9
- ## Interfaces
10
-
11
- ### DebouncedFunc()\<T\>
12
-
13
- Defined in: [packages/utils/src/debounce.ts:16](https://github.com/lucasols/utils/blob/main/packages/utils/src/debounce.ts#L16)
14
-
15
- #### Type Parameters
16
-
17
- ##### T
18
-
19
- `T` *extends* (...`args`) => `void`
20
-
21
- ```ts
22
- DebouncedFunc(...args): undefined | ReturnType<T>;
23
- ```
24
-
25
- Defined in: [packages/utils/src/debounce.ts:26](https://github.com/lucasols/utils/blob/main/packages/utils/src/debounce.ts#L26)
26
-
27
- Call the original function, but applying the debounce rules.
28
-
29
- If the debounced function can be run immediately, this calls it and returns its return
30
- value.
31
-
32
- Otherwise, it returns the return value of the last invocation, or undefined if the debounced
33
- function was not invoked yet.
34
-
35
- #### Parameters
36
-
37
- ##### args
38
-
39
- ...`Parameters`\<`T`\>
40
-
41
- #### Returns
42
-
43
- `undefined` \| `ReturnType`\<`T`\>
44
-
45
- #### Properties
46
-
47
- ##### cancel()
48
-
49
- ```ts
50
- cancel: () => void;
51
- ```
52
-
53
- Defined in: [packages/utils/src/debounce.ts:31](https://github.com/lucasols/utils/blob/main/packages/utils/src/debounce.ts#L31)
54
-
55
- Throw away any pending invocation of the debounced function.
56
-
57
- ###### Returns
58
-
59
- `void`
60
-
61
- ##### flush()
62
-
63
- ```ts
64
- flush: () => undefined | ReturnType<T>;
65
- ```
66
-
67
- Defined in: [packages/utils/src/debounce.ts:40](https://github.com/lucasols/utils/blob/main/packages/utils/src/debounce.ts#L40)
68
-
69
- If there is a pending invocation of the debounced function, invoke it immediately and return
70
- its return value.
71
-
72
- Otherwise, return the value from the last invocation, or undefined if the debounced function
73
- was never invoked.
74
-
75
- ###### Returns
76
-
77
- `undefined` \| `ReturnType`\<`T`\>
78
-
79
- ## Type Aliases
80
-
81
- ### DebounceOptions
82
-
83
- ```ts
84
- type DebounceOptions = object;
85
- ```
86
-
87
- Defined in: [packages/utils/src/debounce.ts:1](https://github.com/lucasols/utils/blob/main/packages/utils/src/debounce.ts#L1)
88
-
89
- #### Properties
90
-
91
- ##### leading?
92
-
93
- ```ts
94
- optional leading: boolean;
95
- ```
96
-
97
- Defined in: [packages/utils/src/debounce.ts:5](https://github.com/lucasols/utils/blob/main/packages/utils/src/debounce.ts#L5)
98
-
99
- ###### See
100
-
101
- _.leading
102
-
103
- ##### maxWait?
104
-
105
- ```ts
106
- optional maxWait: number;
107
- ```
108
-
109
- Defined in: [packages/utils/src/debounce.ts:9](https://github.com/lucasols/utils/blob/main/packages/utils/src/debounce.ts#L9)
110
-
111
- ###### See
112
-
113
- _.maxWait
114
-
115
- ##### trailing?
116
-
117
- ```ts
118
- optional trailing: boolean;
119
- ```
120
-
121
- Defined in: [packages/utils/src/debounce.ts:13](https://github.com/lucasols/utils/blob/main/packages/utils/src/debounce.ts#L13)
122
-
123
- ###### See
124
-
125
- _.trailing
126
-
127
- ## Functions
128
-
129
- ### debounce()
130
-
131
- ```ts
132
- function debounce<T>(
133
- func,
134
- wait,
135
- options?): DebouncedFunc<T>;
136
- ```
137
-
138
- Defined in: [packages/utils/src/debounce.ts:44](https://github.com/lucasols/utils/blob/main/packages/utils/src/debounce.ts#L44)
139
-
140
- #### Type Parameters
141
-
142
- ##### T
143
-
144
- `T` *extends* (...`args`) => `void`
145
-
146
- #### Parameters
147
-
148
- ##### func
149
-
150
- `T`
151
-
152
- ##### wait
153
-
154
- `number`
155
-
156
- ##### options?
157
-
158
- [`DebounceOptions`](#debounceoptions)
159
-
160
- #### Returns
161
-
162
- [`DebouncedFunc`](#debouncedfunc)\<`T`\>
163
-
164
- ***
165
-
166
- ### isDebouncedFn()
167
-
168
- ```ts
169
- function isDebouncedFn<T>(fn): fn is T & { cancel: () => void; flush: () => undefined | ReturnType<T> };
170
- ```
171
-
172
- Defined in: [packages/utils/src/debounce.ts:176](https://github.com/lucasols/utils/blob/main/packages/utils/src/debounce.ts#L176)
173
-
174
- #### Type Parameters
175
-
176
- ##### T
177
-
178
- `T` *extends* (...`args`) => `void`
179
-
180
- #### Parameters
181
-
182
- ##### fn
183
-
184
- `T`
185
-
186
- #### Returns
187
-
188
- fn is T & \{ cancel: () =\> void; flush: () =\> undefined \| ReturnType\<T\> \}