ctx-core 5.10.0 → 5.13.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/all/bind_apply/index.d.ts +26 -6
- package/all/bind_apply/index.js +5 -5
- package/all/bind_apply/index.test.ts +19 -0
- package/all/bind_call/index.d.ts +22 -4
- package/all/bind_call/index.js +1 -1
- package/all/bind_call/index.test.ts +18 -0
- package/all/call/index.d.ts +1 -1
- package/all/ctx/index.d.ts +1 -1
- package/all/index.d.ts +2 -3
- package/all/index.js +2 -3
- package/all/nullish__guard__async/index.js +1 -1
- package/all/nullish__none/index.d.ts +1 -1
- package/all/rmemo/index.d.ts +2 -2
- package/all/rmemo/index.js +3 -3
- package/all/rmemo/index.test.ts +6 -6
- package/all/rmemo__wait/index.js +2 -2
- package/all/run/index.d.ts +0 -1
- package/all/run/index.js +0 -1
- package/all/tap/index.d.ts +9 -11
- package/all/tap/index.test.ts +10 -0
- package/all/timeout/index.d.ts +3 -0
- package/all/timeout/index.js +8 -0
- package/all/timeout/index.test.ts +8 -0
- package/all/timeout_promise/index.d.ts +7 -6
- package/all/timeout_promise/index.js +28 -8
- package/all/{promise_timeout → timeout_promise}/index.test.ts +9 -7
- package/all/tup/index.d.ts +0 -28
- package/all/tuple/index.d.ts +28 -0
- package/all/tuple/index.js +1 -0
- package/all/tuple__o/index.d.ts +2 -2
- package/all/tuple__union/index.d.ts +1 -1
- package/all/tuple_a_o/index.d.ts +1 -1
- package/all/waitfor/index.d.ts +1 -0
- package/all/waitfor/index.js +3 -2
- package/all/waitfor_fibonacci_backoff/index.js +4 -1
- package/all/zip__tuple_a/index.d.ts +2 -2
- package/falsy/index.d.ts +4 -0
- package/falsy/index.js +4 -0
- package/function/index.d.ts +5 -4
- package/function/index.js +5 -4
- package/nullish/index.d.ts +6 -0
- package/nullish/index.js +6 -0
- package/package.json +250 -239
- package/promise/index.d.ts +11 -0
- package/promise/index.js +11 -0
- package/rmemo/index.d.ts +10 -2
- package/rmemo/index.js +10 -2
- package/run/index.d.ts +12 -0
- package/run/index.js +12 -0
- package/tuple/index.d.ts +6 -0
- package/tuple/index.js +6 -0
- package/all/Timeout/index.d.ts +0 -1
- package/all/Timeout/index.js +0 -1
- package/all/promise_timeout/index.d.ts +0 -6
- package/all/promise_timeout/index.js +0 -30
- package/all/waitfor_val/index.d.ts +0 -6
- package/all/waitfor_val/index.js +0 -20
package/all/waitfor/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cancel } from '../cancel/index.js'
|
|
2
|
-
import {
|
|
2
|
+
import { timeout_promise } from '../timeout_promise/index.js'
|
|
3
3
|
import { sleep } from '../sleep/index.js'
|
|
4
4
|
/**
|
|
5
5
|
* @param {()=>Promise<unknown>}fn
|
|
@@ -15,7 +15,7 @@ export function waitfor(
|
|
|
15
15
|
let rv
|
|
16
16
|
let cancel_arg_a
|
|
17
17
|
let promise = new Promise((resolve, reject)=>
|
|
18
|
-
|
|
18
|
+
timeout_promise(async ()=>{
|
|
19
19
|
for (; !cancel_arg_a;) {
|
|
20
20
|
let _rv = await fn()
|
|
21
21
|
rv = cancel_arg_a?.length ? cancel_arg_a[0] : _rv
|
|
@@ -39,6 +39,7 @@ export function waitfor(
|
|
|
39
39
|
}
|
|
40
40
|
return promise
|
|
41
41
|
}
|
|
42
|
+
export { waitfor as waitfor_val, waitfor as waitfor_val_ }
|
|
42
43
|
/**
|
|
43
44
|
* @param {number}ms
|
|
44
45
|
* @param {()=>boolean}should_cancel_
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { fibonacci_number_ } from '../fibonacci_number/index.js'
|
|
2
2
|
import { sleep } from '../sleep/index.js'
|
|
3
|
+
// TODO: Handle generic conditions.
|
|
4
|
+
// TODO: Then add to ./promise.
|
|
5
|
+
// TODO: Handle Response specific logic either with a function overload or with a separate function.
|
|
3
6
|
/**
|
|
4
7
|
* @param {()=>Promise<Response>}fn
|
|
5
8
|
* @param {number}[delay]
|
|
@@ -8,7 +11,7 @@ import { sleep } from '../sleep/index.js'
|
|
|
8
11
|
export async function waitfor_fibonacci_backoff(fn, delay = 500) {
|
|
9
12
|
let response
|
|
10
13
|
let delay_n = 1
|
|
11
|
-
|
|
14
|
+
for (;;) {
|
|
12
15
|
response = await fn()
|
|
13
16
|
if (response.status === 429) {
|
|
14
17
|
const fibonacci_number = fibonacci_number_(delay_n)
|
package/falsy/index.d.ts
ADDED
package/falsy/index.js
ADDED
package/function/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { run } from '../all/run/index.js'
|
|
2
|
+
export { run as _ }
|
|
1
3
|
export * from '../all/LessThan/index.js'
|
|
2
4
|
export * from '../all/NumericRange/index.js'
|
|
3
5
|
export * from '../all/a/index.js'
|
|
@@ -68,7 +70,7 @@ export * from '../all/or_property/index.js'
|
|
|
68
70
|
export * from '../all/performance__now/index.js'
|
|
69
71
|
export * from '../all/promise/index.js'
|
|
70
72
|
export * from '../all/promise_o/index.js'
|
|
71
|
-
export * from '../all/
|
|
73
|
+
export * from '../all/timeout_promise/index.js'
|
|
72
74
|
export * from '../all/resolver_curry/index.js'
|
|
73
75
|
export * from '../all/right_and/index.js'
|
|
74
76
|
export * from '../all/right_or/index.js'
|
|
@@ -82,17 +84,16 @@ export * from '../all/tap/index.js'
|
|
|
82
84
|
export * from '../all/tf/index.js'
|
|
83
85
|
export * from '../all/throttle/index.js'
|
|
84
86
|
export * from '../all/tick/index.js'
|
|
85
|
-
export * from '../all/
|
|
86
|
-
export * from '../all/timeout_promise/index.js'
|
|
87
|
+
export * from '../all/timeout/index.js'
|
|
87
88
|
export * from '../all/times/index.js'
|
|
88
89
|
export * from '../all/tup/index.js'
|
|
90
|
+
export * from '../all/tuple/index.js'
|
|
89
91
|
export * from '../all/tuple__o/index.js'
|
|
90
92
|
export * from '../all/tuple_a_o/index.js'
|
|
91
93
|
export * from '../all/tuple__union/index.js'
|
|
92
94
|
export * from '../all/val/index.js'
|
|
93
95
|
export * from '../all/valueof/index.js'
|
|
94
96
|
export * from '../all/waitfor/index.js'
|
|
95
|
-
export * from '../all/waitfor_val/index.js'
|
|
96
97
|
export * from '../all/wrap_a/index.js'
|
|
97
98
|
export * from '../all/wrap_a_item/index.js'
|
|
98
99
|
export * from '../all/wrap_aa/index.js'
|
package/function/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { run } from '../all/run/index.js'
|
|
2
|
+
export { run as _ }
|
|
1
3
|
export * from '../all/LessThan/index.js'
|
|
2
4
|
export * from '../all/NumericRange/index.js'
|
|
3
5
|
export * from '../all/a/index.js'
|
|
@@ -68,7 +70,7 @@ export * from '../all/or_property/index.js'
|
|
|
68
70
|
export * from '../all/performance__now/index.js'
|
|
69
71
|
export * from '../all/promise/index.js'
|
|
70
72
|
export * from '../all/promise_o/index.js'
|
|
71
|
-
export * from '../all/
|
|
73
|
+
export * from '../all/timeout_promise/index.js'
|
|
72
74
|
export * from '../all/resolver_curry/index.js'
|
|
73
75
|
export * from '../all/right_and/index.js'
|
|
74
76
|
export * from '../all/right_or/index.js'
|
|
@@ -82,17 +84,16 @@ export * from '../all/tap/index.js'
|
|
|
82
84
|
export * from '../all/tf/index.js'
|
|
83
85
|
export * from '../all/throttle/index.js'
|
|
84
86
|
export * from '../all/tick/index.js'
|
|
85
|
-
export * from '../all/
|
|
86
|
-
export * from '../all/timeout_promise/index.js'
|
|
87
|
+
export * from '../all/timeout/index.js'
|
|
87
88
|
export * from '../all/times/index.js'
|
|
88
89
|
export * from '../all/tup/index.js'
|
|
90
|
+
export * from '../all/tuple/index.js'
|
|
89
91
|
export * from '../all/tuple__o/index.js'
|
|
90
92
|
export * from '../all/tuple_a_o/index.js'
|
|
91
93
|
export * from '../all/tuple__union/index.js'
|
|
92
94
|
export * from '../all/val/index.js'
|
|
93
95
|
export * from '../all/valueof/index.js'
|
|
94
96
|
export * from '../all/waitfor/index.js'
|
|
95
|
-
export * from '../all/waitfor_val/index.js'
|
|
96
97
|
export * from '../all/wrap_a/index.js'
|
|
97
98
|
export * from '../all/wrap_a_item/index.js'
|
|
98
99
|
export * from '../all/wrap_aa/index.js'
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from '../all/null/index.js'
|
|
2
|
+
export * from '../all/nullish/index.js'
|
|
3
|
+
export * from '../all/nullish__guard/index.js'
|
|
4
|
+
export * from '../all/nullish__guard__async/index.js'
|
|
5
|
+
export * from '../all/nullish__none/index.js'
|
|
6
|
+
export * from '../all/nullish__not_all/index.js'
|
package/nullish/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from '../all/null/index.js'
|
|
2
|
+
export * from '../all/nullish/index.js'
|
|
3
|
+
export * from '../all/nullish__guard/index.js'
|
|
4
|
+
export * from '../all/nullish__guard__async/index.js'
|
|
5
|
+
export * from '../all/nullish__none/index.js'
|
|
6
|
+
export * from '../all/nullish__not_all/index.js'
|