@ls-stack/utils 3.22.0 → 3.24.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/docs/concurrentCalls/-internal-.md +28 -26
- package/docs/concurrentCalls/README.md +2 -2
- package/docs/testUtils.md +27 -3
- package/docs/yamlStringify.md +53 -15
- package/lib/chunk-JAPKLFIK.js +353 -0
- package/lib/concurrentCalls.cjs +18 -34
- package/lib/concurrentCalls.d.cts +3 -3
- package/lib/concurrentCalls.d.ts +3 -3
- package/lib/concurrentCalls.js +22 -36
- package/lib/testUtils.cjs +538 -0
- package/lib/testUtils.d.cts +16 -1
- package/lib/testUtils.d.ts +16 -1
- package/lib/testUtils.js +172 -1
- package/lib/yamlStringify.cjs +83 -30
- package/lib/yamlStringify.d.cts +5 -3
- package/lib/yamlStringify.d.ts +5 -3
- package/lib/yamlStringify.js +4 -291
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
### ConcurrentCalls\<R, E\>
|
|
12
12
|
|
|
13
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
13
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:31](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L31)
|
|
14
14
|
|
|
15
15
|
#### Type Parameters
|
|
16
16
|
|
|
@@ -42,7 +42,7 @@ new ConcurrentCalls<R, E>(): ConcurrentCalls<R, E>;
|
|
|
42
42
|
add(...calls): this;
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
45
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:35](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L35)
|
|
46
46
|
|
|
47
47
|
###### Parameters
|
|
48
48
|
|
|
@@ -60,13 +60,13 @@ Defined in: [packages/utils/src/concurrentCalls.ts:36](https://github.com/lucaso
|
|
|
60
60
|
resultifyAdd(...calls): this;
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
63
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:41](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L41)
|
|
64
64
|
|
|
65
65
|
###### Parameters
|
|
66
66
|
|
|
67
67
|
###### calls
|
|
68
68
|
|
|
69
|
-
...(
|
|
69
|
+
...(() => `R` \| () => `Promise`\<`R`\>)[]
|
|
70
70
|
|
|
71
71
|
###### Returns
|
|
72
72
|
|
|
@@ -78,7 +78,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:42](https://github.com/lucaso
|
|
|
78
78
|
runAll(__namedParameters): Promise<Result<R[], E>>;
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
81
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:58](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L58)
|
|
82
82
|
|
|
83
83
|
###### Parameters
|
|
84
84
|
|
|
@@ -102,7 +102,7 @@ runAllSettled(__namedParameters): Promise<{
|
|
|
102
102
|
}>;
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
105
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:90](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L90)
|
|
106
106
|
|
|
107
107
|
###### Parameters
|
|
108
108
|
|
|
@@ -124,7 +124,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:112](https://github.com/lucas
|
|
|
124
124
|
|
|
125
125
|
### ConcurrentCallsWithMetadata\<M, R, E\>
|
|
126
126
|
|
|
127
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
127
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:157](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L157)
|
|
128
128
|
|
|
129
129
|
#### Type Parameters
|
|
130
130
|
|
|
@@ -160,7 +160,7 @@ new ConcurrentCallsWithMetadata<M, R, E>(): ConcurrentCallsWithMetadata<M, R, E>
|
|
|
160
160
|
add(...calls): this;
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
163
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:165](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L165)
|
|
164
164
|
|
|
165
165
|
###### Parameters
|
|
166
166
|
|
|
@@ -178,7 +178,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:192](https://github.com/lucas
|
|
|
178
178
|
resultifyAdd(...items): this;
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
181
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:179](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L179)
|
|
182
182
|
|
|
183
183
|
###### Parameters
|
|
184
184
|
|
|
@@ -196,7 +196,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:206](https://github.com/lucas
|
|
|
196
196
|
runAll(__namedParameters): Promise<Result<SucceededCall<R, M>[], FailedCall<M, E>>>;
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
199
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:199](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L199)
|
|
200
200
|
|
|
201
201
|
###### Parameters
|
|
202
202
|
|
|
@@ -222,7 +222,7 @@ runAllSettled(__namedParameters): Promise<{
|
|
|
222
222
|
}>;
|
|
223
223
|
```
|
|
224
224
|
|
|
225
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
225
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:246](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L246)
|
|
226
226
|
|
|
227
227
|
###### Parameters
|
|
228
228
|
|
|
@@ -244,15 +244,13 @@ Defined in: [packages/utils/src/concurrentCalls.ts:274](https://github.com/lucas
|
|
|
244
244
|
|
|
245
245
|
## Type Aliases
|
|
246
246
|
|
|
247
|
-
### Action\<R, E\>
|
|
247
|
+
### Action()\<R, E\>
|
|
248
248
|
|
|
249
249
|
```ts
|
|
250
|
-
type Action<R, E> =
|
|
251
|
-
| () => Promise<Result<R, E>>
|
|
252
|
-
| Promise<Result<R, E>>;
|
|
250
|
+
type Action<R, E> = () => Promise<Result<R, E>>;
|
|
253
251
|
```
|
|
254
252
|
|
|
255
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
253
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:24](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L24)
|
|
256
254
|
|
|
257
255
|
#### Type Parameters
|
|
258
256
|
|
|
@@ -264,6 +262,10 @@ Defined in: [packages/utils/src/concurrentCalls.ts:23](https://github.com/lucaso
|
|
|
264
262
|
|
|
265
263
|
`E` *extends* `Error`
|
|
266
264
|
|
|
265
|
+
#### Returns
|
|
266
|
+
|
|
267
|
+
`Promise`\<`Result`\<`R`, `E`\>\>
|
|
268
|
+
|
|
267
269
|
***
|
|
268
270
|
|
|
269
271
|
### FailedCall\<M, E\>
|
|
@@ -272,7 +274,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:23](https://github.com/lucaso
|
|
|
272
274
|
type FailedCall<M, E> = object;
|
|
273
275
|
```
|
|
274
276
|
|
|
275
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
277
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:19](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L19)
|
|
276
278
|
|
|
277
279
|
#### Type Parameters
|
|
278
280
|
|
|
@@ -292,7 +294,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:18](https://github.com/lucaso
|
|
|
292
294
|
error: E;
|
|
293
295
|
```
|
|
294
296
|
|
|
295
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
297
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:21](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L21)
|
|
296
298
|
|
|
297
299
|
##### metadata
|
|
298
300
|
|
|
@@ -300,7 +302,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:20](https://github.com/lucaso
|
|
|
300
302
|
metadata: M;
|
|
301
303
|
```
|
|
302
304
|
|
|
303
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
305
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:20](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L20)
|
|
304
306
|
|
|
305
307
|
***
|
|
306
308
|
|
|
@@ -310,7 +312,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:19](https://github.com/lucaso
|
|
|
310
312
|
type RunProps = object;
|
|
311
313
|
```
|
|
312
314
|
|
|
313
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
315
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:10](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L10)
|
|
314
316
|
|
|
315
317
|
#### Properties
|
|
316
318
|
|
|
@@ -320,7 +322,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:9](https://github.com/lucasol
|
|
|
320
322
|
optional delayStart: (index) => number;
|
|
321
323
|
```
|
|
322
324
|
|
|
323
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
325
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:11](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L11)
|
|
324
326
|
|
|
325
327
|
###### Parameters
|
|
326
328
|
|
|
@@ -351,7 +353,7 @@ type SettledResultWithMetadata<R, M, E> =
|
|
|
351
353
|
};
|
|
352
354
|
```
|
|
353
355
|
|
|
354
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
356
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:27](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L27)
|
|
355
357
|
|
|
356
358
|
#### Type Parameters
|
|
357
359
|
|
|
@@ -375,7 +377,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:28](https://github.com/lucaso
|
|
|
375
377
|
type SucceededCall<R, M> = object;
|
|
376
378
|
```
|
|
377
379
|
|
|
378
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
380
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:15](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L15)
|
|
379
381
|
|
|
380
382
|
#### Type Parameters
|
|
381
383
|
|
|
@@ -395,7 +397,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:14](https://github.com/lucaso
|
|
|
395
397
|
metadata: M;
|
|
396
398
|
```
|
|
397
399
|
|
|
398
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
400
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:17](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L17)
|
|
399
401
|
|
|
400
402
|
##### value
|
|
401
403
|
|
|
@@ -403,7 +405,7 @@ Defined in: [packages/utils/src/concurrentCalls.ts:16](https://github.com/lucaso
|
|
|
403
405
|
value: R;
|
|
404
406
|
```
|
|
405
407
|
|
|
406
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
408
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:16](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L16)
|
|
407
409
|
|
|
408
410
|
***
|
|
409
411
|
|
|
@@ -413,4 +415,4 @@ Defined in: [packages/utils/src/concurrentCalls.ts:15](https://github.com/lucaso
|
|
|
413
415
|
type ValidMetadata = string | number | boolean | Record<string, unknown>;
|
|
414
416
|
```
|
|
415
417
|
|
|
416
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
418
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:8](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L8)
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
function concurrentCalls<R>(): ConcurrentCalls<R, Error>;
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
21
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:153](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L153)
|
|
22
22
|
|
|
23
23
|
Executes multiple asynchronous calls concurrently and collects the results in a easier to use format.
|
|
24
24
|
|
|
@@ -42,7 +42,7 @@ The type of the result value.
|
|
|
42
42
|
function concurrentCallsWithMetadata<M, R>(): ConcurrentCallsWithMetadata<M, R, Error>;
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Defined in: [packages/utils/src/concurrentCalls.ts:
|
|
45
|
+
Defined in: [packages/utils/src/concurrentCalls.ts:345](https://github.com/lucasols/utils/blob/main/packages/utils/src/concurrentCalls.ts#L345)
|
|
46
46
|
|
|
47
47
|
Executes multiple asynchronous calls concurrently and collects the results in a easier to use format.
|
|
48
48
|
|
package/docs/testUtils.md
CHANGED
|
@@ -8,13 +8,37 @@
|
|
|
8
8
|
|
|
9
9
|
## Functions
|
|
10
10
|
|
|
11
|
+
### compactSnapshot()
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
function compactSnapshot(value, __namedParameters): string;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Defined in: [packages/utils/src/testUtils.ts:439](https://github.com/lucasols/utils/blob/main/packages/utils/src/testUtils.ts#L439)
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
##### value
|
|
22
|
+
|
|
23
|
+
`unknown`
|
|
24
|
+
|
|
25
|
+
##### \_\_namedParameters
|
|
26
|
+
|
|
27
|
+
[`YamlStringifyOptions`](yamlStringify.md#yamlstringifyoptions) & `object` = `{}`
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
11
35
|
### createLoggerStore()
|
|
12
36
|
|
|
13
37
|
```ts
|
|
14
38
|
function createLoggerStore(__namedParameters): object;
|
|
15
39
|
```
|
|
16
40
|
|
|
17
|
-
Defined in: [packages/utils/src/testUtils.ts:
|
|
41
|
+
Defined in: [packages/utils/src/testUtils.ts:10](https://github.com/lucasols/utils/blob/main/packages/utils/src/testUtils.ts#L10)
|
|
18
42
|
|
|
19
43
|
#### Parameters
|
|
20
44
|
|
|
@@ -246,7 +270,7 @@ get snapshotFromLast(): string;
|
|
|
246
270
|
function getResultFn<T>(fnGetter, wrapper?): T;
|
|
247
271
|
```
|
|
248
272
|
|
|
249
|
-
Defined in: [packages/utils/src/testUtils.ts:
|
|
273
|
+
Defined in: [packages/utils/src/testUtils.ts:276](https://github.com/lucasols/utils/blob/main/packages/utils/src/testUtils.ts#L276)
|
|
250
274
|
|
|
251
275
|
#### Type Parameters
|
|
252
276
|
|
|
@@ -276,7 +300,7 @@ Defined in: [packages/utils/src/testUtils.ts:274](https://github.com/lucasols/ut
|
|
|
276
300
|
function waitController(): object;
|
|
277
301
|
```
|
|
278
302
|
|
|
279
|
-
Defined in: [packages/utils/src/testUtils.ts:
|
|
303
|
+
Defined in: [packages/utils/src/testUtils.ts:291](https://github.com/lucasols/utils/blob/main/packages/utils/src/testUtils.ts#L291)
|
|
280
304
|
|
|
281
305
|
#### Returns
|
|
282
306
|
|
package/docs/yamlStringify.md
CHANGED
|
@@ -6,39 +6,77 @@
|
|
|
6
6
|
|
|
7
7
|
# yamlStringify
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Type Aliases
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### YamlStringifyOptions
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
|
-
|
|
14
|
+
type YamlStringifyOptions = object;
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Defined in: [packages/utils/src/yamlStringify.ts:5](https://github.com/lucasols/utils/blob/main/packages/utils/src/yamlStringify.ts#L5)
|
|
18
18
|
|
|
19
|
-
####
|
|
19
|
+
#### Properties
|
|
20
20
|
|
|
21
|
-
#####
|
|
21
|
+
##### addRootObjSpaces?
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
```ts
|
|
24
|
+
optional addRootObjSpaces: "before" | "after" | "beforeAndAfter" | false;
|
|
25
|
+
```
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
Defined in: [packages/utils/src/yamlStringify.ts:15](https://github.com/lucasols/utils/blob/main/packages/utils/src/yamlStringify.ts#L15)
|
|
28
|
+
|
|
29
|
+
##### collapseObjects?
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
```ts
|
|
32
|
+
optional collapseObjects: boolean;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Defined in: [packages/utils/src/yamlStringify.ts:13](https://github.com/lucasols/utils/blob/main/packages/utils/src/yamlStringify.ts#L13)
|
|
36
|
+
|
|
37
|
+
##### maxDepth?
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
optional maxDepth: number;
|
|
41
|
+
```
|
|
28
42
|
|
|
29
|
-
|
|
43
|
+
Defined in: [packages/utils/src/yamlStringify.ts:11](https://github.com/lucasols/utils/blob/main/packages/utils/src/yamlStringify.ts#L11)
|
|
30
44
|
|
|
31
|
-
|
|
45
|
+
##### maxLineLength?
|
|
32
46
|
|
|
33
|
-
|
|
47
|
+
```ts
|
|
48
|
+
optional maxLineLength: number;
|
|
49
|
+
```
|
|
34
50
|
|
|
35
|
-
|
|
51
|
+
Defined in: [packages/utils/src/yamlStringify.ts:7](https://github.com/lucasols/utils/blob/main/packages/utils/src/yamlStringify.ts#L7)
|
|
36
52
|
|
|
37
|
-
|
|
53
|
+
##### showUndefined?
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
```ts
|
|
56
|
+
optional showUndefined: boolean;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Defined in: [packages/utils/src/yamlStringify.ts:9](https://github.com/lucasols/utils/blob/main/packages/utils/src/yamlStringify.ts#L9)
|
|
60
|
+
|
|
61
|
+
## Functions
|
|
62
|
+
|
|
63
|
+
### yamlStringify()
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
function yamlStringify(obj, __namedParameters): string;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Defined in: [packages/utils/src/yamlStringify.ts:18](https://github.com/lucasols/utils/blob/main/packages/utils/src/yamlStringify.ts#L18)
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
##### obj
|
|
74
|
+
|
|
75
|
+
`unknown`
|
|
76
|
+
|
|
77
|
+
##### \_\_namedParameters
|
|
40
78
|
|
|
41
|
-
`
|
|
79
|
+
[`YamlStringifyOptions`](#yamlstringifyoptions) = `{}`
|
|
42
80
|
|
|
43
81
|
#### Returns
|
|
44
82
|
|