@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.
- package/dist/arrayUtils.d.cts +70 -57
- package/dist/arrayUtils.d.ts +70 -57
- package/dist/assertions.d.cts +128 -117
- package/dist/assertions.d.ts +128 -117
- package/dist/asyncQueue.cjs +117 -112
- package/dist/asyncQueue.d.cts +217 -215
- package/dist/asyncQueue.d.ts +217 -215
- package/dist/asyncQueue.js +117 -112
- package/dist/awaitDebounce.d.cts +26 -23
- package/dist/awaitDebounce.d.ts +26 -23
- package/dist/cache.cjs +2 -1
- package/dist/cache.d.cts +15 -9
- package/dist/cache.d.ts +15 -9
- package/dist/cache.js +2 -1
- package/dist/{chunk-GHAQOUA6.js → chunk-23KPGKDT.js} +22 -1
- package/dist/{chunk-ADM37GSC.js → chunk-7L4KCZJJ.js} +12 -10
- package/dist/{chunk-KW55OTUG.js → chunk-B3KFV2MH.js} +2 -2
- package/dist/chunk-DTE2QMWE.js +48 -0
- package/dist/concurrentCalls.d.cts +8 -4
- package/dist/concurrentCalls.d.ts +8 -4
- package/dist/concurrentCalls.js +1 -1
- package/dist/debounce.d.cts +12 -20
- package/dist/debounce.d.ts +12 -20
- package/dist/dedent.d.cts +31 -31
- package/dist/dedent.d.ts +31 -31
- package/dist/deepEqual.d.cts +10 -9
- package/dist/deepEqual.d.ts +10 -9
- package/dist/filterObjectOrArrayKeys.d.cts +44 -19
- package/dist/filterObjectOrArrayKeys.d.ts +44 -19
- package/dist/getAutoIncrementId.d.cts +25 -23
- package/dist/getAutoIncrementId.d.ts +25 -23
- package/dist/getCompositeKey.d.cts +2 -1
- package/dist/getCompositeKey.d.ts +2 -1
- package/dist/getValueStableKey.d.cts +4 -3
- package/dist/getValueStableKey.d.ts +4 -3
- package/dist/mutationUtils.d.cts +2 -2
- package/dist/mutationUtils.d.ts +2 -2
- package/dist/objUtils.cjs +51 -2
- package/dist/objUtils.d.cts +8 -3
- package/dist/objUtils.d.ts +8 -3
- package/dist/objUtils.js +11 -3
- package/dist/parallelAsyncCalls.cjs +2 -1
- package/dist/parallelAsyncCalls.d.cts +5 -4
- package/dist/parallelAsyncCalls.d.ts +5 -4
- package/dist/parallelAsyncCalls.js +2 -1
- package/dist/retryOnError.d.cts +23 -20
- package/dist/retryOnError.d.ts +23 -20
- package/dist/runShellCmd.d.cts +40 -40
- package/dist/runShellCmd.d.ts +40 -40
- package/dist/safeJson.d.cts +6 -2
- package/dist/safeJson.d.ts +6 -2
- package/dist/saferTyping.d.cts +21 -14
- package/dist/saferTyping.d.ts +21 -14
- package/dist/shallowEqual.d.cts +1 -1
- package/dist/shallowEqual.d.ts +1 -1
- package/dist/stringUtils.cjs +2 -2
- package/dist/stringUtils.d.cts +6 -7
- package/dist/stringUtils.d.ts +6 -7
- package/dist/stringUtils.js +1 -1
- package/dist/testUtils.cjs +11 -9
- package/dist/testUtils.d.cts +32 -14
- package/dist/testUtils.d.ts +32 -14
- package/dist/testUtils.js +4 -3
- package/dist/throttle.d.cts +57 -48
- package/dist/throttle.d.ts +57 -48
- package/dist/timers.d.cts +68 -63
- package/dist/timers.d.ts +68 -63
- package/dist/tsResult.d.cts +7 -6
- package/dist/tsResult.d.ts +7 -6
- package/dist/typeGuards.d.cts +65 -64
- package/dist/typeGuards.d.ts +65 -64
- package/dist/typeUtils.d.cts +18 -4
- package/dist/typeUtils.d.ts +18 -4
- package/dist/typedStrings.d.cts +68 -57
- package/dist/typedStrings.d.ts +68 -57
- package/dist/typingFnUtils.d.cts +12 -6
- package/dist/typingFnUtils.d.ts +12 -6
- package/dist/typingFnUtils.js +12 -35
- package/dist/typingTestUtils.cjs +7 -1
- package/dist/typingTestUtils.d.cts +52 -11
- package/dist/typingTestUtils.d.ts +52 -11
- package/dist/typingTestUtils.js +7 -1
- package/dist/typingUtils.d.cts +4 -1
- package/dist/typingUtils.d.ts +4 -1
- package/dist/yamlStringify.cjs +11 -9
- package/dist/yamlStringify.js +2 -2
- package/package.json +5 -1
- package/docs/README.md +0 -72
- package/docs/_media/modules.md +0 -58
- package/docs/arrayUtils/-internal-.md +0 -179
- package/docs/arrayUtils/README.md +0 -550
- package/docs/assertions/-internal-.md +0 -63
- package/docs/assertions/README.md +0 -565
- package/docs/asyncQueue/-internal-.md +0 -297
- package/docs/asyncQueue/README.md +0 -1485
- package/docs/awaitDebounce.md +0 -66
- package/docs/cache/-internal-.md +0 -168
- package/docs/cache/README.md +0 -360
- package/docs/castValues.md +0 -47
- package/docs/concurrentCalls/-internal-.md +0 -490
- package/docs/concurrentCalls/README.md +0 -299
- package/docs/consoleFmt.md +0 -115
- package/docs/conversions.md +0 -27
- package/docs/createThrottleController/-internal-.md +0 -73
- package/docs/createThrottleController/README.md +0 -31
- package/docs/debounce.md +0 -188
- package/docs/dedent/-internal-.md +0 -17
- package/docs/dedent/README.md +0 -204
- package/docs/deepEqual.md +0 -94
- package/docs/enhancedMap.md +0 -358
- package/docs/exhaustiveMatch/-internal-.md +0 -39
- package/docs/exhaustiveMatch/README.md +0 -146
- package/docs/filterObjectOrArrayKeys.md +0 -109
- package/docs/getAutoIncrementId.md +0 -93
- package/docs/getCompositeKey.md +0 -39
- package/docs/getValueStableKey.md +0 -57
- package/docs/hash.md +0 -31
- package/docs/interpolate/-internal-.md +0 -61
- package/docs/interpolate/README.md +0 -62
- package/docs/keepPrevIfUnchanged.md +0 -43
- package/docs/levenshtein.md +0 -93
- package/docs/main.md +0 -21
- package/docs/mathUtils.md +0 -137
- package/docs/modules.md +0 -58
- package/docs/mutationUtils.md +0 -44
- package/docs/objUtils.md +0 -237
- package/docs/parallelAsyncCalls/-internal-.md +0 -347
- package/docs/parallelAsyncCalls/README.md +0 -45
- package/docs/promiseUtils/-internal-.md +0 -69
- package/docs/promiseUtils/README.md +0 -31
- package/docs/retryOnError/-internal-.md +0 -111
- package/docs/retryOnError/README.md +0 -168
- package/docs/runShellCmd/-internal-.md +0 -111
- package/docs/runShellCmd/README.md +0 -201
- package/docs/safeJson.md +0 -51
- package/docs/saferTyping.md +0 -228
- package/docs/serializeXML.md +0 -100
- package/docs/shallowEqual.md +0 -33
- package/docs/sleep.md +0 -27
- package/docs/stringUtils/-internal-.md +0 -17
- package/docs/stringUtils/README.md +0 -270
- package/docs/testUtils.md +0 -382
- package/docs/throttle/-internal-.md +0 -47
- package/docs/throttle/README.md +0 -178
- package/docs/time.md +0 -274
- package/docs/timers.md +0 -256
- package/docs/tsResult/-internal-.md +0 -327
- package/docs/tsResult/README.md +0 -702
- package/docs/typeGuards.md +0 -399
- package/docs/typeUtils/-internal-.md +0 -99
- package/docs/typeUtils/README.md +0 -195
- package/docs/typeUtils.typesTest.md +0 -7
- package/docs/typedStrings.md +0 -458
- package/docs/typingFnUtils/-internal-.md +0 -43
- package/docs/typingFnUtils/README.md +0 -317
- package/docs/typingTestUtils.md +0 -172
- package/docs/typingUtils.md +0 -135
- 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`\>\>\>\>
|
package/docs/consoleFmt.md
DELETED
|
@@ -1,115 +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:61](https://github.com/lucasols/utils/blob/main/packages/utils/src/consoleFmt.ts#L61)
|
|
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
|
-
###### Deprecated
|
|
42
|
-
|
|
43
|
-
Use `styleText` from `node:util` instead.
|
|
44
|
-
|
|
45
|
-
##### ~~bold()~~
|
|
46
|
-
|
|
47
|
-
```ts
|
|
48
|
-
bold: (text) => string;
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
###### Parameters
|
|
52
|
-
|
|
53
|
-
###### text
|
|
54
|
-
|
|
55
|
-
`string`
|
|
56
|
-
|
|
57
|
-
###### Returns
|
|
58
|
-
|
|
59
|
-
`string`
|
|
60
|
-
|
|
61
|
-
###### Deprecated
|
|
62
|
-
|
|
63
|
-
Use `styleText` from `node:util` instead.
|
|
64
|
-
|
|
65
|
-
##### ~~color()~~
|
|
66
|
-
|
|
67
|
-
```ts
|
|
68
|
-
color: (color, text) => string = consoleColors;
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
###### Parameters
|
|
72
|
-
|
|
73
|
-
###### color
|
|
74
|
-
|
|
75
|
-
`"red"` | `"green"` | `"yellow"` | `"blue"` | `"magenta"` | `"cyan"` | `"white"` | `"black"` | `"gray"` | `"brightRed"` | `"brightGreen"` | `"brightYellow"` | `"brightBlue"` | `"brightMagenta"` | `"brightCyan"` | `"brightWhite"`
|
|
76
|
-
|
|
77
|
-
###### text
|
|
78
|
-
|
|
79
|
-
`string`
|
|
80
|
-
|
|
81
|
-
###### Returns
|
|
82
|
-
|
|
83
|
-
`string`
|
|
84
|
-
|
|
85
|
-
###### Deprecated
|
|
86
|
-
|
|
87
|
-
Use `styleText` from `node:util` instead.
|
|
88
|
-
|
|
89
|
-
###### Deprecated
|
|
90
|
-
|
|
91
|
-
Use `styleText` from `node:util` instead.
|
|
92
|
-
|
|
93
|
-
##### ~~underline()~~
|
|
94
|
-
|
|
95
|
-
```ts
|
|
96
|
-
underline: (text) => string;
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
###### Parameters
|
|
100
|
-
|
|
101
|
-
###### text
|
|
102
|
-
|
|
103
|
-
`string`
|
|
104
|
-
|
|
105
|
-
###### Returns
|
|
106
|
-
|
|
107
|
-
`string`
|
|
108
|
-
|
|
109
|
-
###### Deprecated
|
|
110
|
-
|
|
111
|
-
Use `styleText` from `node:util` instead.
|
|
112
|
-
|
|
113
|
-
#### Deprecated
|
|
114
|
-
|
|
115
|
-
Use `styleText` from `node:util` instead.
|
package/docs/conversions.md
DELETED
|
@@ -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)
|