@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
|
@@ -3,155 +3,179 @@ import { Result, UnwrapValue } from "../models.mjs";
|
|
|
3
3
|
|
|
4
4
|
//#region src/result/work/flow.d.ts
|
|
5
5
|
/**
|
|
6
|
-
* A synchronous
|
|
6
|
+
* A synchronous _Flow_, a function that attempts to pipe values through a series of functions
|
|
7
7
|
*/
|
|
8
8
|
type AttemptFlow<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Result<UnwrapValue<Value>>;
|
|
9
9
|
/**
|
|
10
|
-
* An asynchronous
|
|
10
|
+
* An asynchronous _Flow_, a function that attempts to pipe values through a series of functions
|
|
11
11
|
*/
|
|
12
12
|
type AttemptFlowPromise<Callback extends GenericCallback, Value> = (...args: Parameters<Callback>) => Promise<Result<UnwrapValue<Value>>>;
|
|
13
13
|
/**
|
|
14
|
-
* Create an asynchronous
|
|
14
|
+
* Create an asynchronous _Flow_, a function that attempts to pipe a value through a series of functions
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
17
|
+
*
|
|
18
|
+
* @returns _Flow_ function
|
|
18
19
|
*/
|
|
19
20
|
declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn): AttemptFlowPromise<Fn, ReturnType<Fn>>;
|
|
20
21
|
/**
|
|
21
|
-
* Create an asynchronous
|
|
22
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
23
|
+
*
|
|
24
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
22
25
|
*
|
|
23
|
-
*
|
|
24
|
-
* @returns Flow function
|
|
26
|
+
* @returns _Flow_ function
|
|
25
27
|
*/
|
|
26
28
|
declare function attemptAsyncFlow<First extends GenericCallback, Second>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second): AttemptFlowPromise<First, Second>;
|
|
27
29
|
/**
|
|
28
|
-
* Create an asynchronous
|
|
30
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
31
|
+
*
|
|
32
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
29
33
|
*
|
|
30
|
-
*
|
|
31
|
-
* @returns Flow function
|
|
34
|
+
* @returns _Flow_ function
|
|
32
35
|
*/
|
|
33
36
|
declare function attemptAsyncFlow<First extends GenericCallback, Second, Third>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third): AttemptFlowPromise<First, Third>;
|
|
34
37
|
/**
|
|
35
|
-
* Create an asynchronous
|
|
38
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
36
39
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
40
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
41
|
+
*
|
|
42
|
+
* @returns _Flow_ function
|
|
39
43
|
*/
|
|
40
44
|
declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth): AttemptFlowPromise<First, Fourth>;
|
|
41
45
|
/**
|
|
42
|
-
* Create an asynchronous
|
|
46
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
47
|
+
*
|
|
48
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
43
49
|
*
|
|
44
|
-
*
|
|
45
|
-
* @returns Flow function
|
|
50
|
+
* @returns _Flow_ function
|
|
46
51
|
*/
|
|
47
52
|
declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth): AttemptFlowPromise<First, Fifth>;
|
|
48
53
|
/**
|
|
49
|
-
* Create an asynchronous
|
|
54
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
55
|
+
*
|
|
56
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
50
57
|
*
|
|
51
|
-
*
|
|
52
|
-
* @returns Flow function
|
|
58
|
+
* @returns _Flow_ function
|
|
53
59
|
*/
|
|
54
60
|
declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth): AttemptFlowPromise<First, Sixth>;
|
|
55
61
|
/**
|
|
56
|
-
* Create an asynchronous
|
|
62
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
57
63
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
64
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
65
|
+
*
|
|
66
|
+
* @returns _Flow_ function
|
|
60
67
|
*/
|
|
61
68
|
declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh): AttemptFlowPromise<First, Seventh>;
|
|
62
69
|
/**
|
|
63
|
-
* Create an asynchronous
|
|
70
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
71
|
+
*
|
|
72
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
64
73
|
*
|
|
65
|
-
*
|
|
66
|
-
* @returns Flow function
|
|
74
|
+
* @returns _Flow_ function
|
|
67
75
|
*/
|
|
68
76
|
declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth): AttemptFlowPromise<First, Eighth>;
|
|
69
77
|
/**
|
|
70
|
-
* Create an asynchronous
|
|
78
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
79
|
+
*
|
|
80
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
71
81
|
*
|
|
72
|
-
*
|
|
73
|
-
* @returns Flow function
|
|
82
|
+
* @returns _Flow_ function
|
|
74
83
|
*/
|
|
75
84
|
declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth): AttemptFlowPromise<First, Ninth>;
|
|
76
85
|
/**
|
|
77
|
-
* Create an asynchronous
|
|
86
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
78
87
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
88
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
89
|
+
*
|
|
90
|
+
* @returns _Flow_ function
|
|
81
91
|
*/
|
|
82
92
|
declare function attemptAsyncFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(first: First, second: (value: Awaited<UnwrapValue<ReturnType<First>>>) => Second, third: (value: Awaited<UnwrapValue<Second>>) => Third, fourth: (value: Awaited<UnwrapValue<Third>>) => Fourth, fifth: (value: Awaited<UnwrapValue<Fourth>>) => Fifth, sixth: (value: Awaited<UnwrapValue<Fifth>>) => Sixth, seventh: (value: Awaited<UnwrapValue<Sixth>>) => Seventh, eighth: (value: Awaited<UnwrapValue<Seventh>>) => Eighth, ninth: (value: Awaited<UnwrapValue<Eighth>>) => Ninth, tenth: (value: Awaited<UnwrapValue<Ninth>>) => Tenth): AttemptFlowPromise<First, Tenth>;
|
|
83
93
|
/**
|
|
84
|
-
* Create an asynchronous
|
|
94
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
95
|
+
*
|
|
96
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
85
97
|
*
|
|
86
|
-
*
|
|
87
|
-
* @returns Flow function
|
|
98
|
+
* @returns _Flow_ function
|
|
88
99
|
*/
|
|
89
100
|
declare function attemptAsyncFlow<Fn extends GenericCallback>(fn: Fn, ...fns: Array<(value: Awaited<UnwrapValue<ReturnType<Fn>>>) => unknown>): AttemptFlowPromise<Fn, ReturnType<Fn>>;
|
|
90
101
|
/**
|
|
91
|
-
* Create an asynchronous
|
|
102
|
+
* Create an asynchronous _Flow_, a function that pipes values through a series of functions
|
|
103
|
+
*
|
|
104
|
+
* _Available as `attemptAsyncFlow` and `attemptFlow.async`_
|
|
92
105
|
*
|
|
93
|
-
*
|
|
94
|
-
* @returns Flow function
|
|
106
|
+
* @returns _Flow_ function
|
|
95
107
|
*/
|
|
96
108
|
declare function attemptAsyncFlow(...fns: GenericCallback[]): (...args: unknown[]) => Promise<Result<unknown>>;
|
|
97
109
|
/**
|
|
98
|
-
* Create a
|
|
99
|
-
*
|
|
110
|
+
* Create a _Flow_, a function that attempts to pipe values through a function
|
|
111
|
+
*
|
|
112
|
+
* @returns _Flow_ function
|
|
100
113
|
*/
|
|
101
114
|
declare function attemptFlow<Fn extends GenericCallback>(fn: Fn): AttemptFlow<Fn, ReturnType<Fn>>;
|
|
102
115
|
/**
|
|
103
|
-
* Create a
|
|
104
|
-
*
|
|
116
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
117
|
+
*
|
|
118
|
+
* @returns _Flow_ function
|
|
105
119
|
*/
|
|
106
120
|
declare function attemptFlow<First extends GenericCallback, Second>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second): AttemptFlow<First, Second>;
|
|
107
121
|
/**
|
|
108
|
-
* Create a
|
|
109
|
-
*
|
|
122
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
123
|
+
*
|
|
124
|
+
* @returns _Flow_ function
|
|
110
125
|
*/
|
|
111
126
|
declare function attemptFlow<First extends GenericCallback, Second, Third>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third): AttemptFlow<First, Third>;
|
|
112
127
|
/**
|
|
113
|
-
* Create a
|
|
114
|
-
*
|
|
128
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
129
|
+
*
|
|
130
|
+
* @returns _Flow_ function
|
|
115
131
|
*/
|
|
116
132
|
declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): AttemptFlow<First, Fourth>;
|
|
117
133
|
/**
|
|
118
|
-
* Create a
|
|
119
|
-
*
|
|
134
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
135
|
+
*
|
|
136
|
+
* @returns _Flow_ function
|
|
120
137
|
*/
|
|
121
138
|
declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth): AttemptFlow<First, Fifth>;
|
|
122
139
|
/**
|
|
123
|
-
* Create a
|
|
124
|
-
*
|
|
140
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
141
|
+
*
|
|
142
|
+
* @returns _Flow_ function
|
|
125
143
|
*/
|
|
126
144
|
declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth): AttemptFlow<First, Sixth>;
|
|
127
145
|
/**
|
|
128
|
-
* Create a
|
|
129
|
-
*
|
|
146
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
147
|
+
*
|
|
148
|
+
* @returns _Flow_ function
|
|
130
149
|
*/
|
|
131
150
|
declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh): AttemptFlow<First, Seventh>;
|
|
132
151
|
/**
|
|
133
|
-
* Create a
|
|
134
|
-
*
|
|
152
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
153
|
+
*
|
|
154
|
+
* @returns _Flow_ function
|
|
135
155
|
*/
|
|
136
156
|
declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth): AttemptFlow<First, Eighth>;
|
|
137
157
|
/**
|
|
138
|
-
* Create a
|
|
139
|
-
*
|
|
158
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
159
|
+
*
|
|
160
|
+
* @returns _Flow_ function
|
|
140
161
|
*/
|
|
141
162
|
declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth): AttemptFlow<First, Ninth>;
|
|
142
163
|
/**
|
|
143
|
-
* Create a
|
|
144
|
-
*
|
|
164
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
165
|
+
*
|
|
166
|
+
* @returns _Flow_ function
|
|
145
167
|
*/
|
|
146
168
|
declare function attemptFlow<First extends GenericCallback, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(first: First, second: (value: UnwrapValue<ReturnType<First>>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth, tenth: (value: UnwrapValue<Ninth>) => Tenth): AttemptFlow<First, Tenth>;
|
|
147
169
|
/**
|
|
148
|
-
* Create a
|
|
149
|
-
*
|
|
170
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
171
|
+
*
|
|
172
|
+
* @returns _Flow_ function
|
|
150
173
|
*/
|
|
151
174
|
declare function attemptFlow<First extends GenericCallback>(first: First, ...fns: Array<(value: UnwrapValue<ReturnType<First>>) => unknown>): AttemptFlow<First, ReturnType<First>>;
|
|
152
175
|
/**
|
|
153
|
-
* Create a
|
|
154
|
-
*
|
|
176
|
+
* Create a _Flow_, a function that attempts to pipe values through a series of functions
|
|
177
|
+
*
|
|
178
|
+
* @returns _Flow_ function
|
|
155
179
|
*/
|
|
156
180
|
declare function attemptFlow(...fns: GenericCallback[]): (...args: unknown[]) => Result<unknown>;
|
|
157
181
|
declare namespace attemptFlow {
|
|
@@ -6,155 +6,177 @@ type WrapValue<Value> = Result<UnwrapValue<Value>>;
|
|
|
6
6
|
/**
|
|
7
7
|
* Attempt to pipe a value through a function
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
10
|
+
*
|
|
10
11
|
* @param initial Initial value
|
|
11
|
-
* @returns
|
|
12
|
+
* @returns _Piped_ result
|
|
12
13
|
*/
|
|
13
14
|
declare function attemptAsyncPipe<Initial, Piped>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, pipe: (value: UnwrapValue<Initial>) => Piped): Promise<WrapValue<Piped>>;
|
|
14
15
|
/**
|
|
15
16
|
* Attempt to pipe a value through a series of functions
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
19
|
+
*
|
|
18
20
|
* @param initial Initial value
|
|
19
|
-
* @returns
|
|
21
|
+
* @returns _Piped_ result
|
|
20
22
|
*/
|
|
21
23
|
declare function attemptAsyncPipe<Initial, First, Second>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second): Promise<WrapValue<Second>>;
|
|
22
24
|
/**
|
|
23
25
|
* Attempt to pipe a value through a series of functions
|
|
24
26
|
*
|
|
25
|
-
*
|
|
27
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
28
|
+
*
|
|
26
29
|
* @param initial Initial value
|
|
27
|
-
* @returns
|
|
30
|
+
* @returns _Piped_ result
|
|
28
31
|
*/
|
|
29
32
|
declare function attemptAsyncPipe<Initial, First, Second, Third>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third): Promise<WrapValue<Third>>;
|
|
30
33
|
/**
|
|
31
34
|
* Attempt to pipe a value through a series of functions
|
|
32
35
|
*
|
|
33
|
-
*
|
|
36
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
37
|
+
*
|
|
34
38
|
* @param initial Initial value
|
|
35
|
-
* @returns
|
|
39
|
+
* @returns _Piped_ result
|
|
36
40
|
*/
|
|
37
41
|
declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): Promise<WrapValue<Fourth>>;
|
|
38
42
|
/**
|
|
39
43
|
* Attempt to pipe a value through a series of functions
|
|
40
44
|
*
|
|
41
|
-
*
|
|
45
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
46
|
+
*
|
|
42
47
|
* @param initial Initial value
|
|
43
|
-
* @returns
|
|
48
|
+
* @returns _Piped_ result
|
|
44
49
|
*/
|
|
45
50
|
declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth): Promise<WrapValue<Fifth>>;
|
|
46
51
|
/**
|
|
47
52
|
* Attempt to pipe a value through a series of functions
|
|
48
53
|
*
|
|
49
|
-
*
|
|
54
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
55
|
+
*
|
|
50
56
|
* @param initial Initial value
|
|
51
|
-
* @returns
|
|
57
|
+
* @returns _Piped_ result
|
|
52
58
|
*/
|
|
53
59
|
declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth): Promise<WrapValue<Sixth>>;
|
|
54
60
|
/**
|
|
55
61
|
* Attempt to pipe a value through a series of functions
|
|
56
62
|
*
|
|
57
|
-
*
|
|
63
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
64
|
+
*
|
|
58
65
|
* @param initial Initial value
|
|
59
|
-
* @returns
|
|
66
|
+
* @returns _Piped_ result
|
|
60
67
|
*/
|
|
61
68
|
declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh): Promise<WrapValue<Seventh>>;
|
|
62
69
|
/**
|
|
63
70
|
* Attempt to pipe a value through a series of functions
|
|
64
71
|
*
|
|
65
|
-
*
|
|
72
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
73
|
+
*
|
|
66
74
|
* @param initial Initial value
|
|
67
|
-
* @returns
|
|
75
|
+
* @returns _Piped_ result
|
|
68
76
|
*/
|
|
69
77
|
declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth): Promise<WrapValue<Eighth>>;
|
|
70
78
|
/**
|
|
71
79
|
* Attempt to pipe a value through a series of functions
|
|
72
80
|
*
|
|
73
|
-
*
|
|
81
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
82
|
+
*
|
|
74
83
|
* @param initial Initial value
|
|
75
|
-
* @returns
|
|
84
|
+
* @returns _Piped_ result
|
|
76
85
|
*/
|
|
77
86
|
declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth): Promise<WrapValue<Ninth>>;
|
|
78
87
|
/**
|
|
79
88
|
* Attempt to pipe a value through a series of functions
|
|
80
89
|
*
|
|
81
|
-
*
|
|
90
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
91
|
+
*
|
|
82
92
|
* @param initial Initial value
|
|
83
|
-
* @returns
|
|
93
|
+
* @returns _Piped_ result
|
|
84
94
|
*/
|
|
85
95
|
declare function attemptAsyncPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth, tenth: (value: UnwrapValue<Ninth>) => Tenth): Promise<WrapValue<Tenth>>;
|
|
86
96
|
/**
|
|
87
97
|
* Attempt to pipe a result through a series of functions
|
|
88
98
|
*
|
|
89
|
-
*
|
|
99
|
+
* _Available as `attemptAsyncPipe` and `attemptPipe.async`_
|
|
100
|
+
*
|
|
90
101
|
* @param initial Initial result
|
|
91
|
-
* @returns
|
|
102
|
+
* @returns _Piped_ result
|
|
92
103
|
*/
|
|
93
104
|
declare function attemptAsyncPipe<Initial>(initial: GenericCallback | Initial | Promise<Initial> | Result<Initial>, first?: (value: UnwrapValue<Initial>) => unknown, ...seconds: Array<(value: unknown) => unknown>): Promise<WrapValue<Initial>>;
|
|
94
105
|
/**
|
|
95
106
|
* Attempt to pipe a value through a function
|
|
107
|
+
*
|
|
96
108
|
* @param initial Initial value
|
|
97
|
-
* @returns
|
|
109
|
+
* @returns _Piped_ result
|
|
98
110
|
*/
|
|
99
111
|
declare function attemptPipe<Initial, Pipe>(initial: GenericCallback | Initial | Result<Initial>, pipe: (value: UnwrapValue<Initial>) => Pipe): WrapValue<Pipe>;
|
|
100
112
|
/**
|
|
101
113
|
* Attempt to pipe a value through a series of functions
|
|
114
|
+
*
|
|
102
115
|
* @param initial Initial value
|
|
103
|
-
* @returns
|
|
116
|
+
* @returns _Piped_ result
|
|
104
117
|
*/
|
|
105
118
|
declare function attemptPipe<Initial, First, Second>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second): WrapValue<Second>;
|
|
106
119
|
/**
|
|
107
120
|
* Attempt to pipe a value through a series of functions
|
|
121
|
+
*
|
|
108
122
|
* @param initial Initial value
|
|
109
|
-
* @returns
|
|
123
|
+
* @returns _Piped_ result
|
|
110
124
|
*/
|
|
111
125
|
declare function attemptPipe<Initial, First, Second, Third>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third): WrapValue<Third>;
|
|
112
126
|
/**
|
|
113
127
|
* Attempt to pipe a value through a series of functions
|
|
128
|
+
*
|
|
114
129
|
* @param initial Initial value
|
|
115
|
-
* @returns
|
|
130
|
+
* @returns _Piped_ result
|
|
116
131
|
*/
|
|
117
132
|
declare function attemptPipe<Initial, First, Second, Third, Fourth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth): WrapValue<Fourth>;
|
|
118
133
|
/**
|
|
119
134
|
* Attempt to pipe a value through a series of functions
|
|
135
|
+
*
|
|
120
136
|
* @param initial Initial value
|
|
121
|
-
* @returns
|
|
137
|
+
* @returns _Piped_ result
|
|
122
138
|
*/
|
|
123
139
|
declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth): WrapValue<Fifth>;
|
|
124
140
|
/**
|
|
125
141
|
* Attempt to pipe a value through a series of functions
|
|
142
|
+
*
|
|
126
143
|
* @param initial Initial value
|
|
127
|
-
* @returns
|
|
144
|
+
* @returns _Piped_ result
|
|
128
145
|
*/
|
|
129
146
|
declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth): WrapValue<Sixth>;
|
|
130
147
|
/**
|
|
131
148
|
* Attempt to pipe a value through a series of functions
|
|
149
|
+
*
|
|
132
150
|
* @param initial Initial value
|
|
133
|
-
* @returns
|
|
151
|
+
* @returns _Piped_ result
|
|
134
152
|
*/
|
|
135
153
|
declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh): WrapValue<Seventh>;
|
|
136
154
|
/**
|
|
137
155
|
* Attempt to pipe a value through a series of functions
|
|
156
|
+
*
|
|
138
157
|
* @param initial Initial value
|
|
139
|
-
* @returns
|
|
158
|
+
* @returns _Piped_ result
|
|
140
159
|
*/
|
|
141
160
|
declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth): WrapValue<Eighth>;
|
|
142
161
|
/**
|
|
143
162
|
* Attempt to pipe a value through a series of functions
|
|
163
|
+
*
|
|
144
164
|
* @param initial Initial value
|
|
145
|
-
* @returns
|
|
165
|
+
* @returns _Piped_ result
|
|
146
166
|
*/
|
|
147
167
|
declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth): WrapValue<Ninth>;
|
|
148
168
|
/**
|
|
149
169
|
* Attempt to pipe a value through a series of functions
|
|
170
|
+
*
|
|
150
171
|
* @param initial Initial value
|
|
151
|
-
* @returns
|
|
172
|
+
* @returns _Piped_ result
|
|
152
173
|
*/
|
|
153
174
|
declare function attemptPipe<Initial, First, Second, Third, Fourth, Fifth, Sixth, Seventh, Eighth, Ninth, Tenth>(initial: GenericCallback | Initial | Result<Initial>, first: (value: UnwrapValue<Initial>) => First, second: (value: UnwrapValue<First>) => Second, third: (value: UnwrapValue<Second>) => Third, fourth: (value: UnwrapValue<Third>) => Fourth, fifth: (value: UnwrapValue<Fourth>) => Fifth, sixth: (value: UnwrapValue<Fifth>) => Sixth, seventh: (value: UnwrapValue<Sixth>) => Seventh, eighth: (value: UnwrapValue<Seventh>) => Eighth, ninth: (value: UnwrapValue<Eighth>) => Ninth, tenth: (value: UnwrapValue<Ninth>) => Tenth): WrapValue<Tenth>;
|
|
154
175
|
/**
|
|
155
176
|
* Attempt to pipe a result through a series of functions
|
|
177
|
+
*
|
|
156
178
|
* @param initial Initial result
|
|
157
|
-
* @returns
|
|
179
|
+
* @returns _Piped_ result
|
|
158
180
|
*/
|
|
159
181
|
declare function attemptPipe<Initial>(initial: GenericCallback | Initial | Result<Initial>, first?: (value: UnwrapValue<Initial>) => unknown, ...seconds: Array<(value: unknown) => unknown>): WrapValue<Initial>;
|
|
160
182
|
declare namespace attemptPipe {
|
package/dist/sized/map.d.mts
CHANGED
|
@@ -1,36 +1,39 @@
|
|
|
1
1
|
//#region src/sized/map.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* A
|
|
3
|
+
* A _Map_ with a maximum size
|
|
4
4
|
*
|
|
5
|
-
* Behavior is similar to a _LRU_
|
|
5
|
+
* Behavior is similar to a _LRU_ cache, where the least recently used entries are removed
|
|
6
6
|
*/
|
|
7
7
|
declare class SizedMap<SizedKey = unknown, SizedValue = unknown> extends Map<SizedKey, SizedValue> {
|
|
8
8
|
#private;
|
|
9
9
|
/**
|
|
10
|
-
* Is the
|
|
10
|
+
* Is the _Map_ full?
|
|
11
11
|
*/
|
|
12
12
|
get full(): boolean;
|
|
13
13
|
get maximum(): number;
|
|
14
14
|
/**
|
|
15
|
-
* Create a new
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
18
|
-
* @template
|
|
15
|
+
* Create a new _SizedMap_ with entries and a maximum size _(2^20)_
|
|
16
|
+
*
|
|
17
|
+
* @param entries Array of key-value pairs to initialize the _SizedMap_ with
|
|
18
|
+
* @template SizedKey Type of the keys in the _SizedMap_
|
|
19
|
+
* @template SizedValue Type of the values in the _SizedMap_
|
|
19
20
|
*/
|
|
20
21
|
constructor(entries: [SizedKey, SizedValue][]);
|
|
21
22
|
/**
|
|
22
|
-
* Create a new
|
|
23
|
-
*
|
|
24
|
-
* @
|
|
25
|
-
* @template
|
|
23
|
+
* Create a new _SizedMap_ with a maximum size _(but clamped at 2^24)_
|
|
24
|
+
*
|
|
25
|
+
* @param maximum Maximum size of the _SizedMap_
|
|
26
|
+
* @template SizedKey Type of the keys in the _SizedMap_
|
|
27
|
+
* @template SizedValue Type of the values in the _SizedMap_
|
|
26
28
|
*/
|
|
27
29
|
constructor(maximum: number);
|
|
28
30
|
/**
|
|
29
|
-
* Create a new
|
|
30
|
-
*
|
|
31
|
-
* @param
|
|
32
|
-
* @
|
|
33
|
-
* @template
|
|
31
|
+
* Create a new _SizedMap_ with _(optional)_ entries and a maximum size
|
|
32
|
+
*
|
|
33
|
+
* @param entries Array of key-value pairs to initialize the _SizedMap_ with
|
|
34
|
+
* @param maximum Maximum size of the _SizedMap_ _(defaults to 2^20; clamped at 2^24)_
|
|
35
|
+
* @template SizedKey Type of the keys in the _SizedMap_
|
|
36
|
+
* @template SizedValue Type of the values in the _SizedMap_
|
|
34
37
|
*/
|
|
35
38
|
constructor(entries?: [SizedKey, SizedValue][], maximum?: number);
|
|
36
39
|
/**
|
package/dist/sized/map.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { getSizedMaximum } from "../internal/sized.mjs";
|
|
2
2
|
//#region src/sized/map.ts
|
|
3
3
|
/**
|
|
4
|
-
* A
|
|
4
|
+
* A _Map_ with a maximum size
|
|
5
5
|
*
|
|
6
|
-
* Behavior is similar to a _LRU_
|
|
6
|
+
* Behavior is similar to a _LRU_ cache, where the least recently used entries are removed
|
|
7
7
|
*/
|
|
8
8
|
var SizedMap = class extends Map {
|
|
9
9
|
/**
|
|
10
|
-
* The maximum size of the
|
|
10
|
+
* The maximum size of the _Map_
|
|
11
11
|
*/
|
|
12
12
|
#maximumSize;
|
|
13
13
|
/**
|
|
14
|
-
* Is the
|
|
14
|
+
* Is the _Map_ full?
|
|
15
15
|
*/
|
|
16
16
|
get full() {
|
|
17
17
|
return super.size >= this.#maximumSize;
|
package/dist/sized/set.d.mts
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
//#region src/sized/set.d.ts
|
|
2
2
|
/**
|
|
3
|
-
* A
|
|
3
|
+
* A _Set_ with a maximum size
|
|
4
4
|
*
|
|
5
|
-
* Behavior is similar to a _LRU_
|
|
5
|
+
* Behavior is similar to a _LRU_ cache, where the oldest values are removed
|
|
6
6
|
*/
|
|
7
7
|
declare class SizedSet<Value = unknown> extends Set<Value> {
|
|
8
8
|
#private;
|
|
9
9
|
/**
|
|
10
|
-
* Is the
|
|
10
|
+
* Is the _Set_ full?
|
|
11
11
|
*/
|
|
12
12
|
get full(): boolean;
|
|
13
13
|
get maximum(): number;
|
|
14
14
|
/**
|
|
15
|
-
* Create a new
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
15
|
+
* Create a new _SizedSet_ with values and a maximum size _(2^20)_
|
|
16
|
+
*
|
|
17
|
+
* @param values Array of values to initialize the _SizedSet_ with
|
|
18
|
+
* @template Value Type of the values in the _SizedSet_
|
|
18
19
|
*/
|
|
19
20
|
constructor(values: Value[]);
|
|
20
21
|
/**
|
|
21
|
-
* Create a new
|
|
22
|
-
*
|
|
23
|
-
* @
|
|
22
|
+
* Create a new _SizedSet_ with a maximum size _(but clamped at 2^24)_
|
|
23
|
+
*
|
|
24
|
+
* @param maximum Maximum size of the _SizedSet_ _(defaults to 2^20; clamped at 2^24)_
|
|
25
|
+
* @template Value Type of the values in the _SizedSet_
|
|
24
26
|
*/
|
|
25
27
|
constructor(maximum: number);
|
|
26
28
|
/**
|
|
27
|
-
* Create a new
|
|
28
|
-
*
|
|
29
|
-
* @param
|
|
30
|
-
* @
|
|
29
|
+
* Create a new _SizedSet_ with _(optional)_ values and a maximum size
|
|
30
|
+
*
|
|
31
|
+
* @param values Array of values to initialize the _SizedSet_ with
|
|
32
|
+
* @param maximum Maximum size of the _SizedSet_ _(defaults to 2^20; clamped at 2^24)_
|
|
33
|
+
* @template Value Type of the values in the _SizedSet_
|
|
31
34
|
*/
|
|
32
35
|
constructor(values?: Value[], maximum?: number);
|
|
33
36
|
/**
|
|
@@ -35,9 +38,10 @@ declare class SizedSet<Value = unknown> extends Set<Value> {
|
|
|
35
38
|
*/
|
|
36
39
|
add(value: Value): this;
|
|
37
40
|
/**
|
|
38
|
-
* Get a value from the
|
|
39
|
-
*
|
|
40
|
-
* @param
|
|
41
|
+
* Get a value from the _SizedSet_, if it exists _(and optionally move it to the end)_
|
|
42
|
+
*
|
|
43
|
+
* @param value Value to get from the _SizedSet_
|
|
44
|
+
* @param update Update the value's position in the _SizedSet_? _(defaults to `false`)_
|
|
41
45
|
* @returns Found value if it exists, otherwise `undefined`
|
|
42
46
|
*/
|
|
43
47
|
get(value: Value, update?: boolean): Value | undefined;
|