@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,696 @@
1
+ [**@ls-stack/utils**](../README.md)
2
+
3
+ ***
4
+
5
+ [@ls-stack/utils](../modules.md) / tsResult
6
+
7
+ # tsResult
8
+
9
+ ## Modules
10
+
11
+ - [\<internal\>](-internal-.md)
12
+
13
+ ## Type Aliases
14
+
15
+ ### ~~GetTypedResult\<R\>~~
16
+
17
+ ```ts
18
+ type GetTypedResult<R> = TypedResult<R extends Result<infer T, any> ? T : never, R extends Result<any, infer E> ? E : never>;
19
+ ```
20
+
21
+ Defined in: [packages/utils/src/tsResult.ts:328](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L328)
22
+
23
+ #### Type Parameters
24
+
25
+ ##### R
26
+
27
+ `R` *extends* [`Result`](#result)\<`any`, `any`\>
28
+
29
+ #### Deprecated
30
+
31
+ Use `t-result` library instead.
32
+
33
+ ***
34
+
35
+ ### ~~Result\<T, E\>~~
36
+
37
+ ```ts
38
+ type Result<T, E> =
39
+ | Omit<Ok<T>, ResultMethodsKeys>
40
+ | Omit<Err<E>, ResultMethodsKeys> & ResultMethods<T, E>;
41
+ ```
42
+
43
+ Defined in: [packages/utils/src/tsResult.ts:52](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L52)
44
+
45
+ #### Type Parameters
46
+
47
+ ##### T
48
+
49
+ `T`
50
+
51
+ ##### E
52
+
53
+ `E` *extends* [`ResultValidErrors`](#resultvaliderrors) = `Error`
54
+
55
+ #### Deprecated
56
+
57
+ Use `t-result` library instead.
58
+
59
+ ***
60
+
61
+ ### ~~ResultValidErrors~~
62
+
63
+ ```ts
64
+ type ResultValidErrors =
65
+ | Error
66
+ | Record<string, unknown>
67
+ | unknown[]
68
+ | readonly unknown[]
69
+ | true;
70
+ ```
71
+
72
+ Defined in: [packages/utils/src/tsResult.ts:13](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L13)
73
+
74
+ #### Deprecated
75
+
76
+ Use `t-result` library instead.
77
+
78
+ ***
79
+
80
+ ### ~~TypedResult\<T, E\>~~
81
+
82
+ ```ts
83
+ type TypedResult<T, E> = object;
84
+ ```
85
+
86
+ Defined in: [packages/utils/src/tsResult.ts:318](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L318)
87
+
88
+ #### Deprecated
89
+
90
+ Use `t-result` library instead.
91
+
92
+ #### Type Parameters
93
+
94
+ ##### T
95
+
96
+ `T`
97
+
98
+ ##### E
99
+
100
+ `E` *extends* [`ResultValidErrors`](#resultvaliderrors) = `Error`
101
+
102
+ #### Properties
103
+
104
+ ##### ~~\_type~~
105
+
106
+ ```ts
107
+ _type: Result<T, E>;
108
+ ```
109
+
110
+ Defined in: [packages/utils/src/tsResult.ts:324](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L324)
111
+
112
+ ###### Deprecated
113
+
114
+ Use `t-result` library instead.
115
+
116
+ ##### ~~err()~~
117
+
118
+ ```ts
119
+ err: (error) => Err<E>;
120
+ ```
121
+
122
+ Defined in: [packages/utils/src/tsResult.ts:322](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L322)
123
+
124
+ ###### Parameters
125
+
126
+ ###### error
127
+
128
+ `E`
129
+
130
+ ###### Returns
131
+
132
+ [`Err`](-internal-.md#err)\<`E`\>
133
+
134
+ ###### Deprecated
135
+
136
+ Use `t-result` library instead.
137
+
138
+ ##### ~~ok()~~
139
+
140
+ ```ts
141
+ ok: (value) => Ok<T>;
142
+ ```
143
+
144
+ Defined in: [packages/utils/src/tsResult.ts:320](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L320)
145
+
146
+ ###### Parameters
147
+
148
+ ###### value
149
+
150
+ `T`
151
+
152
+ ###### Returns
153
+
154
+ [`Ok`](-internal-.md#ok)\<`T`\>
155
+
156
+ ###### Deprecated
157
+
158
+ Use `t-result` library instead.
159
+
160
+ ## Variables
161
+
162
+ ### ~~Result~~
163
+
164
+ ```ts
165
+ Result: object;
166
+ ```
167
+
168
+ Defined in: [packages/utils/src/tsResult.ts:52](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L52)
169
+
170
+ #### Type declaration
171
+
172
+ ##### ~~asyncMap()~~
173
+
174
+ ```ts
175
+ asyncMap: <T, E>(resultPromise) => object;
176
+ ```
177
+
178
+ ###### Type Parameters
179
+
180
+ ###### T
181
+
182
+ `T`
183
+
184
+ ###### E
185
+
186
+ `E` *extends* [`ResultValidErrors`](#resultvaliderrors)
187
+
188
+ ###### Parameters
189
+
190
+ ###### resultPromise
191
+
192
+ `Promise`\<[`Result`](#result)\<`T`, `E`\>\>
193
+
194
+ ###### Returns
195
+
196
+ `object`
197
+
198
+ ###### ~~err()~~
199
+
200
+ ```ts
201
+ err: <NewError>(mapFn) => Promise<Result<T, NewError>>;
202
+ ```
203
+
204
+ ###### Type Parameters
205
+
206
+ ###### NewError
207
+
208
+ `NewError` *extends* [`ResultValidErrors`](#resultvaliderrors)
209
+
210
+ ###### Parameters
211
+
212
+ ###### mapFn
213
+
214
+ (`error`) => `NewError`
215
+
216
+ ###### Returns
217
+
218
+ `Promise`\<[`Result`](#result)\<`T`, `NewError`\>\>
219
+
220
+ ###### ~~ok()~~
221
+
222
+ ```ts
223
+ ok: <NewValue>(mapFn) => Promise<Result<NewValue, E>>;
224
+ ```
225
+
226
+ ###### Type Parameters
227
+
228
+ ###### NewValue
229
+
230
+ `NewValue`
231
+
232
+ ###### Parameters
233
+
234
+ ###### mapFn
235
+
236
+ (`value`) => `NewValue`
237
+
238
+ ###### Returns
239
+
240
+ `Promise`\<[`Result`](#result)\<`NewValue`, `E`\>\>
241
+
242
+ ###### ~~okAndErr()~~
243
+
244
+ ```ts
245
+ okAndErr: <NewValue, NewError>(__namedParameters) => Promise<Result<NewValue, NewError>>;
246
+ ```
247
+
248
+ ###### Type Parameters
249
+
250
+ ###### NewValue
251
+
252
+ `NewValue`
253
+
254
+ ###### NewError
255
+
256
+ `NewError` *extends* [`ResultValidErrors`](#resultvaliderrors)
257
+
258
+ ###### Parameters
259
+
260
+ ###### \_\_namedParameters
261
+
262
+ ###### err
263
+
264
+ (`error`) => `NewError`
265
+
266
+ ###### ok
267
+
268
+ (`value`) => `NewValue`
269
+
270
+ ###### Returns
271
+
272
+ `Promise`\<[`Result`](#result)\<`NewValue`, `NewError`\>\>
273
+
274
+ ##### ~~asyncUnwrap()~~
275
+
276
+ ```ts
277
+ asyncUnwrap: <T>(result) => Promise<T>;
278
+ ```
279
+
280
+ Unwraps a promise result
281
+
282
+ ###### Type Parameters
283
+
284
+ ###### T
285
+
286
+ `T`
287
+
288
+ ###### Parameters
289
+
290
+ ###### result
291
+
292
+ `Promise`\<[`Result`](#result)\<`T`, [`ResultValidErrors`](#resultvaliderrors)\>\>
293
+
294
+ ###### Returns
295
+
296
+ `Promise`\<`T`\>
297
+
298
+ ##### ~~err()~~
299
+
300
+ ```ts
301
+ err: <E>(error) => Err<E>;
302
+ ```
303
+
304
+ ###### Type Parameters
305
+
306
+ ###### E
307
+
308
+ `E` *extends* [`ResultValidErrors`](#resultvaliderrors)
309
+
310
+ ###### Parameters
311
+
312
+ ###### error
313
+
314
+ `E`
315
+
316
+ ###### Returns
317
+
318
+ [`Err`](-internal-.md#err)\<`E`\>
319
+
320
+ ###### Deprecated
321
+
322
+ Use `t-result` library instead.
323
+
324
+ ##### ~~getOkErr()~~
325
+
326
+ ```ts
327
+ getOkErr: {
328
+ <F> (): TypedResult<Awaited<ReturnType<F>> extends Result<T, any> ? T : never, Awaited<ReturnType<F>> extends Result<any, E> ? E : never>;
329
+ <F> (): TypedResult<ReturnType<F> extends Result<T, any> ? T : never, ReturnType<F> extends Result<any, E> ? E : never>;
330
+ <R> (): TypedResult<R extends Result<T, any> ? T : never, R extends Result<any, E> ? E : never>;
331
+ <T, E> (): TypedResult<T, E>;
332
+ };
333
+ ```
334
+
335
+ ###### Call Signature
336
+
337
+ ```ts
338
+ <F>(): TypedResult<Awaited<ReturnType<F>> extends Result<T, any> ? T : never, Awaited<ReturnType<F>> extends Result<any, E> ? E : never>;
339
+ ```
340
+
341
+ ###### Type Parameters
342
+
343
+ ###### F
344
+
345
+ `F` *extends* (...`args`) => `Promise`\<[`Result`](#result)\<`any`, `any`\>\>
346
+
347
+ ###### Returns
348
+
349
+ [`TypedResult`](#typedresult)\<`Awaited`\<`ReturnType`\<`F`\>\> *extends* [`Result`](#result)\<`T`, `any`\> ? `T` : `never`, `Awaited`\<`ReturnType`\<`F`\>\> *extends* [`Result`](#result)\<`any`, `E`\> ? `E` : `never`\>
350
+
351
+ ###### Call Signature
352
+
353
+ ```ts
354
+ <F>(): TypedResult<ReturnType<F> extends Result<T, any> ? T : never, ReturnType<F> extends Result<any, E> ? E : never>;
355
+ ```
356
+
357
+ ###### Type Parameters
358
+
359
+ ###### F
360
+
361
+ `F` *extends* (...`args`) => [`Result`](#result)\<`any`, `any`\>
362
+
363
+ ###### Returns
364
+
365
+ [`TypedResult`](#typedresult)\<`ReturnType`\<`F`\> *extends* [`Result`](#result)\<`T`, `any`\> ? `T` : `never`, `ReturnType`\<`F`\> *extends* [`Result`](#result)\<`any`, `E`\> ? `E` : `never`\>
366
+
367
+ ###### Call Signature
368
+
369
+ ```ts
370
+ <R>(): TypedResult<R extends Result<T, any> ? T : never, R extends Result<any, E> ? E : never>;
371
+ ```
372
+
373
+ ###### Type Parameters
374
+
375
+ ###### R
376
+
377
+ `R` *extends* [`Result`](#result)\<`any`, `any`\>
378
+
379
+ ###### Returns
380
+
381
+ [`TypedResult`](#typedresult)\<`R` *extends* [`Result`](#result)\<`T`, `any`\> ? `T` : `never`, `R` *extends* [`Result`](#result)\<`any`, `E`\> ? `E` : `never`\>
382
+
383
+ ###### Call Signature
384
+
385
+ ```ts
386
+ <T, E>(): TypedResult<T, E>;
387
+ ```
388
+
389
+ ###### Type Parameters
390
+
391
+ ###### T
392
+
393
+ `T`
394
+
395
+ ###### E
396
+
397
+ `E` *extends* [`ResultValidErrors`](#resultvaliderrors) = `Error`
398
+
399
+ ###### Returns
400
+
401
+ [`TypedResult`](#typedresult)\<`T`, `E`\>
402
+
403
+ ##### ~~ok()~~
404
+
405
+ ```ts
406
+ ok: {
407
+ (): Ok<void>;
408
+ <T> (value): Ok<T>;
409
+ };
410
+ ```
411
+
412
+ ###### Call Signature
413
+
414
+ ```ts
415
+ (): Ok<void>;
416
+ ```
417
+
418
+ ###### Returns
419
+
420
+ [`Ok`](-internal-.md#ok)\<`void`\>
421
+
422
+ ###### Deprecated
423
+
424
+ Use `t-result` library instead.
425
+
426
+ ###### Call Signature
427
+
428
+ ```ts
429
+ <T>(value): Ok<T>;
430
+ ```
431
+
432
+ ###### Type Parameters
433
+
434
+ ###### T
435
+
436
+ `T`
437
+
438
+ ###### Parameters
439
+
440
+ ###### value
441
+
442
+ `T`
443
+
444
+ ###### Returns
445
+
446
+ [`Ok`](-internal-.md#ok)\<`T`\>
447
+
448
+ ###### Deprecated
449
+
450
+ Use `t-result` library instead.
451
+
452
+ ##### ~~unknownToError()~~
453
+
454
+ ```ts
455
+ unknownToError: (error) => Err<Error> = unknownToResultError;
456
+ ```
457
+
458
+ ###### Parameters
459
+
460
+ ###### error
461
+
462
+ `unknown`
463
+
464
+ ###### Returns
465
+
466
+ [`Err`](-internal-.md#err)\<`Error`\>
467
+
468
+ #### Deprecated
469
+
470
+ Use `t-result` library instead.
471
+
472
+ ## Functions
473
+
474
+ ### ~~err()~~
475
+
476
+ ```ts
477
+ function err<E>(error): Err<E>;
478
+ ```
479
+
480
+ Defined in: [packages/utils/src/tsResult.ts:149](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L149)
481
+
482
+ #### Type Parameters
483
+
484
+ ##### E
485
+
486
+ `E` *extends* [`ResultValidErrors`](#resultvaliderrors)
487
+
488
+ #### Parameters
489
+
490
+ ##### error
491
+
492
+ `E`
493
+
494
+ #### Returns
495
+
496
+ [`Err`](-internal-.md#err)\<`E`\>
497
+
498
+ #### Deprecated
499
+
500
+ Use `t-result` library instead.
501
+
502
+ ***
503
+
504
+ ### ~~ok()~~
505
+
506
+ #### Deprecated
507
+
508
+ Use `t-result` library instead.
509
+
510
+ #### Call Signature
511
+
512
+ ```ts
513
+ function ok(): Ok<void>;
514
+ ```
515
+
516
+ Defined in: [packages/utils/src/tsResult.ts:124](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L124)
517
+
518
+ ##### Returns
519
+
520
+ [`Ok`](-internal-.md#ok)\<`void`\>
521
+
522
+ ##### Deprecated
523
+
524
+ Use `t-result` library instead.
525
+
526
+ ##### Deprecated
527
+
528
+ Use `t-result` library instead.
529
+
530
+ #### Call Signature
531
+
532
+ ```ts
533
+ function ok<T>(value): Ok<T>;
534
+ ```
535
+
536
+ Defined in: [packages/utils/src/tsResult.ts:126](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L126)
537
+
538
+ ##### Type Parameters
539
+
540
+ ###### T
541
+
542
+ `T`
543
+
544
+ ##### Parameters
545
+
546
+ ###### value
547
+
548
+ `T`
549
+
550
+ ##### Returns
551
+
552
+ [`Ok`](-internal-.md#ok)\<`T`\>
553
+
554
+ ##### Deprecated
555
+
556
+ Use `t-result` library instead.
557
+
558
+ ##### Deprecated
559
+
560
+ Use `t-result` library instead.
561
+
562
+ ***
563
+
564
+ ### ~~resultify()~~
565
+
566
+ #### Call Signature
567
+
568
+ ```ts
569
+ function resultify<T, E>(fn, errorNormalizer?): Result<T, E>;
570
+ ```
571
+
572
+ Defined in: [packages/utils/src/tsResult.ts:238](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L238)
573
+
574
+ ##### Type Parameters
575
+
576
+ ###### T
577
+
578
+ `T`
579
+
580
+ ###### E
581
+
582
+ `E` *extends* [`ResultValidErrors`](#resultvaliderrors) = `Error`
583
+
584
+ ##### Parameters
585
+
586
+ ###### fn
587
+
588
+ () => `T` *extends* `Promise`\<`any`\> ? `never` : `T`
589
+
590
+ ###### errorNormalizer?
591
+
592
+ (`err`) => `E`
593
+
594
+ ##### Returns
595
+
596
+ [`Result`](#result)\<`T`, `E`\>
597
+
598
+ ##### Deprecated
599
+
600
+ Use `t-result` library instead.
601
+
602
+ #### Call Signature
603
+
604
+ ```ts
605
+ function resultify<T, E>(fn, errorNormalizer?): Promise<Result<Awaited<T>, E>>;
606
+ ```
607
+
608
+ Defined in: [packages/utils/src/tsResult.ts:243](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L243)
609
+
610
+ ##### Type Parameters
611
+
612
+ ###### T
613
+
614
+ `T`
615
+
616
+ ###### E
617
+
618
+ `E` *extends* [`ResultValidErrors`](#resultvaliderrors) = `Error`
619
+
620
+ ##### Parameters
621
+
622
+ ###### fn
623
+
624
+ () => `Promise`\<`T`\>
625
+
626
+ ###### errorNormalizer?
627
+
628
+ (`err`) => `E`
629
+
630
+ ##### Returns
631
+
632
+ `Promise`\<[`Result`](#result)\<`Awaited`\<`T`\>, `E`\>\>
633
+
634
+ ##### Deprecated
635
+
636
+ Use `t-result` library instead.
637
+
638
+ #### Call Signature
639
+
640
+ ```ts
641
+ function resultify<T, E>(fn, errorNormalizer?): Promise<Result<T, E>>;
642
+ ```
643
+
644
+ Defined in: [packages/utils/src/tsResult.ts:248](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L248)
645
+
646
+ ##### Type Parameters
647
+
648
+ ###### T
649
+
650
+ `T`
651
+
652
+ ###### E
653
+
654
+ `E` *extends* [`ResultValidErrors`](#resultvaliderrors) = `Error`
655
+
656
+ ##### Parameters
657
+
658
+ ###### fn
659
+
660
+ `Promise`\<`T`\>
661
+
662
+ ###### errorNormalizer?
663
+
664
+ (`err`) => `E`
665
+
666
+ ##### Returns
667
+
668
+ `Promise`\<[`Result`](#result)\<`T`, `E`\>\>
669
+
670
+ ##### Deprecated
671
+
672
+ Use `t-result` library instead.
673
+
674
+ ***
675
+
676
+ ### ~~unknownToError()~~
677
+
678
+ ```ts
679
+ function unknownToError(error): Error;
680
+ ```
681
+
682
+ Defined in: [packages/utils/src/tsResult.ts:296](https://github.com/lucasols/utils/blob/main/packages/utils/src/tsResult.ts#L296)
683
+
684
+ #### Parameters
685
+
686
+ ##### error
687
+
688
+ `unknown`
689
+
690
+ #### Returns
691
+
692
+ `Error`
693
+
694
+ #### Deprecated
695
+
696
+ Use `t-result` library instead.