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.
Files changed (57) hide show
  1. package/all/bind_apply/index.d.ts +26 -6
  2. package/all/bind_apply/index.js +5 -5
  3. package/all/bind_apply/index.test.ts +19 -0
  4. package/all/bind_call/index.d.ts +22 -4
  5. package/all/bind_call/index.js +1 -1
  6. package/all/bind_call/index.test.ts +18 -0
  7. package/all/call/index.d.ts +1 -1
  8. package/all/ctx/index.d.ts +1 -1
  9. package/all/index.d.ts +2 -3
  10. package/all/index.js +2 -3
  11. package/all/nullish__guard__async/index.js +1 -1
  12. package/all/nullish__none/index.d.ts +1 -1
  13. package/all/rmemo/index.d.ts +2 -2
  14. package/all/rmemo/index.js +3 -3
  15. package/all/rmemo/index.test.ts +6 -6
  16. package/all/rmemo__wait/index.js +2 -2
  17. package/all/run/index.d.ts +0 -1
  18. package/all/run/index.js +0 -1
  19. package/all/tap/index.d.ts +9 -11
  20. package/all/tap/index.test.ts +10 -0
  21. package/all/timeout/index.d.ts +3 -0
  22. package/all/timeout/index.js +8 -0
  23. package/all/timeout/index.test.ts +8 -0
  24. package/all/timeout_promise/index.d.ts +7 -6
  25. package/all/timeout_promise/index.js +28 -8
  26. package/all/{promise_timeout → timeout_promise}/index.test.ts +9 -7
  27. package/all/tup/index.d.ts +0 -28
  28. package/all/tuple/index.d.ts +28 -0
  29. package/all/tuple/index.js +1 -0
  30. package/all/tuple__o/index.d.ts +2 -2
  31. package/all/tuple__union/index.d.ts +1 -1
  32. package/all/tuple_a_o/index.d.ts +1 -1
  33. package/all/waitfor/index.d.ts +1 -0
  34. package/all/waitfor/index.js +3 -2
  35. package/all/waitfor_fibonacci_backoff/index.js +4 -1
  36. package/all/zip__tuple_a/index.d.ts +2 -2
  37. package/falsy/index.d.ts +4 -0
  38. package/falsy/index.js +4 -0
  39. package/function/index.d.ts +5 -4
  40. package/function/index.js +5 -4
  41. package/nullish/index.d.ts +6 -0
  42. package/nullish/index.js +6 -0
  43. package/package.json +250 -239
  44. package/promise/index.d.ts +11 -0
  45. package/promise/index.js +11 -0
  46. package/rmemo/index.d.ts +10 -2
  47. package/rmemo/index.js +10 -2
  48. package/run/index.d.ts +12 -0
  49. package/run/index.js +12 -0
  50. package/tuple/index.d.ts +6 -0
  51. package/tuple/index.js +6 -0
  52. package/all/Timeout/index.d.ts +0 -1
  53. package/all/Timeout/index.js +0 -1
  54. package/all/promise_timeout/index.d.ts +0 -6
  55. package/all/promise_timeout/index.js +0 -30
  56. package/all/waitfor_val/index.d.ts +0 -6
  57. package/all/waitfor_val/index.js +0 -20
@@ -1,5 +1,5 @@
1
1
  import { Cancel } from '../cancel/index.js'
2
- import { promise_timeout } from '../promise_timeout/index.js'
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
- promise_timeout(async ()=>{
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
- while (true) {
14
+ for (;;) {
12
15
  response = await fn()
13
16
  if (response.status === 429) {
14
17
  const fibonacci_number = fibonacci_number_(delay_n)
@@ -2,8 +2,8 @@
2
2
  * @see {@link https://stackoverflow.com/a/58939723/142571}
3
3
  */
4
4
  export type zip__tuple_a_T<
5
- T extends readonly any[],
6
- U extends readonly any[]
5
+ T extends readonly unknown[],
6
+ U extends readonly unknown[]
7
7
  > = {
8
8
  [K in keyof T]:[
9
9
  T[K],
@@ -0,0 +1,4 @@
1
+ export * from '../all/falsy/index.js'
2
+ export * from '../all/falsy__none/index.js'
3
+ export * from '../all/falsy_async_guard/index.js'
4
+ export * from '../all/falsy_guard/index.js'
package/falsy/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from '../all/falsy/index.js'
2
+ export * from '../all/falsy__none/index.js'
3
+ export * from '../all/falsy_async_guard/index.js'
4
+ export * from '../all/falsy_guard/index.js'
@@ -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/promise_timeout/index.js'
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/Timeout/index.js'
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/promise_timeout/index.js'
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/Timeout/index.js'
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'
@@ -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'