ctx-core 4.18.0 → 5.0.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 (193) hide show
  1. package/all/CacheControl_1hour_headers_/index.d.ts +5 -0
  2. package/all/CacheControl_1hour_headers_/index.js +10 -0
  3. package/all/CacheControl_5min_headers_/index.d.ts +5 -0
  4. package/all/CacheControl_5min_headers_/index.js +10 -0
  5. package/all/ContentType__is_binary_/index.d.ts +1 -0
  6. package/all/ContentType__is_binary_/index.js +9 -0
  7. package/all/ContentType_json_headers_/index.d.ts +5 -0
  8. package/all/ContentType_json_headers_/index.js +10 -0
  9. package/all/ContentType_svg_headers_/index.d.ts +5 -0
  10. package/all/ContentType_svg_headers_/index.js +10 -0
  11. package/all/a_in_idx_a_map/index.d.ts +1 -3
  12. package/all/a_item/index.d.ts +3 -9
  13. package/all/a_length/index.d.ts +4 -7
  14. package/all/a_nowrap/index.d.ts +1 -3
  15. package/all/a_present/index.d.ts +4 -7
  16. package/all/a_some/index.d.ts +1 -3
  17. package/all/and/index.d.ts +3 -9
  18. package/all/and_call/index.d.ts +4 -8
  19. package/all/andand/index.d.ts +4 -11
  20. package/all/andand_or/index.d.ts +6 -8
  21. package/all/andandfn/index.d.ts +3 -12
  22. package/all/apply/index.d.ts +2 -2
  23. package/all/arg_i0_a/index.d.ts +1 -1
  24. package/all/array_types/index.d.ts +21 -28
  25. package/all/assign_fn_key_a/index.d.ts +1 -3
  26. package/all/be/index.d.ts +5 -3
  27. package/all/be_/index.d.ts +69 -48
  28. package/all/be_/index.js +39 -76
  29. package/all/be_/index.test.ts +244 -121
  30. package/all/be_lock_memosig_triple/index.d.ts +16 -22
  31. package/all/be_lock_memosig_triple/index.test.ts +47 -36
  32. package/all/be_memo_pair/index.d.ts +14 -11
  33. package/all/be_memo_pair/index.js +1 -2
  34. package/all/be_memo_pair/index.test.ts +47 -31
  35. package/all/be_memosig_triple/index.d.ts +16 -22
  36. package/all/be_memosig_triple/index.test.ts +48 -34
  37. package/all/be_sig_triple/index.d.ts +16 -13
  38. package/all/be_sig_triple/index.js +2 -3
  39. package/all/be_sig_triple/index.test.ts +42 -29
  40. package/all/bind_apply/index.d.ts +3 -3
  41. package/all/bind_call/index.d.ts +10 -11
  42. package/all/bind_map_apply/index.d.ts +2 -2
  43. package/all/bind_map_call/index.d.ts +2 -2
  44. package/all/call/index.d.ts +3 -3
  45. package/all/call_assign/index.d.ts +2 -6
  46. package/all/call_fn_a/index.d.ts +4 -3
  47. package/all/call_or_fn/index.d.ts +1 -4
  48. package/all/chain/index.d.ts +4 -8
  49. package/all/chunk_aa/index.d.ts +3 -5
  50. package/all/clear_ctx/index.d.ts +1 -3
  51. package/all/combinators/index.d.ts +12 -49
  52. package/all/compact/index.d.ts +4 -7
  53. package/all/compact_a_ctx/index.d.ts +1 -3
  54. package/all/compare/index.d.ts +1 -3
  55. package/all/compose/index.d.ts +3 -3
  56. package/all/concat/index.d.ts +2 -6
  57. package/all/concat_truthy_a/index.d.ts +3 -4
  58. package/all/ctx/index.d.ts +18 -2
  59. package/all/ctx/index.js +20 -8
  60. package/all/ctx/index.test.ts +33 -7
  61. package/all/curry/index.d.ts +5 -7
  62. package/all/curry/index.js +6 -3
  63. package/all/debounce/index.d.ts +12 -12
  64. package/all/difference_a/index.d.ts +1 -3
  65. package/all/difference_by/index.d.ts +3 -4
  66. package/all/difference_set/index.d.ts +1 -5
  67. package/all/each/index.d.ts +5 -9
  68. package/all/ensure/index.d.ts +1 -3
  69. package/all/ensure__refresh/index.d.ts +1 -3
  70. package/all/eq/index.d.ts +4 -10
  71. package/all/eql/index.d.ts +3 -9
  72. package/all/eql_a/index.d.ts +1 -3
  73. package/all/eql_fn_a/index.d.ts +1 -3
  74. package/all/every/index.d.ts +3 -9
  75. package/all/exclude/index.d.ts +1 -4
  76. package/all/ext_R_mime/index.d.ts +86 -0
  77. package/all/ext_R_mime/index.js +86 -0
  78. package/all/falsy_async_guard/index.d.ts +3 -4
  79. package/all/falsy_guard/index.d.ts +4 -3
  80. package/all/fetch__template_pair/index.test.ts +5 -5
  81. package/all/filter/index.d.ts +4 -12
  82. package/all/find/index.d.ts +6 -10
  83. package/all/first/index.d.ts +2 -7
  84. package/all/flatten/index.d.ts +2 -6
  85. package/all/flip/index.d.ts +3 -3
  86. package/all/hasOwnProperty_pick/index.d.ts +4 -4
  87. package/all/head_arg_a/index.d.ts +4 -3
  88. package/all/http__headers__assign/index.d.ts +11 -0
  89. package/all/http__headers__assign/index.js +11 -0
  90. package/all/idx/index.d.ts +1 -3
  91. package/all/idx_reject/index.d.ts +3 -9
  92. package/all/idx_sort_a/index.d.ts +1 -3
  93. package/all/idx_sort_a__sort_idx_o/index.d.ts +1 -3
  94. package/all/idx_sort_r_a/index.d.ts +1 -3
  95. package/all/if_null_set_false/index.d.ts +1 -3
  96. package/all/ifelse/index.d.ts +5 -3
  97. package/all/iife/index.d.ts +3 -3
  98. package/all/index.d.ts +9 -0
  99. package/all/index.js +9 -0
  100. package/all/internal_server_error__throw/index.d.ts +5 -0
  101. package/all/internal_server_error__throw/index.js +7 -0
  102. package/all/intersection_a/index.d.ts +5 -6
  103. package/all/intersection_by/index.d.ts +3 -4
  104. package/all/intersection_set/index.d.ts +1 -3
  105. package/all/isArray/index.d.ts +2 -2
  106. package/all/last/index.d.ts +2 -7
  107. package/all/left_and/index.d.ts +1 -3
  108. package/all/left_or/index.d.ts +1 -3
  109. package/all/many_andand/index.d.ts +7 -6
  110. package/all/many_andand_or/index.d.ts +2 -8
  111. package/all/map/index.d.ts +4 -18
  112. package/all/map_andand/index.d.ts +3 -9
  113. package/all/map_andand_or/index.d.ts +1 -3
  114. package/all/map_andandfn/index.d.ts +2 -6
  115. package/all/map_apply/index.d.ts +5 -8
  116. package/all/map_call/index.d.ts +5 -8
  117. package/all/map_find/index.d.ts +3 -11
  118. package/all/map_fn/index.d.ts +1 -4
  119. package/all/map_obj/index.d.ts +3 -12
  120. package/all/map_obj_andand/index.d.ts +2 -8
  121. package/all/merge/index.d.ts +1 -4
  122. package/all/mixin/index.d.ts +1 -4
  123. package/all/neq/index.d.ts +2 -6
  124. package/all/neql/index.d.ts +2 -6
  125. package/all/noinit/index.d.ts +5 -8
  126. package/all/not/index.d.ts +3 -9
  127. package/all/notnot/index.d.ts +2 -4
  128. package/all/nullish__guard/index.d.ts +3 -4
  129. package/all/nullish__guard__async/index.d.ts +3 -4
  130. package/all/nullish__none/index.d.ts +1 -3
  131. package/all/o_a_present/index.d.ts +2 -6
  132. package/all/o_some/index.d.ts +1 -3
  133. package/all/offset_destructure_aa/index.d.ts +1 -3
  134. package/all/offset_i_slice/index.d.ts +2 -6
  135. package/all/one_andand/index.d.ts +3 -3
  136. package/all/one_andand_or/index.d.ts +3 -5
  137. package/all/or/index.d.ts +6 -17
  138. package/all/or_property/index.d.ts +1 -5
  139. package/all/promise_timeout/index.d.ts +4 -4
  140. package/all/prototype_mixin/index.d.ts +4 -3
  141. package/all/prototype_mixin/index.js +3 -3
  142. package/all/push/index.d.ts +2 -6
  143. package/all/r_val_a/index.d.ts +2 -6
  144. package/all/rank/index.d.ts +3 -4
  145. package/all/reduce/index.d.ts +10 -23
  146. package/all/reject/index.d.ts +7 -14
  147. package/all/remove/index.d.ts +2 -6
  148. package/all/remove_idx/index.d.ts +4 -4
  149. package/all/resolver_curry/index.d.ts +2 -2
  150. package/all/reverse/index.d.ts +2 -10
  151. package/all/right_and/index.d.ts +1 -3
  152. package/all/right_or/index.d.ts +1 -3
  153. package/all/rmemo/index.js +3 -3
  154. package/all/rmemo__wait/index.test.ts +1 -1
  155. package/all/run/index.d.ts +1 -4
  156. package/all/selector_splice/index.d.ts +1 -3
  157. package/all/slice/index.d.ts +5 -15
  158. package/all/slice_arg_a/index.d.ts +3 -12
  159. package/all/slice_arg_spread_a/index.d.ts +3 -11
  160. package/all/sort/index.d.ts +4 -14
  161. package/all/sort_a/index.d.ts +2 -6
  162. package/all/sort_idx_a/index.d.ts +2 -6
  163. package/all/sort_idx_o/index.d.ts +2 -6
  164. package/all/sort_val_a/index.d.ts +2 -6
  165. package/all/sort_val_a__transition_idx_a/index.d.ts +4 -12
  166. package/all/sort_val_a__transition_idx_a/index.js +4 -2
  167. package/all/sparse_a/index.d.ts +1 -3
  168. package/all/splice/index.d.ts +2 -6
  169. package/all/spread/index.d.ts +2 -6
  170. package/all/tap/index.d.ts +1 -3
  171. package/all/test/index.d.ts +12 -0
  172. package/all/test/index.js +1 -0
  173. package/all/throttle/index.d.ts +2 -2
  174. package/all/throttle/index.js +8 -7
  175. package/all/tick/index.d.ts +1 -5
  176. package/all/timeout_promise/index.d.ts +1 -5
  177. package/all/times/index.d.ts +1 -5
  178. package/all/tup/index.d.ts +22 -6
  179. package/all/union_a/index.d.ts +1 -3
  180. package/all/union_set/index.d.ts +1 -5
  181. package/all/val/index.d.ts +1 -3
  182. package/all/value_r/index.d.ts +2 -6
  183. package/all/weak_r/index.d.ts +3 -3
  184. package/all/wrap_a/index.d.ts +4 -12
  185. package/all/wrap_a_item/index.d.ts +4 -3
  186. package/all/wrap_aa/index.d.ts +2 -8
  187. package/all/wrap_aa_item/index.d.ts +4 -3
  188. package/all/wrap_concat/index.d.ts +1 -5
  189. package/http/index.d.ts +8 -0
  190. package/http/index.js +8 -0
  191. package/package.json +35 -10
  192. package/test/index.d.ts +1 -0
  193. package/test/index.js +1 -0
