@oscarpalmer/atoms 0.186.2 → 0.187.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/array/filter.d.mts +4 -4
- package/dist/array/find.d.mts +4 -4
- package/dist/array/first.d.mts +4 -4
- package/dist/array/get.d.mts +27 -1
- package/dist/array/get.mjs +5 -3
- package/dist/array/group-by.d.mts +6 -6
- package/dist/array/last.d.mts +4 -4
- package/dist/array/match.d.mts +7 -6
- package/dist/array/move.d.mts +7 -7
- package/dist/array/move.mjs +1 -1
- package/dist/array/select.d.mts +1 -0
- package/dist/array/slice.d.mts +3 -3
- package/dist/array/sort.d.mts +10 -7
- package/dist/array/sort.mjs +4 -3
- package/dist/array/swap.d.mts +1 -1
- package/dist/array/swap.mjs +1 -1
- package/dist/array/to-map.d.mts +32 -32
- package/dist/array/to-record.d.mts +6 -6
- package/dist/array/to-set.d.mts +6 -6
- package/dist/beacon.d.mts +6 -0
- package/dist/beacon.mjs +3 -0
- package/dist/color/index.d.mts +6 -2
- package/dist/color/index.mjs +6 -2
- package/dist/color/instance.d.mts +78 -14
- package/dist/color/instance.mjs +78 -14
- package/dist/color/misc/get.d.mts +39 -11
- package/dist/color/misc/get.mjs +39 -11
- package/dist/color/misc/is.d.mts +26 -11
- package/dist/color/misc/is.mjs +26 -11
- package/dist/color/misc/state.mjs +1 -1
- package/dist/color/models.d.mts +7 -4
- package/dist/color/space/hex.d.mts +15 -6
- package/dist/color/space/hex.mjs +15 -6
- package/dist/color/space/hsl.d.mts +10 -4
- package/dist/color/space/hsl.mjs +10 -4
- package/dist/color/space/rgb.d.mts +21 -12
- package/dist/color/space/rgb.mjs +21 -12
- package/dist/function/assert.d.mts +20 -14
- package/dist/function/assert.mjs +19 -13
- package/dist/function/limit.d.mts +8 -6
- package/dist/function/limit.mjs +8 -6
- package/dist/function/memoize.d.mts +15 -4
- package/dist/function/memoize.mjs +18 -4
- package/dist/function/once.d.mts +5 -3
- package/dist/function/once.mjs +5 -3
- package/dist/function/retry.d.mts +5 -2
- package/dist/function/retry.mjs +3 -1
- package/dist/function/work.d.mts +146 -98
- package/dist/{kalas.d.mts → herald.d.mts} +17 -8
- package/dist/{kalas.mjs → herald.mjs} +22 -13
- package/dist/index.d.mts +1464 -708
- package/dist/index.mjs +677 -324
- package/dist/internal/array/index-of.d.mts +4 -4
- package/dist/internal/array/insert.mjs +1 -1
- package/dist/internal/array/shuffle.d.mts +1 -0
- package/dist/internal/array/shuffle.mjs +2 -1
- package/dist/internal/is.d.mts +26 -8
- package/dist/internal/is.mjs +26 -8
- package/dist/internal/math/aggregate.d.mts +9 -9
- package/dist/internal/number.d.mts +13 -2
- package/dist/internal/number.mjs +13 -2
- package/dist/internal/random.d.mts +4 -2
- package/dist/internal/random.mjs +7 -5
- package/dist/internal/result.d.mts +17 -11
- package/dist/internal/result.mjs +10 -14
- package/dist/internal/string.d.mts +16 -1
- package/dist/internal/string.mjs +24 -1
- package/dist/internal/value/compare.d.mts +5 -2
- package/dist/internal/value/compare.mjs +5 -2
- package/dist/internal/value/equal.d.mts +12 -3
- package/dist/internal/value/equal.mjs +7 -4
- package/dist/internal/value/get.d.mts +17 -17
- package/dist/internal/value/has.d.mts +55 -11
- package/dist/internal/value/set.d.mts +24 -0
- package/dist/is.d.mts +12 -0
- package/dist/is.mjs +16 -1
- package/dist/logger.d.mts +7 -6
- package/dist/logger.mjs +6 -5
- package/dist/math.d.mts +36 -18
- package/dist/math.mjs +6 -3
- package/dist/models.d.mts +3 -3
- package/dist/promise/delay.d.mts +2 -0
- package/dist/promise/helpers.d.mts +6 -4
- package/dist/promise/helpers.mjs +6 -4
- package/dist/promise/index.d.mts +49 -38
- package/dist/promise/misc.d.mts +10 -7
- package/dist/promise/misc.mjs +4 -3
- package/dist/promise/models.d.mts +18 -19
- package/dist/promise/models.mjs +4 -3
- package/dist/promise/timed.d.mts +8 -6
- package/dist/query.d.mts +2 -0
- package/dist/query.mjs +2 -0
- package/dist/queue.d.mts +15 -4
- package/dist/queue.mjs +10 -3
- package/dist/random.d.mts +9 -2
- package/dist/random.mjs +7 -2
- package/dist/result/index.d.mts +14 -8
- package/dist/result/match.d.mts +18 -10
- package/dist/result/misc.d.mts +14 -7
- package/dist/result/misc.mjs +4 -2
- package/dist/result/models.d.mts +2 -0
- package/dist/result/work/flow.d.mts +86 -62
- package/dist/result/work/pipe.d.mts +55 -33
- package/dist/sized/map.d.mts +19 -16
- package/dist/sized/map.mjs +4 -4
- package/dist/sized/set.d.mts +20 -16
- package/dist/sized/set.mjs +8 -7
- package/dist/string/case.d.mts +8 -0
- package/dist/string/case.mjs +8 -0
- package/dist/string/fuzzy.d.mts +19 -5
- package/dist/string/fuzzy.mjs +7 -0
- package/dist/string/index.d.mts +17 -2
- package/dist/string/index.mjs +7 -9
- package/dist/string/match.d.mts +3 -0
- package/dist/string/match.mjs +3 -0
- package/dist/string/normalize.d.mts +6 -2
- package/dist/string/normalize.mjs +5 -2
- package/dist/string/template.d.mts +38 -9
- package/dist/string/template.mjs +19 -19
- package/dist/value/clone.d.mts +25 -4
- package/dist/value/clone.mjs +36 -22
- package/dist/value/collection.d.mts +9 -6
- package/dist/value/collection.mjs +3 -2
- package/dist/value/diff.d.mts +3 -1
- package/dist/value/diff.mjs +1 -0
- package/dist/value/freeze.d.mts +118 -9
- package/dist/value/freeze.mjs +56 -14
- package/dist/value/index.d.mts +1 -2
- package/dist/value/index.mjs +1 -2
- package/dist/value/merge.d.mts +11 -5
- package/dist/value/merge.mjs +2 -2
- package/dist/value/omit.d.mts +1 -0
- package/dist/value/omit.mjs +1 -0
- package/dist/value/pick.d.mts +1 -0
- package/dist/value/pick.mjs +1 -0
- package/dist/value/shake.d.mts +1 -0
- package/dist/value/shake.mjs +1 -0
- package/dist/value/smush.d.mts +1 -0
- package/dist/value/smush.mjs +1 -0
- package/dist/value/transform.d.mts +7 -3
- package/dist/value/unsmush.d.mts +1 -0
- package/dist/value/unsmush.mjs +1 -0
- package/package.json +11 -7
- package/src/array/filter.ts +4 -4
- package/src/array/find.ts +4 -4
- package/src/array/first.ts +4 -4
- package/src/array/get.ts +40 -5
- package/src/array/group-by.ts +6 -6
- package/src/array/last.ts +4 -4
- package/src/array/match.ts +7 -6
- package/src/array/move.ts +7 -7
- package/src/array/select.ts +1 -0
- package/src/array/slice.ts +3 -3
- package/src/array/sort.ts +15 -10
- package/src/array/swap.ts +1 -1
- package/src/array/to-map.ts +32 -32
- package/src/array/to-record.ts +6 -6
- package/src/array/to-set.ts +6 -6
- package/src/beacon.ts +6 -0
- package/src/color/index.ts +6 -2
- package/src/color/instance.ts +78 -14
- package/src/color/misc/get.ts +39 -11
- package/src/color/misc/is.ts +26 -11
- package/src/color/misc/state.ts +1 -1
- package/src/color/models.ts +7 -4
- package/src/color/space/hex.ts +15 -6
- package/src/color/space/hsl.ts +10 -4
- package/src/color/space/rgb.ts +21 -12
- package/src/function/assert.ts +20 -14
- package/src/function/limit.ts +8 -6
- package/src/function/memoize.ts +24 -5
- package/src/function/once.ts +5 -3
- package/src/function/retry.ts +7 -3
- package/src/function/work.ts +146 -98
- package/src/{kalas.ts → herald.ts} +23 -14
- package/src/index.ts +3 -2
- package/src/internal/array/index-of.ts +4 -4
- package/src/internal/array/insert.ts +1 -1
- package/src/internal/array/shuffle.ts +2 -1
- package/src/internal/is.ts +26 -8
- package/src/internal/math/aggregate.ts +9 -9
- package/src/internal/number.ts +13 -2
- package/src/internal/random.ts +10 -4
- package/src/internal/result.ts +30 -29
- package/src/internal/string.ts +28 -0
- package/src/internal/value/compare.ts +5 -2
- package/src/internal/value/equal.ts +13 -4
- package/src/internal/value/get.ts +17 -17
- package/src/internal/value/has.ts +54 -11
- package/src/internal/value/set.ts +24 -0
- package/src/is.ts +15 -1
- package/src/logger.ts +8 -7
- package/src/math.ts +36 -18
- package/src/models.ts +3 -3
- package/src/promise/delay.ts +2 -0
- package/src/promise/helpers.ts +6 -4
- package/src/promise/index.ts +49 -38
- package/src/promise/misc.ts +10 -7
- package/src/promise/models.ts +18 -19
- package/src/promise/timed.ts +8 -6
- package/src/query.ts +2 -0
- package/src/queue.ts +15 -4
- package/src/random.ts +8 -1
- package/src/result/index.ts +14 -8
- package/src/result/match.ts +18 -10
- package/src/result/misc.ts +17 -9
- package/src/result/models.ts +2 -0
- package/src/result/work/flow.ts +86 -62
- package/src/result/work/pipe.ts +55 -33
- package/src/sized/map.ts +20 -17
- package/src/sized/set.ts +21 -17
- package/src/string/case.ts +8 -0
- package/src/string/fuzzy.ts +19 -5
- package/src/string/index.ts +18 -15
- package/src/string/match.ts +3 -0
- package/src/string/normalize.ts +6 -2
- package/src/string/template.ts +69 -18
- package/src/value/clone.ts +51 -26
- package/src/value/collection.ts +9 -6
- package/src/value/diff.ts +3 -1
- package/src/value/freeze.ts +239 -25
- package/src/value/index.ts +0 -1
- package/src/value/merge.ts +11 -5
- package/src/value/omit.ts +1 -0
- package/src/value/pick.ts +1 -0
- package/src/value/shake.ts +1 -0
- package/src/value/smush.ts +1 -0
- package/src/value/transform.ts +7 -3
- package/src/value/unsmush.ts +1 -0
package/src/result/match.ts
CHANGED
|
@@ -4,11 +4,13 @@ import type {AnyResult, ExtendedErr, ResultMatch} from './models';
|
|
|
4
4
|
// #region Functions
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Handles a
|
|
7
|
+
* Handles a _Result_ with match callbacks
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* _Available as `asyncMatchResult` and `matchResult.async`_
|
|
10
|
+
*
|
|
11
|
+
* @param result _Result_ to handle
|
|
11
12
|
* @param handler Match callbacks
|
|
13
|
+
* @returns Matched value-_Promise_
|
|
12
14
|
*/
|
|
13
15
|
export async function asyncMatchResult<Value, Returned, E = Error>(
|
|
14
16
|
result: AnyResult<Value, E> | Promise<AnyResult<Value, E>> | (() => Promise<AnyResult<Value, E>>),
|
|
@@ -16,12 +18,14 @@ export async function asyncMatchResult<Value, Returned, E = Error>(
|
|
|
16
18
|
): Promise<Returned>;
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
|
-
* Handles a
|
|
21
|
+
* Handles a _Result_ with match callbacks
|
|
22
|
+
*
|
|
23
|
+
* _Available as `asyncMatchResult` and `matchResult.async`_
|
|
20
24
|
*
|
|
21
|
-
*
|
|
22
|
-
* @param result Result to handle
|
|
25
|
+
* @param result _Result_ to handle
|
|
23
26
|
* @param ok Ok callback
|
|
24
27
|
* @param error Error callback
|
|
28
|
+
* @returns Matched value-_Promise_
|
|
25
29
|
*/
|
|
26
30
|
export async function asyncMatchResult<Value, Returned, E = Error>(
|
|
27
31
|
result: AnyResult<Value, E> | Promise<AnyResult<Value, E>> | (() => Promise<AnyResult<Value, E>>),
|
|
@@ -61,9 +65,11 @@ export async function asyncMatchResult<Value, Returned, E = Error>(
|
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
/**
|
|
64
|
-
* Handles a
|
|
65
|
-
*
|
|
68
|
+
* Handles a _Result_ with match callbacks
|
|
69
|
+
*
|
|
70
|
+
* @param result _Result_ to handle
|
|
66
71
|
* @param handler Match callbacks
|
|
72
|
+
* @returns Matched value
|
|
67
73
|
*/
|
|
68
74
|
export function matchResult<Value, Returned, E = Error>(
|
|
69
75
|
result: AnyResult<Value, E> | (() => AnyResult<Value, E>),
|
|
@@ -71,10 +77,12 @@ export function matchResult<Value, Returned, E = Error>(
|
|
|
71
77
|
): Returned;
|
|
72
78
|
|
|
73
79
|
/**
|
|
74
|
-
* Handles a
|
|
75
|
-
*
|
|
80
|
+
* Handles a _Result_ with match callbacks
|
|
81
|
+
*
|
|
82
|
+
* @param result _Result_ to handle
|
|
76
83
|
* @param ok Ok callback
|
|
77
84
|
* @param error Error callback
|
|
85
|
+
* @returns Matched value
|
|
78
86
|
*/
|
|
79
87
|
export function matchResult<Value, Returned, E = Error>(
|
|
80
88
|
result: AnyResult<Value, E> | (() => AnyResult<Value, E>),
|
package/src/result/misc.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type {AnyResult, Err, ExtendedErr, Ok, Result} from './models';
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Creates an extended error result
|
|
8
|
+
*
|
|
8
9
|
* @param value Error value
|
|
9
10
|
* @param original Original error
|
|
10
11
|
* @returns Error result
|
|
@@ -13,6 +14,7 @@ export function error<E>(value: E, original: Error): ExtendedErr<E>;
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Creates an error result
|
|
17
|
+
*
|
|
16
18
|
* @param value Error value
|
|
17
19
|
* @returns Error result
|
|
18
20
|
*/
|
|
@@ -37,6 +39,7 @@ export function getError<E>(value: E, original?: Error): Err<E> | ExtendedErr<E>
|
|
|
37
39
|
|
|
38
40
|
/**
|
|
39
41
|
* Creates an ok result
|
|
42
|
+
*
|
|
40
43
|
* @param value Value
|
|
41
44
|
* @returns Ok result
|
|
42
45
|
*/
|
|
@@ -48,9 +51,10 @@ export function ok<Value>(value: Value): Ok<Value> {
|
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
/**
|
|
51
|
-
* Converts a result to a
|
|
54
|
+
* Converts a result to a _Promise_
|
|
52
55
|
*
|
|
53
56
|
* Resolves if ok, rejects for error
|
|
57
|
+
*
|
|
54
58
|
* @param callback Callback to get the result
|
|
55
59
|
* @returns Promised result
|
|
56
60
|
*/
|
|
@@ -59,19 +63,21 @@ export async function toPromise<Value, E = Error>(
|
|
|
59
63
|
): Promise<Value>;
|
|
60
64
|
|
|
61
65
|
/**
|
|
62
|
-
* Converts a result to a
|
|
66
|
+
* Converts a result to a _Promise_
|
|
63
67
|
*
|
|
64
68
|
* Resolves if ok, rejects for error
|
|
65
|
-
*
|
|
69
|
+
*
|
|
70
|
+
* @param result _Result_ to convert
|
|
66
71
|
* @returns Promised result
|
|
67
72
|
*/
|
|
68
73
|
export async function toPromise<Value, E = Error>(result: AnyResult<Value, E>): Promise<Value>;
|
|
69
74
|
|
|
70
75
|
/**
|
|
71
|
-
* Converts a
|
|
76
|
+
* Converts a _Result_ to a _Promise_
|
|
72
77
|
*
|
|
73
78
|
* Resolves if ok, rejects for error
|
|
74
|
-
*
|
|
79
|
+
*
|
|
80
|
+
* @param result _Result_ to convert
|
|
75
81
|
* @returns Promised result
|
|
76
82
|
*/
|
|
77
83
|
export async function toPromise<Value, E = Error>(
|
|
@@ -88,17 +94,19 @@ export async function toPromise<Value, E = Error>(
|
|
|
88
94
|
|
|
89
95
|
/**
|
|
90
96
|
* Gets the value of an ok result _(or a default value)_
|
|
91
|
-
*
|
|
97
|
+
*
|
|
98
|
+
* @param value _Result_ to unwrap
|
|
92
99
|
* @param defaultValue Default value
|
|
93
|
-
* @returns Value of the
|
|
100
|
+
* @returns Value of the _Result_ _(or the default value)_
|
|
94
101
|
*/
|
|
95
102
|
export function unwrap<Value, E = Error>(value: Result<Value, E>, defaultValue: Value): Value;
|
|
96
103
|
|
|
97
104
|
/**
|
|
98
105
|
* Gets the value of an ok result _(or a default value)_
|
|
99
|
-
*
|
|
106
|
+
*
|
|
107
|
+
* @param value _Result_ to unwrap
|
|
100
108
|
* @param defaultValue Default value
|
|
101
|
-
* @returns Value of the
|
|
109
|
+
* @returns Value of the _Result_ _(or the default value)_
|
|
102
110
|
*/
|
|
103
111
|
export function unwrap(value: unknown, defaultValue: unknown): unknown;
|
|
104
112
|
|
package/src/result/models.ts
CHANGED
|
@@ -46,6 +46,7 @@ export type Result<Value, E = Error> = Err<E> | Ok<Value>;
|
|
|
46
46
|
export type ResultMatch<Value, Returned, E = Error> = {
|
|
47
47
|
/**
|
|
48
48
|
* Callback for error result
|
|
49
|
+
*
|
|
49
50
|
* @param error Error value
|
|
50
51
|
* @param original Original error, if available
|
|
51
52
|
* @returns Value to return
|
|
@@ -53,6 +54,7 @@ export type ResultMatch<Value, Returned, E = Error> = {
|
|
|
53
54
|
error: (error: E, original?: Error) => Returned;
|
|
54
55
|
/**
|
|
55
56
|
* Callback for ok result
|
|
57
|
+
*
|
|
56
58
|
* @param value Ok value
|
|
57
59
|
* @returns Value to return
|
|
58
60
|
*/
|
package/src/result/work/flow.ts
CHANGED
|
@@ -7,14 +7,14 @@ import type {Result, UnwrapValue} from '../models';
|
|
|
7
7
|
// #region Types
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* A synchronous
|
|
10
|
+
* A synchronous _Flow_, a function that attempts to pipe values through a series of functions
|
|
11
11
|
*/
|
|
12
12
|
export type AttemptFlow<Callback extends GenericCallback, Value> = (
|
|
13
13
|
...args: Parameters<Callback>
|
|
14
14
|
) => Result<UnwrapValue<Value>>;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* An asynchronous
|
|
17
|
+
* An asynchronous _Flow_, a function that attempts to pipe values through a series of functions
|
|
18
18
|
*/
|
|
19
19
|
export type AttemptFlowPromise<Callback extends GenericCallback, Value> = (
|
|
20
20
|
...args: Parameters<Callback>
|
|
@@ -27,20 +27,22 @@ export type AttemptFlowPromise<Callback extends GenericCallback, Value> = (
|
|
|
27
27
|
// #region Asynchronous
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Create an asynchronous
|
|
30
|
+
* Create an asynchronous _Flow_, a function that attempts to pipe a value through a series of functions
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
33
|
+
*
|
|
34
|
+
* @returns _Flow_ function
|
|
34
35
|
*/
|
|
35
36
|
export function attemptAsyncFlow<Fn extends GenericCallback>(
|
|
36
37
|
fn: Fn,
|
|
37
38
|
): AttemptFlowPromise<Fn, ReturnType<Fn>>;
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
|
-
* Create an asynchronous
|
|
41
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
42
|
+
*
|
|
43
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
41
44
|
*
|
|
42
|
-
*
|
|
43
|
-
* @returns Flow function
|
|
45
|
+
* @returns _Flow_ function
|
|
44
46
|
*/
|
|
45
47
|
export function attemptAsyncFlow<First extends GenericCallback, Second>(
|
|
46
48
|
first: First,
|
|
@@ -48,10 +50,11 @@ export function attemptAsyncFlow<First extends GenericCallback, Second>(
|
|
|
48
50
|
): AttemptFlowPromise<First, Second>;
|
|
49
51
|
|
|
50
52
|
/**
|
|
51
|
-
* Create an asynchronous
|
|
53
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
54
|
+
*
|
|
55
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
52
56
|
*
|
|
53
|
-
*
|
|
54
|
-
* @returns Flow function
|
|
57
|
+
* @returns _Flow_ function
|
|
55
58
|
*/
|
|
56
59
|
export function attemptAsyncFlow<First extends GenericCallback, Second, Third>(
|
|
57
60
|
first: First,
|
|
@@ -60,10 +63,11 @@ export function attemptAsyncFlow<First extends GenericCallback, Second, Third>(
|
|
|
60
63
|
): AttemptFlowPromise<First, Third>;
|
|
61
64
|
|
|
62
65
|
/**
|
|
63
|
-
* Create an asynchronous
|
|
66
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
64
67
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
68
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
69
|
+
*
|
|
70
|
+
* @returns _Flow_ function
|
|
67
71
|
*/
|
|
68
72
|
export function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth>(
|
|
69
73
|
first: First,
|
|
@@ -73,10 +77,11 @@ export function attemptAsyncFlow<First extends GenericCallback, Second, Third, F
|
|
|
73
77
|
): AttemptFlowPromise<First, Fourth>;
|
|
74
78
|
|
|
75
79
|
/**
|
|
76
|
-
* Create an asynchronous
|
|
80
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
81
|
+
*
|
|
82
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
77
83
|
*
|
|
78
|
-
*
|
|
79
|
-
* @returns Flow function
|
|
84
|
+
* @returns _Flow_ function
|
|
80
85
|
*/
|
|
81
86
|
export function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(
|
|
82
87
|
first: First,
|
|
@@ -87,10 +92,11 @@ export function attemptAsyncFlow<First extends GenericCallback, Second, Third, F
|
|
|
87
92
|
): AttemptFlowPromise<First, Fifth>;
|
|
88
93
|
|
|
89
94
|
/**
|
|
90
|
-
* Create an asynchronous
|
|
95
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
96
|
+
*
|
|
97
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
91
98
|
*
|
|
92
|
-
*
|
|
93
|
-
* @returns Flow function
|
|
99
|
+
* @returns _Flow_ function
|
|
94
100
|
*/
|
|
95
101
|
export function attemptAsyncFlow<
|
|
96
102
|
First extends GenericCallback,
|
|
@@ -109,10 +115,11 @@ export function attemptAsyncFlow<
|
|
|
109
115
|
): AttemptFlowPromise<First, Sixth>;
|
|
110
116
|
|
|
111
117
|
/**
|
|
112
|
-
* Create an asynchronous
|
|
118
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
113
119
|
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
120
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
121
|
+
*
|
|
122
|
+
* @returns _Flow_ function
|
|
116
123
|
*/
|
|
117
124
|
export function attemptAsyncFlow<
|
|
118
125
|
First extends GenericCallback,
|
|
@@ -133,10 +140,11 @@ export function attemptAsyncFlow<
|
|
|
133
140
|
): AttemptFlowPromise<First, Seventh>;
|
|
134
141
|
|
|
135
142
|
/**
|
|
136
|
-
* Create an asynchronous
|
|
143
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
144
|
+
*
|
|
145
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
137
146
|
*
|
|
138
|
-
*
|
|
139
|
-
* @returns Flow function
|
|
147
|
+
* @returns _Flow_ function
|
|
140
148
|
*/
|
|
141
149
|
export function attemptAsyncFlow<
|
|
142
150
|
First extends GenericCallback,
|
|
@@ -159,10 +167,11 @@ export function attemptAsyncFlow<
|
|
|
159
167
|
): AttemptFlowPromise<First, Eighth>;
|
|
160
168
|
|
|
161
169
|
/**
|
|
162
|
-
* Create an asynchronous
|
|
170
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
171
|
+
*
|
|
172
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
163
173
|
*
|
|
164
|
-
*
|
|
165
|
-
* @returns Flow function
|
|
174
|
+
* @returns _Flow_ function
|
|
166
175
|
*/
|
|
167
176
|
export function attemptAsyncFlow<
|
|
168
177
|
First extends GenericCallback,
|
|
@@ -187,10 +196,11 @@ export function attemptAsyncFlow<
|
|
|
187
196
|
): AttemptFlowPromise<First, Ninth>;
|
|
188
197
|
|
|
189
198
|
/**
|
|
190
|
-
* Create an asynchronous
|
|
199
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
191
200
|
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
201
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
202
|
+
*
|
|
203
|
+
* @returns _Flow_ function
|
|
194
204
|
*/
|
|
195
205
|
export function attemptAsyncFlow<
|
|
196
206
|
First extends GenericCallback,
|
|
@@ -217,10 +227,11 @@ export function attemptAsyncFlow<
|
|
|
217
227
|
): AttemptFlowPromise<First, Tenth>;
|
|
218
228
|
|
|
219
229
|
/**
|
|
220
|
-
* Create an asynchronous
|
|
230
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
231
|
+
*
|
|
232
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
221
233
|
*
|
|
222
|
-
*
|
|
223
|
-
* @returns Flow function
|
|
234
|
+
* @returns _Flow_ function
|
|
224
235
|
*/
|
|
225
236
|
export function attemptAsyncFlow<Fn extends GenericCallback>(
|
|
226
237
|
fn: Fn,
|
|
@@ -228,10 +239,11 @@ export function attemptAsyncFlow<Fn extends GenericCallback>(
|
|
|
228
239
|
): AttemptFlowPromise<Fn, ReturnType<Fn>>;
|
|
229
240
|
|
|
230
241
|
/**
|
|
231
|
-
* Create an asynchronous
|
|
242
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
243
|
+
*
|
|
244
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
232
245
|
*
|
|
233
|
-
*
|
|
234
|
-
* @returns Flow function
|
|
246
|
+
* @returns _Flow_ function
|
|
235
247
|
*/
|
|
236
248
|
export function attemptAsyncFlow(
|
|
237
249
|
...fns: GenericCallback[]
|
|
@@ -263,14 +275,16 @@ export function attemptAsyncFlow(
|
|
|
263
275
|
// #region Synchronous
|
|
264
276
|
|
|
265
277
|
/**
|
|
266
|
-
* Create a
|
|
267
|
-
*
|
|
278
|
+
* Create a _Flow_, a function that attempts to pipe values through a function
|
|
279
|
+
*
|
|
280
|
+
* @returns _Flow_ function
|
|
268
281
|
*/
|
|
269
282
|
export function attemptFlow<Fn extends GenericCallback>(fn: Fn): AttemptFlow<Fn, ReturnType<Fn>>;
|
|
270
283
|
|
|
271
284
|
/**
|
|
272
|
-
* Create a
|
|
273
|
-
*
|
|
285
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
286
|
+
*
|
|
287
|
+
* @returns _Flow_ function
|
|
274
288
|
*/
|
|
275
289
|
export function attemptFlow<First extends GenericCallback, Second>(
|
|
276
290
|
first: First,
|
|
@@ -278,8 +292,9 @@ export function attemptFlow<First extends GenericCallback, Second>(
|
|
|
278
292
|
): AttemptFlow<First, Second>;
|
|
279
293
|
|
|
280
294
|
/**
|
|
281
|
-
* Create a
|
|
282
|
-
*
|
|
295
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
296
|
+
*
|
|
297
|
+
* @returns _Flow_ function
|
|
283
298
|
*/
|
|
284
299
|
export function attemptFlow<First extends GenericCallback, Second, Third>(
|
|
285
300
|
first: First,
|
|
@@ -288,8 +303,9 @@ export function attemptFlow<First extends GenericCallback, Second, Third>(
|
|
|
288
303
|
): AttemptFlow<First, Third>;
|
|
289
304
|
|
|
290
305
|
/**
|
|
291
|
-
* Create a
|
|
292
|
-
*
|
|
306
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
307
|
+
*
|
|
308
|
+
* @returns _Flow_ function
|
|
293
309
|
*/
|
|
294
310
|
export function attemptFlow<First extends GenericCallback, Second, Third, Fourth>(
|
|
295
311
|
first: First,
|
|
@@ -299,8 +315,9 @@ export function attemptFlow<First extends GenericCallback, Second, Third, Fourth
|
|
|
299
315
|
): AttemptFlow<First, Fourth>;
|
|
300
316
|
|
|
301
317
|
/**
|
|
302
|
-
* Create a
|
|
303
|
-
*
|
|
318
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
319
|
+
*
|
|
320
|
+
* @returns _Flow_ function
|
|
304
321
|
*/
|
|
305
322
|
export function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(
|
|
306
323
|
first: First,
|
|
@@ -311,8 +328,9 @@ export function attemptFlow<First extends GenericCallback, Second, Third, Fourth
|
|
|
311
328
|
): AttemptFlow<First, Fifth>;
|
|
312
329
|
|
|
313
330
|
/**
|
|
314
|
-
* Create a
|
|
315
|
-
*
|
|
331
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
332
|
+
*
|
|
333
|
+
* @returns _Flow_ function
|
|
316
334
|
*/
|
|
317
335
|
export function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(
|
|
318
336
|
first: First,
|
|
@@ -324,8 +342,9 @@ export function attemptFlow<First extends GenericCallback, Second, Third, Fourth
|
|
|
324
342
|
): AttemptFlow<First, Sixth>;
|
|
325
343
|
|
|
326
344
|
/**
|
|
327
|
-
* Create a
|
|
328
|
-
*
|
|
345
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
346
|
+
*
|
|
347
|
+
* @returns _Flow_ function
|
|
329
348
|
*/
|
|
330
349
|
export function attemptFlow<
|
|
331
350
|
First extends GenericCallback,
|
|
@@ -346,8 +365,9 @@ export function attemptFlow<
|
|
|
346
365
|
): AttemptFlow<First, Seventh>;
|
|
347
366
|
|
|
348
367
|
/**
|
|
349
|
-
* Create a
|
|
350
|
-
*
|
|
368
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
369
|
+
*
|
|
370
|
+
* @returns _Flow_ function
|
|
351
371
|
*/
|
|
352
372
|
export function attemptFlow<
|
|
353
373
|
First extends GenericCallback,
|
|
@@ -370,8 +390,9 @@ export function attemptFlow<
|
|
|
370
390
|
): AttemptFlow<First, Eighth>;
|
|
371
391
|
|
|
372
392
|
/**
|
|
373
|
-
* Create a
|
|
374
|
-
*
|
|
393
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
394
|
+
*
|
|
395
|
+
* @returns _Flow_ function
|
|
375
396
|
*/
|
|
376
397
|
export function attemptFlow<
|
|
377
398
|
First extends GenericCallback,
|
|
@@ -396,8 +417,9 @@ export function attemptFlow<
|
|
|
396
417
|
): AttemptFlow<First, Ninth>;
|
|
397
418
|
|
|
398
419
|
/**
|
|
399
|
-
* Create a
|
|
400
|
-
*
|
|
420
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
421
|
+
*
|
|
422
|
+
* @returns _Flow_ function
|
|
401
423
|
*/
|
|
402
424
|
export function attemptFlow<
|
|
403
425
|
First extends GenericCallback,
|
|
@@ -424,8 +446,9 @@ export function attemptFlow<
|
|
|
424
446
|
): AttemptFlow<First, Tenth>;
|
|
425
447
|
|
|
426
448
|
/**
|
|
427
|
-
* Create a
|
|
428
|
-
*
|
|
449
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
450
|
+
*
|
|
451
|
+
* @returns _Flow_ function
|
|
429
452
|
*/
|
|
430
453
|
export function attemptFlow<First extends GenericCallback>(
|
|
431
454
|
first: First,
|
|
@@ -433,8 +456,9 @@ export function attemptFlow<First extends GenericCallback>(
|
|
|
433
456
|
): AttemptFlow<First, ReturnType<First>>;
|
|
434
457
|
|
|
435
458
|
/**
|
|
436
|
-
* Create a
|
|
437
|
-
*
|
|
459
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
460
|
+
*
|
|
461
|
+
* @returns _Flow_ function
|
|
438
462
|
*/
|
|
439
463
|
export function attemptFlow(...fns: GenericCallback[]): (...args: unknown[]) => Result<unknown>;
|
|
440
464
|
|