@@ -0,0 +1,5 @@
1
+ export declare function CacheControl_1hour_headers_():Record<string, string>
2
+ export {
3
+ CacheControl_1hour_headers_ as _CacheControl_1hour_headers,
4
+ CacheControl_1hour_headers_ as _CacheControl__1hour,
5
+ }
@@ -0,0 +1,10 @@
1
+ import { assign } from '../assign/index.js'
2
+ export function CacheControl_1hour_headers_() {
3
+ return assign({
4
+ 'Cache-Control': 'public, max-age=3600'
5
+ }, ...arguments)
6
+ }
7
+ export {
8
+ CacheControl_1hour_headers_ as _CacheControl_1hour_headers,
9
+ CacheControl_1hour_headers_ as _CacheControl__1hour,
10
+ }
@@ -0,0 +1,5 @@
1
+ export declare function CacheControl_5min_headers_():Record<string, string>
2
+ export {
3
+ CacheControl_5min_headers_ as _CacheControl_5min_headers,
4
+ CacheControl_5min_headers_ as _CacheControl__5min,
5
+ }
@@ -0,0 +1,10 @@
1
+ import { assign } from '../assign/index.js'
2
+ export function CacheControl_5min_headers_() {
3
+ return assign({
4
+ 'Cache-Control': 'public, max-age=300'
5
+ }, ...arguments)
6
+ }
7
+ export {
8
+ CacheControl_5min_headers_ as _CacheControl_5min_headers,
9
+ CacheControl_5min_headers_ as _CacheControl__5min,
10
+ }
@@ -0,0 +1 @@
1
+ export function ContentType__is_binary_(ContentType:string):boolean
@@ -0,0 +1,9 @@
1
+ const is_binary__regex =
2
+ /^(image\/[^(svg)]|audio\/|video\/|application\/(pdf|zip|vnd.|msword|x-shockwave-flash|java-archive))/
3
+ /**
4
+ * @param ContentType{string}
5
+ * @return {boolean}
6
+ */
7
+ export function ContentType__is_binary_(ContentType) {
8
+ return is_binary__regex.test(ContentType)
9
+ }
@@ -0,0 +1,5 @@
1
+ export declare function ContentType_json_headers_():Record<string, string>
2
+ export {
3
+ ContentType_json_headers_ as _ContentType_json_headers,
4
+ ContentType_json_headers_ as _ContentType__json,
5
+ }
@@ -0,0 +1,10 @@
1
+ import { assign } from '../assign/index.js'
2
+ export function ContentType_json_headers_() {
3
+ return assign({
4
+ 'Content-Type': 'application/json'
5
+ }, ...arguments)
6
+ }
7
+ export {
8
+ ContentType_json_headers_ as _ContentType_json_headers,
9
+ ContentType_json_headers_ as _ContentType__json,
10
+ }
@@ -0,0 +1,5 @@
1
+ export declare function ContentType_svg_headers_():Record<string, string>
2
+ export {
3
+ ContentType_svg_headers_ as _ContentType_svg_headers,
4
+ ContentType_svg_headers_ as _ContentType__svg,
5
+ }
@@ -0,0 +1,10 @@
1
+ import { assign } from '../assign/index.js'
2
+ export function ContentType_svg_headers_() {
3
+ return assign({
4
+ 'Content-Type': 'image/svg+xml'
5
+ }, ...arguments)
6
+ }
7
+ export {
8
+ ContentType_svg_headers_ as _ContentType_svg_headers,
9
+ ContentType_svg_headers_ as _ContentType__svg,
10
+ }
@@ -1,9 +1,7 @@
1
1
  /**
2
2
  * Returns Array of values from `a` with index in `idx_a`.
3
3
  */
4
- export declare function a_in_idx_a_map<
5
- Val extends unknown = unknown
6
- >(
4
+ export declare function a_in_idx_a_map<Val>(
7
5
  idx_a:readonly number[], a:readonly Val[]
8
6
  ):Val[]
9
7
  export {
@@ -1,12 +1,6 @@
1
- export declare type a_item_T<
2
- I extends unknown = unknown
3
- > =
1
+ export declare type a_item_T<I> =
4
2
  I extends readonly (infer O)[]
5
3
  ? O
6
4
  : I
7
- export declare type a1_item_type<
8
- I extends unknown = unknown
9
- > = a_item_T<I>
10
- export declare type a1_item_T<
11
- I extends unknown = unknown
12
- > = a_item_T<I>
5
+ export declare type a1_item_type<I> = a_item_T<I>
6
+ export declare type a1_item_T<I> = a_item_T<I>
@@ -1,13 +1,10 @@
1
1
  /**
2
2
  * Returns length of `in_a`
3
3
  */
4
- export declare function a_length_<
5
- Val extends unknown = unknown
6
- >(a:readonly Val[]):number
7
- export declare function maybe_a__length_<
8
- Val extends unknown = unknown, Or = null
9
- >(
10
- maybe_a:readonly Val[]|undefined, or?:Or
4
+ export declare function a_length_<Val>(a:readonly Val[]):number
5
+ export declare function maybe_a__length_<Val, Or = null>(
6
+ maybe_a:readonly Val[]|undefined,
7
+ or?:Or
11
8
  ):number|Or
12
9
  export {
13
10
  a_length_ as a_length_fn,
@@ -1,6 +1,4 @@
1
- export declare type a_nowrap_T<
2
- I extends unknown = unknown
3
- > =
1
+ export declare type a_nowrap_T<I> =
4
2
  I
5
3
  |readonly I[]
6
4
  |readonly I[][]
@@ -2,13 +2,10 @@ import { a_length_ } from '../a_length/index.js'
2
2
  /**
3
3
  * Returns true if `a` has a length
4
4
  */
5
- export declare function a_present_<
6
- Val extends unknown = unknown
7
- >(a:readonly Val[]):boolean
8
- export declare function maybe_a_present_fn<
9
- Val extends unknown = unknown, Or = null
10
- >(
11
- maybe_a:readonly Val[]|undefined, or?:Or
5
+ export declare function a_present_<Val>(a:readonly Val[]):boolean
6
+ export declare function maybe_a_present_fn<Val, Or = null>(
7
+ maybe_a:readonly Val[]|undefined,
8
+ or?:Or
12
9
  ):boolean|Or
13
10
  export {
14
11
  a_present_ as a1_present_fn,
@@ -1,9 +1,7 @@
1
1
  /**
2
2
  * Returns true if some `predicate(value)` is truthy
3
3
  */
4
- export declare function a_some<
5
- Val extends unknown = unknown, POut extends unknown = unknown
6
- >(
4
+ export declare function a_some<Val, POut>(
7
5
  a:readonly Val[],
8
6
  predicate:(val:Val, index:number, a:readonly Val[])=>POut
9
7
  ):boolean
@@ -3,17 +3,11 @@ import type { falsy } from '../falsy/index.js'
3
3
  /**
4
4
  * Returns the first falsy or last item.
5
5
  */
6
- export declare function and<
7
- I extends unknown = unknown,
8
- O extends unknown = I
9
- >(a_nowrap:a_nowrap_T<I>):O|falsy
6
+ export declare function and<I, O = I>(a_nowrap:a_nowrap_T<I>):O|falsy
10
7
  /**
11
8
  * Returns the first falsy or last item function call or value in `in_value_a` .
12
9
  */
13
- export declare function and_<
14
- I extends unknown = unknown,
15
- O extends unknown = I
16
- >(a_nowrap:I):O|falsy
10
+ export declare function and_<I, O = I>(a_nowrap:I):O|falsy
17
11
  export { and_ as and__fn }
18
12
  /**
19
13
  * Returns function that returns the first falsy or last item function call or value in `in_value_a` .
@@ -21,7 +15,7 @@ export { and_ as and__fn }
21
15
  export declare function and_2<
22
16
  A_outer extends unknown[] = unknown[],
23
17
  A_inner extends unknown[] = unknown[],
24
- O extends unknown = unknown
18
+ O = unknown
25
19
  >(in_value_a:A_inner):(fn_value_a:A_outer)=>O|falsy
26
20
  export {
27
21
  and_2 as _and_fn,
@@ -1,14 +1,10 @@
1
1
  /**
2
2
  * Returns a function than returns the called fn_a(value) chained with ands
3
3
  */
4
- export declare function and_call_<
5
- I extends unknown = unknown,
6
- O extends unknown = unknown
7
- >(fn_a:((in_value:I)=>O)[]):and_fn_call_T<I, O>;
8
- export declare type and_fn_call_T<
9
- I extends unknown = unknown,
10
- O extends unknown = unknown
11
- > = (in_value:I)=>O|null
4
+ export declare function and_call_<I, O>(
5
+ fn_a:((in_value:I)=>O)[]
6
+ ):and_fn_call_T<I, O>
7
+ export declare type and_fn_call_T<I, O> = (in_value:I)=>O|null
12
8
  export {
13
9
  and_call_ as and_fn_call_fn,
14
10
  and_call_ as _and_fn_call,
@@ -1,14 +1,7 @@
1
1
  /**
2
2
  * Applies `&&` to a chain of properties from `obj`.
3
3
  */
4
- export declare function andand<
5
- Val extends unknown = unknown,
6
- Out extends unknown = unknown
7
- >(obj:Val, ...name_a:andand_key_T<Val>[]):Out|null
8
- export declare type andand_key_T<
9
- Val extends unknown = unknown
10
- > = keyof Val|andand_key__T<Val>
11
- export declare type andand_key__T<
12
- Val extends unknown = unknown
13
- > = (val:Val)=>keyof Val
14
- export declare type andand_key_fn_T = andand_key__T
4
+ export declare function andand<Val, Out>(obj:Val, ...name_a:andand_key_T<Val>[]):Out|null
5
+ export declare type andand_key_T<Val> = keyof Val|andand_key__T<Val>
6
+ export declare type andand_key__T<Val> = (val:Val)=>keyof Val
7
+ export declare type andand_key_fn_T<Val> = andand_key__T<Val>
@@ -2,12 +2,10 @@ import type { andand_key_T } from '../andand/index.js'
2
2
  /**
3
3
  * Returns `andand(obj, name_a) || or_fn(obj, val)`
4
4
  */
5
- export declare function andand_or<
6
- Val extends unknown = unknown,
7
- Out extends unknown = unknown
8
- >(obj:Val, name_a:andand_key_T<Val>[], or_:andand_or_T<Val, Out>):Out
9
- export declare type andand_or_T<
10
- Val extends unknown = unknown,
11
- Out extends unknown = unknown
12
- > = (val:Out|null, obj:Val)=>Out
5
+ export declare function andand_or<Val, Out>(
6
+ obj:Val,
7
+ name_a:andand_key_T<Val>[],
8
+ or_:andand_or_T<Val, Out>
9
+ ):Out
10
+ export declare type andand_or_T<Val, Out> = (val:Out|null, obj:Val)=>Out
13
11
  export { andand_or as andand__or }
@@ -2,22 +2,13 @@ import type { andand_key_T } from '../andand/index.js'
2
2
  /**
3
3
  * Applies `&&` to a chain of property name or function with return value from `obj`.
4
4
  */
5
- export declare function andandfn<
6
- Val extends unknown = unknown,
7
- Out extends unknown = unknown
8
- >(obj:Val, ...name_a:andand_key_T<Val>[]):Out
9
- export declare type andandfn_T<
10
- Val extends unknown = unknown,
11
- Out extends unknown = unknown
12
- > = (obj:Val)=>Out
5
+ export declare function andandfn<Val, Out>(obj:Val, ...name_a:andand_key_T<Val>[]):Out
6
+ export declare type andandfn_T<Val, Out> = (obj:Val)=>Out
13
7
  export { andandfn as andand__fn, }
14
8
  /**
15
9
  * Returns a function that calls `andand_(obj, ...name_a)`
16
10
  */
17
- export declare function andandfn_<
18
- In extends unknown = unknown,
19
- Out extends unknown = unknown
20
- >(
11
+ export declare function andandfn_<In, Out>(
21
12
  ...name_a:andand_key_T<In>[]
22
13
  ):andandfn_T<In, Out>
23
14
  export {
@@ -5,9 +5,9 @@ import type { call_fn_T } from '../call/index.js'
5
5
  */
6
6
  export declare function apply_<
7
7
  A1 extends unknown[] = unknown[],
8
- O1 extends unknown = unknown,
8
+ O1 = unknown,
9
9
  A2 extends unknown[] = unknown[],
10
- O2 extends unknown = unknown
10
+ O2 = unknown
11
11
  >(
12
12
  fn:call_fn_T<A2, O2>, in_arg_a?:unknown[]
13
13
  ):bind_call_T<A1, O1>
@@ -4,7 +4,7 @@ import type { slice_arg_spread_a___ret_T, slice_arg_spread_a__arg__T } from '../
4
4
  */
5
5
  export declare function arg_i0_a<
6
6
  In extends unknown[] = unknown[],
7
- Out extends unknown = unknown
7
+ Out = unknown
8
8
  >(
9
9
  fn:slice_arg_spread_a__arg__T<In, Out>
10
10
  ):slice_arg_spread_a___ret_T<In, Out>
@@ -88,47 +88,40 @@ export interface sort_val_a__transition_a_frame_T<I> {
88
88
  export declare type sort_val_a$transition_a_frame_T<I> = sort_val_a__transition_a_frame_T<I>
89
89
  export declare type compact_a_ctx_I<I> = sort_val_a__transition_a_frame_T<I>
90
90
  export declare type compact_a1_ctx_I<I> = sort_val_a__transition_a_frame_T<I>
91
- export declare type compare_1_T<
92
- Val extends unknown = unknown
93
- > = (val:Val, idx?:number)=>number
94
- export declare type compare_T<
95
- I extends unknown = unknown
96
- > = (a:I, b:I)=>number
97
- export declare type is_match__T<
98
- Val extends unknown = unknown
99
- > = (in_value:Val, idx:number)=>boolean
100
- export declare type is_match_fn_T<Val extends unknown = unknown> = is_match__T<Val>
101
- export declare type _is_match_T<Val extends unknown = unknown> = is_match__T<Val>
102
- export declare type _is_match_type<Val extends unknown = unknown> = is_match__T<Val>
91
+ export declare type compare_1_T<Val> = (val:Val, idx?:number)=>number
92
+ export declare type compare_T<I> = (a:I, b:I)=>number
93
+ export declare type is_match__T<Val> = (in_value:Val, idx:number)=>boolean
94
+ export declare type is_match_fn_T<Val> = is_match__T<Val>
95
+ export declare type _is_match_T<Val> = is_match__T<Val>
96
+ export declare type _is_match_type<Val> = is_match__T<Val>
103
97
  export declare type item_key_idx_val_fn_T<
104
- Val extends unknown = unknown,
98
+ Val,
105
99
  Obj extends Record<string, Val> = Record<string, Val>
106
100
  > = (val:Val, item:Obj, key:string|number, idx:number)=>string
107
101
  export declare type _item_key_idx_val_T<
108
- Val extends unknown = unknown,
102
+ Val,
109
103
  Obj extends Record<string, Val> = Record<string, Val>
110
104
  > = item_key_idx_val_fn_T<Val, Obj>
111
105
  export declare type _item_key_idx_val_type<
112
- Val extends unknown = unknown,
106
+ Val,
113
107
  Obj extends Record<string, Val> = Record<string, Val>
114
108
  > = item_key_idx_val_fn_T<Val, Obj>
115
- export declare type sort_idx_ctx__T<I extends unknown = unknown> = (
109
+ export declare type sort_idx_ctx__T<I> = (
116
110
  a:readonly I[])=>sort_idx_o_T<I>
117
- export declare type sort_idx_ctx_2_T<I extends unknown = unknown> = sort_idx_ctx__T<I>
118
- export declare type sort_idx_ctx_a1_fn_type<I extends unknown = unknown> = sort_idx_ctx__T<I>
119
- export declare type fn__a1__ctx__idx__sort<I extends unknown = unknown> = sort_idx_ctx__T<I>
120
- export interface sort_idx_o_T<I extends unknown = unknown> {
111
+ export declare type sort_idx_ctx_2_T<I> = sort_idx_ctx__T<I>
112
+ export declare type sort_idx_ctx_a1_fn_type<I> = sort_idx_ctx__T<I>
113
+ export declare type fn__a1__ctx__idx__sort<I> = sort_idx_ctx__T<I>
114
+ export interface sort_idx_o_T<I> {
121
115
  sort_idx_a:readonly number[]
122
116
  sort_val_a:I[]
123
117
  }
124
- export declare type sort_idx_ctx_T<I extends unknown = unknown> = sort_idx_o_T<I>
125
- export declare type ctx__idx__sort<I extends unknown = unknown> = sort_idx_o_T<I>
126
- export declare type sort_val_a__transition_a_frame_fn_T<
127
- I extends unknown = unknown
128
- > = (in_val_a:readonly I[]|undefined)=>sort_val_a__transition_a_frame_T<I>
129
- export declare type sort_val_a$transition_a_frame_fn_T<I extends unknown = unknown> =
118
+ export declare type sort_idx_ctx_T<I> = sort_idx_o_T<I>
119
+ export declare type ctx__idx__sort<I> = sort_idx_o_T<I>
120
+ export declare type sort_val_a__transition_a_frame_fn_T<I> =
121
+ (in_val_a:readonly I[]|undefined)=>sort_val_a__transition_a_frame_T<I>
122
+ export declare type sort_val_a$transition_a_frame_fn_T<I> =
130
123
  sort_val_a__transition_a_frame_T<I>
131
- export declare type thold_a_compact_ctx__T<I extends unknown = unknown> =
124
+ export declare type thold_a_compact_ctx__T<I> =
132
125
  sort_val_a__transition_a_frame_fn_T<I>
133
- export declare type thold_a1_compact_ctx_fn_type<I extends unknown = unknown> =
126
+ export declare type thold_a1_compact_ctx_fn_type<I> =
134
127
  sort_val_a__transition_a_frame_fn_T<I>
@@ -2,9 +2,7 @@ import type { assign_fn_T } from '../call_assign/index.js'
2
2
  /**
3
3
  * Assigns to obj array of keys the return value of function in key_a_fn_aa.
4
4
  */
5
- export declare function assign_fn_key_a<
6
- I extends unknown = unknown
7
- >(
5
+ export declare function assign_fn_key_a<I>(
8
6
  obj:Record<string, I>,
9
7
  ...key_a_fn_aa:fn_key_a_tuple_T<I>[]
10
8
  ):Record<string, I>
package/all/be/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
- import type { be__val__new_T, Ctx } from '../be_/index.js'
1
+ import type { be__val__new_T, Ctx, Ctx_wide_T } from '../be_/index.js'
2
2
  export declare function be<
3
- Out extends NonNullable<unknown>
4
- >(ctx:Ctx, val_:be__val__new_T<Out>):Out
3
+ Out extends NonNullable<unknown>,
4
+ ns_T extends string = '',
5
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>
6
+ >(ctx:ctx_T, val_:be__val__new_T<Out, ns_T, ctx_T>):Out
5
7
  export { be as b, }
@@ -1,8 +1,10 @@
1
- export declare const pending_symbol:unique symbol
2
1
  export declare function globalThis__be_<
3
2
  val_T,
4
- ctx_T extends Ctx = Ctx
5
- >(val__new:be__val__new_T<val_T, ctx_T>, config:be_config_T&{ id: string }):Be<val_T, ctx_T>
3
+ ns_T extends string = '',
4
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>
5
+ >(val__new:be__val__new_T<val_T, ns_T, ctx_T>, config:be_config_T<ns_T>&{
6
+ id:string
7
+ }):Be<val_T, ns_T, ctx_T>
6
8
  /**
7
9
  * Auto-memoization function for the Ctx.
8
10
  *
@@ -11,69 +13,88 @@ export declare function globalThis__be_<
11
13
  */
12
14
  export declare function be_<
13
15
  val_T,
14
- ctx_T extends Ctx = Ctx
15
- >(val__new:be__val__new_T<val_T, ctx_T>, config?:be_config_T):Be<val_T, ctx_T>
16
- export type be___T<
17
- val_T,
18
- ctx_T extends Ctx = Ctx
19
- > = typeof be_<val_T, ctx_T>
20
- export declare function be__is_source_<
21
- ctx_T extends Ctx = Ctx
22
- >(be:Be<unknown>):(map_ctx:MapCtx, ctx:ctx_T)=>boolean
23
- export declare function source__map_ctx_<
24
- ctx_T extends Ctx = Ctx
25
- >(ctx:ctx_T, is_source_:is_source__T):MapCtx
16
+ ns_T extends string = '',
17
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>,
18
+ >(
19
+ val__new:be__val__new_T<val_T, ns_T, ctx_T>,
20
+ config?:be_config_T<ns_T>
21
+ ):Be<val_T, ns_T, ctx_T>
26
22
  export declare function ctx__set<
27
23
  val_T,
28
- ctx_T extends Ctx = Ctx
24
+ ns_T extends string = '',
25
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>
29
26
  >(
30
27
  ctx:ctx_T,
31
28
  be_OR_id:Be<val_T>|string|symbol,
32
29
  val:val_T,
33
- is_source_?:is_source__T
30
+ ns?:ns_T
34
31
  ):void
35
32
  export declare function ctx__delete<
36
- val_T,
37
- ctx_T extends Ctx = Ctx
33
+ ns_T extends string = '',
34
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>,
38
35
  >(
39
36
  ctx:ctx_T,
40
- be_OR_id:Be<val_T>|string|symbol,
41
- is_source_?:is_source__T
37
+ be_OR_id:Be<unknown, ns_T, ctx_T>|string|symbol,
38
+ ns?:string
42
39
  ):void
43
40
  export declare function be__has_<
44
- ctx_T extends Ctx = Ctx
45
- >(be_OR_id:Be<unknown>|string, ctx:ctx_T):boolean
46
- export declare function be__ctx_<
47
- ctx_T extends Ctx = Ctx
48
- >(be_OR_id:Be<unknown>|string, ctx:ctx_T):MapCtx
41
+ ns_T extends string = '',
42
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>,
43
+ >(be_OR_id:Be<unknown, ns_T, ctx_T>|string, ctx:ctx_T, ns?:ns_T):boolean
44
+ export declare function be_map__find<
45
+ ns_T extends string = '',
46
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>,
47
+ >(be_OR_id:Be<unknown, ns_T, ctx_T>|string, ctx:ctx_T, ns?:ns_T):BeMap<ns_T>
49
48
  export declare function be__val_<
50
49
  val_T,
51
- ctx_T extends Ctx = Ctx
52
- >(be_OR_id:Be<val_T>|string, ctx:ctx_T):val_T|unknown|null
53
- export type MapCtx = Map<Be<unknown>|string|symbol, unknown>&{ is_ctx: true }
54
- export type NestedMapCtx = Array<NestedMapCtx|MapCtx>
55
- export type Ctx = MapCtx|NestedMapCtx
50
+ ns_T extends string = '',
51
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>,
52
+ >(be_OR_id:Be<val_T, ns_T, ctx_T>|string, ctx:ctx_T, ns?:ns_T):val_T|unknown|null
56
53
  export declare type Be<
57
54
  val_T,
58
- ctx_T extends Ctx = Ctx
59
- > = ((ctx:ctx_T)=>val_T)&{
60
- is_be: true
61
- id:string|Be<val_T, ctx_T>
55
+ ns_T extends string = '',
56
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>,
57
+ > = ((ctx:ctx_T)=>val_T)&be_o_T<val_T, ns_T, ctx_T>
58
+ export type be_o_T<
59
+ val_T,
60
+ ns_T extends string = '',
61
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>,
62
+ > = {
63
+ id:string|Be<val_T, ns_T, ctx_T>
64
+ ns:ns_T
65
+ is_be:true
62
66
  }
63
- export type be_config_T = {
67
+ export type be_config_T<ns_T extends string = string> = {
64
68
  id?:string
65
- is_source_?:is_source__T
69
+ ns?:ns_T
66
70
  }
67
- export declare type be__return_T<
68
- val_T,
69
- ctx_T extends Ctx = Ctx
70
- > = Be<val_T, ctx_T>
71
- export declare type be_T<
72
- val_T,
73
- ctx_T extends Ctx = Ctx
74
- > = Be<val_T, ctx_T>
71
+ export type BeMap<
72
+ ns_T extends string = ''
73
+ > = Map<Be<unknown, ns_T, Ctx_wide_T<ns_T>>|string|symbol, unknown>
74
+ export type BeMapO<ns_union_T extends string> =
75
+ { [K in ns_union_T]:BeMap<K> }
75
76
  export declare type be__val__new_T<
76
77
  val_T,
77
- ctx_T extends Ctx = Ctx
78
- > = (ctx:ctx_T, be:Be<val_T, ctx_T>)=>val_T
79
- export type is_source__T = (map_ctx:MapCtx, ctx:Ctx)=>boolean
78
+ ns_T extends string = '',
79
+ ctx_T extends Ctx = Ctx_wide_T<ns_T>
80
+ > = (ctx:ctx_T, be:Be<val_T, ns_T, ctx_T>)=>val_T
81
+ export type Ctx<ns_T extends string = string> = Readonly<{
82
+ s:Ctx_s_T<ns_T>
83
+ is_ctx:true
84
+ /**
85
+ * Used for type inference narrowing. There is no js implementation.
86
+ */
87
+ ns_T?:ns_T
88
+ }>
89
+ export type Ctx_wide_T<ns_union_T extends string> =
90
+ Ctx&Ctx_s_wide_T<ns_union_T>
91
+ export type Ctx_s_T<ns_union_T extends string = string> = {
92
+ [K in ns_union_T]:BeMap<K>
93
+ }
94
+ export type Ctx_s_wide_T<ns_union_T extends string> = {
95
+ s:BeMapO<ns_union_T>
96
+ }
97
+ export type ctx__be_T<ctx_T extends Ctx, be_val_T, ns_T extends string> =
98
+ Be<be_val_T, ns_T, ctx_T>
99
+ export type ctx__get_T<ctx_T extends Ctx, val_T> = (ctx:ctx_T)=>val_T
100
+ export type ctx__set_T<ctx_T extends Ctx, val_T> = (ctx:ctx_T, val:val_T)=>void