ctx-core 4.19.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.
- package/all/a_in_idx_a_map/index.d.ts +1 -3
- package/all/a_item/index.d.ts +3 -9
- package/all/a_length/index.d.ts +4 -7
- package/all/a_nowrap/index.d.ts +1 -3
- package/all/a_present/index.d.ts +4 -7
- package/all/a_some/index.d.ts +1 -3
- package/all/and/index.d.ts +3 -9
- package/all/and_call/index.d.ts +4 -8
- package/all/andand/index.d.ts +4 -11
- package/all/andand_or/index.d.ts +6 -8
- package/all/andandfn/index.d.ts +3 -12
- package/all/apply/index.d.ts +2 -2
- package/all/arg_i0_a/index.d.ts +1 -1
- package/all/array_types/index.d.ts +21 -28
- package/all/assign_fn_key_a/index.d.ts +1 -3
- package/all/be/index.d.ts +5 -3
- package/all/be_/index.d.ts +69 -48
- package/all/be_/index.js +39 -76
- package/all/be_/index.test.ts +244 -121
- package/all/be_lock_memosig_triple/index.d.ts +16 -22
- package/all/be_lock_memosig_triple/index.test.ts +47 -36
- package/all/be_memo_pair/index.d.ts +14 -11
- package/all/be_memo_pair/index.js +1 -2
- package/all/be_memo_pair/index.test.ts +47 -31
- package/all/be_memosig_triple/index.d.ts +16 -22
- package/all/be_memosig_triple/index.test.ts +48 -34
- package/all/be_sig_triple/index.d.ts +16 -13
- package/all/be_sig_triple/index.js +2 -3
- package/all/be_sig_triple/index.test.ts +42 -29
- package/all/bind_apply/index.d.ts +3 -3
- package/all/bind_call/index.d.ts +10 -11
- package/all/bind_map_apply/index.d.ts +2 -2
- package/all/bind_map_call/index.d.ts +2 -2
- package/all/call/index.d.ts +3 -3
- package/all/call_assign/index.d.ts +2 -6
- package/all/call_fn_a/index.d.ts +4 -3
- package/all/call_or_fn/index.d.ts +1 -4
- package/all/chain/index.d.ts +4 -8
- package/all/chunk_aa/index.d.ts +3 -5
- package/all/clear_ctx/index.d.ts +1 -3
- package/all/combinators/index.d.ts +12 -49
- package/all/compact/index.d.ts +4 -7
- package/all/compact_a_ctx/index.d.ts +1 -3
- package/all/compare/index.d.ts +1 -3
- package/all/compose/index.d.ts +3 -3
- package/all/concat/index.d.ts +2 -6
- package/all/concat_truthy_a/index.d.ts +3 -4
- package/all/ctx/index.d.ts +18 -2
- package/all/ctx/index.js +20 -8
- package/all/ctx/index.test.ts +33 -7
- package/all/curry/index.d.ts +5 -7
- package/all/curry/index.js +6 -3
- package/all/debounce/index.d.ts +12 -12
- package/all/difference_a/index.d.ts +1 -3
- package/all/difference_by/index.d.ts +3 -4
- package/all/difference_set/index.d.ts +1 -5
- package/all/each/index.d.ts +5 -9
- package/all/ensure/index.d.ts +1 -3
- package/all/ensure__refresh/index.d.ts +1 -3
- package/all/eq/index.d.ts +4 -10
- package/all/eql/index.d.ts +3 -9
- package/all/eql_a/index.d.ts +1 -3
- package/all/eql_fn_a/index.d.ts +1 -3
- package/all/every/index.d.ts +3 -9
- package/all/exclude/index.d.ts +1 -4
- package/all/falsy_async_guard/index.d.ts +3 -4
- package/all/falsy_guard/index.d.ts +4 -3
- package/all/fetch__template_pair/index.test.ts +5 -5
- package/all/filter/index.d.ts +4 -12
- package/all/find/index.d.ts +6 -10
- package/all/first/index.d.ts +2 -7
- package/all/flatten/index.d.ts +2 -6
- package/all/flip/index.d.ts +3 -3
- package/all/hasOwnProperty_pick/index.d.ts +4 -4
- package/all/head_arg_a/index.d.ts +4 -3
- package/all/idx/index.d.ts +1 -3
- package/all/idx_reject/index.d.ts +3 -9
- package/all/idx_sort_a/index.d.ts +1 -3
- package/all/idx_sort_a__sort_idx_o/index.d.ts +1 -3
- package/all/idx_sort_r_a/index.d.ts +1 -3
- package/all/if_null_set_false/index.d.ts +1 -3
- package/all/ifelse/index.d.ts +5 -3
- package/all/iife/index.d.ts +3 -3
- package/all/index.d.ts +1 -0
- package/all/index.js +1 -0
- package/all/intersection_a/index.d.ts +5 -6
- package/all/intersection_by/index.d.ts +3 -4
- package/all/intersection_set/index.d.ts +1 -3
- package/all/isArray/index.d.ts +2 -2
- package/all/last/index.d.ts +2 -7
- package/all/left_and/index.d.ts +1 -3
- package/all/left_or/index.d.ts +1 -3
- package/all/many_andand/index.d.ts +7 -6
- package/all/many_andand_or/index.d.ts +2 -8
- package/all/map/index.d.ts +4 -18
- package/all/map_andand/index.d.ts +3 -9
- package/all/map_andand_or/index.d.ts +1 -3
- package/all/map_andandfn/index.d.ts +2 -6
- package/all/map_apply/index.d.ts +5 -8
- package/all/map_call/index.d.ts +5 -8
- package/all/map_find/index.d.ts +3 -11
- package/all/map_fn/index.d.ts +1 -4
- package/all/map_obj/index.d.ts +3 -12
- package/all/map_obj_andand/index.d.ts +2 -8
- package/all/merge/index.d.ts +1 -4
- package/all/mixin/index.d.ts +1 -4
- package/all/neq/index.d.ts +2 -6
- package/all/neql/index.d.ts +2 -6
- package/all/noinit/index.d.ts +5 -8
- package/all/not/index.d.ts +3 -9
- package/all/notnot/index.d.ts +2 -4
- package/all/nullish__guard/index.d.ts +3 -4
- package/all/nullish__guard__async/index.d.ts +3 -4
- package/all/nullish__none/index.d.ts +1 -3
- package/all/o_a_present/index.d.ts +2 -6
- package/all/o_some/index.d.ts +1 -3
- package/all/offset_destructure_aa/index.d.ts +1 -3
- package/all/offset_i_slice/index.d.ts +2 -6
- package/all/one_andand/index.d.ts +3 -3
- package/all/one_andand_or/index.d.ts +3 -5
- package/all/or/index.d.ts +6 -17
- package/all/or_property/index.d.ts +1 -5
- package/all/promise_timeout/index.d.ts +4 -4
- package/all/prototype_mixin/index.d.ts +4 -3
- package/all/prototype_mixin/index.js +3 -3
- package/all/push/index.d.ts +2 -6
- package/all/r_val_a/index.d.ts +2 -6
- package/all/rank/index.d.ts +3 -4
- package/all/reduce/index.d.ts +10 -23
- package/all/reject/index.d.ts +7 -14
- package/all/remove/index.d.ts +2 -6
- package/all/remove_idx/index.d.ts +4 -4
- package/all/resolver_curry/index.d.ts +2 -2
- package/all/reverse/index.d.ts +2 -10
- package/all/right_and/index.d.ts +1 -3
- package/all/right_or/index.d.ts +1 -3
- package/all/rmemo/index.js +3 -3
- package/all/rmemo__wait/index.test.ts +1 -1
- package/all/run/index.d.ts +1 -4
- package/all/selector_splice/index.d.ts +1 -3
- package/all/slice/index.d.ts +5 -15
- package/all/slice_arg_a/index.d.ts +3 -12
- package/all/slice_arg_spread_a/index.d.ts +3 -11
- package/all/sort/index.d.ts +4 -14
- package/all/sort_a/index.d.ts +2 -6
- package/all/sort_idx_a/index.d.ts +2 -6
- package/all/sort_idx_o/index.d.ts +2 -6
- package/all/sort_val_a/index.d.ts +2 -6
- package/all/sort_val_a__transition_idx_a/index.d.ts +4 -12
- package/all/sort_val_a__transition_idx_a/index.js +4 -2
- package/all/sparse_a/index.d.ts +1 -3
- package/all/splice/index.d.ts +2 -6
- package/all/spread/index.d.ts +2 -6
- package/all/tap/index.d.ts +1 -3
- package/all/test/index.d.ts +12 -0
- package/all/test/index.js +1 -0
- package/all/throttle/index.d.ts +2 -2
- package/all/throttle/index.js +8 -7
- package/all/tick/index.d.ts +1 -5
- package/all/timeout_promise/index.d.ts +1 -5
- package/all/times/index.d.ts +1 -5
- package/all/tup/index.d.ts +22 -6
- package/all/union_a/index.d.ts +1 -3
- package/all/union_set/index.d.ts +1 -5
- package/all/val/index.d.ts +1 -3
- package/all/value_r/index.d.ts +2 -6
- package/all/weak_r/index.d.ts +3 -3
- package/all/wrap_a/index.d.ts +4 -12
- package/all/wrap_a_item/index.d.ts +4 -3
- package/all/wrap_aa/index.d.ts +2 -8
- package/all/wrap_aa_item/index.d.ts +4 -3
- package/all/wrap_concat/index.d.ts +1 -5
- package/package.json +33 -10
- package/test/index.d.ts +1 -0
- package/test/index.js +1 -0
package/all/a_item/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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>
|
package/all/a_length/index.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns length of `in_a`
|
|
3
3
|
*/
|
|
4
|
-
export declare function a_length_<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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,
|
package/all/a_nowrap/index.d.ts
CHANGED
package/all/a_present/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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,
|
package/all/a_some/index.d.ts
CHANGED
|
@@ -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
|
package/all/and/index.d.ts
CHANGED
|
@@ -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
|
|
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,
|
package/all/and_call/index.d.ts
CHANGED
|
@@ -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
|
|
6
|
-
|
|
7
|
-
>(
|
|
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,
|
package/all/andand/index.d.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Applies `&&` to a chain of properties from `obj`.
|
|
3
3
|
*/
|
|
4
|
-
export declare function andand<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
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>
|
package/all/andand_or/index.d.ts
CHANGED
|
@@ -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
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 }
|
package/all/andandfn/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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 {
|
package/all/apply/index.d.ts
CHANGED
|
@@ -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
|
|
8
|
+
O1 = unknown,
|
|
9
9
|
A2 extends unknown[] = unknown[],
|
|
10
|
-
O2
|
|
10
|
+
O2 = unknown
|
|
11
11
|
>(
|
|
12
12
|
fn:call_fn_T<A2, O2>, in_arg_a?:unknown[]
|
|
13
13
|
):bind_call_T<A1, O1>
|
package/all/arg_i0_a/index.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
93
|
-
> = (
|
|
94
|
-
export declare type
|
|
95
|
-
|
|
96
|
-
> =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
118
|
-
export declare type sort_idx_ctx_a1_fn_type<I
|
|
119
|
-
export declare type fn__a1__ctx__idx__sort<I
|
|
120
|
-
export interface sort_idx_o_T<I
|
|
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
|
|
125
|
-
export declare type ctx__idx__sort<I
|
|
126
|
-
export declare type sort_val_a__transition_a_frame_fn_T<
|
|
127
|
-
I
|
|
128
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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, }
|
package/all/be_/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export declare const pending_symbol:unique symbol
|
|
2
1
|
export declare function globalThis__be_<
|
|
3
2
|
val_T,
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
val_T,
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
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
|
-
|
|
30
|
+
ns?:ns_T
|
|
34
31
|
):void
|
|
35
32
|
export declare function ctx__delete<
|
|
36
|
-
|
|
37
|
-
ctx_T extends 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<
|
|
41
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
69
|
+
ns?:ns_T
|
|
66
70
|
}
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
package/all/be_/index.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/** @typedef {import('./index.d.ts').be_config_T} */
|
|
4
|
-
/** @typedef {import('./index.d.ts').Ctx} */
|
|
5
|
-
/** @typedef {import('./index.d.ts').MapCtx} */
|
|
6
|
-
/** @typedef {import('./index.d.ts').be__val__new_T} */
|
|
7
|
-
/** @typedef {import('./index.d.ts').is_source__T} */
|
|
1
|
+
/// <reference types="./index.d.ts" />
|
|
2
|
+
let _undefined
|
|
8
3
|
/**
|
|
9
4
|
* Auto-memoization function for the Ctx.
|
|
10
5
|
*
|
|
@@ -16,27 +11,22 @@
|
|
|
16
11
|
* @private
|
|
17
12
|
*/
|
|
18
13
|
export function be_(val__new, config) {
|
|
19
|
-
let be =
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// 'cir' is used instead of 'circular' to reduce the payload by a few bytes
|
|
33
|
-
be__ctx.set(be.id, 'cir')
|
|
34
|
-
be__ctx.set(be.id, val__new(argv__ctx, be))
|
|
35
|
-
}
|
|
36
|
-
return be__ctx.get(be.id)
|
|
14
|
+
let be = ctx=>{
|
|
15
|
+
let be_map = ctx.s[be.ns]
|
|
16
|
+
/* @if DEBUG **
|
|
17
|
+
// ~ 30 B
|
|
18
|
+
if (!be_map) throw Error('ctx_no_ns: \'' + be.ns + '\'')
|
|
19
|
+
/* @endif */
|
|
20
|
+
if (be_map.has(be.id)) return be_map.get(be.id)
|
|
21
|
+
// circular dependency state
|
|
22
|
+
// if val__new calls this be before returning, 'cir' will be the value of this be
|
|
23
|
+
// 'cir' is used instead of 'circular' to reduce the payload by a few bytes
|
|
24
|
+
be_map.set(be.id, 'cir')
|
|
25
|
+
be_map.set(be.id, val__new(ctx, be))
|
|
26
|
+
return be_map.get(be.id)
|
|
37
27
|
}
|
|
38
28
|
be.id = config?.id ?? be
|
|
39
|
-
be.
|
|
29
|
+
be.ns = config?.ns ?? ''
|
|
40
30
|
be.is_be = true
|
|
41
31
|
return be
|
|
42
32
|
}
|
|
@@ -57,7 +47,7 @@ export { be_ as globalThis__be_ }
|
|
|
57
47
|
* @param {Ctx}ctx
|
|
58
48
|
* @param {Be|string|symbol}be_OR_id
|
|
59
49
|
* @param {unknown}val
|
|
60
|
-
* @param {
|
|
50
|
+
* @param {string}[ns]
|
|
61
51
|
* @returns {unknown}
|
|
62
52
|
* @private
|
|
63
53
|
*/
|
|
@@ -65,80 +55,53 @@ export function ctx__set(
|
|
|
65
55
|
ctx,
|
|
66
56
|
be_OR_id,
|
|
67
57
|
val,
|
|
68
|
-
|
|
58
|
+
ns = be_OR_id.ns ?? ''
|
|
69
59
|
) {
|
|
70
|
-
|
|
71
|
-
if (source__map_ctx) {
|
|
72
|
-
source__map_ctx.set(be_OR_id.id ?? be_OR_id, val)
|
|
73
|
-
}
|
|
60
|
+
ctx.s[ns].set(be_OR_id.id ?? be_OR_id, val)
|
|
74
61
|
}
|
|
75
62
|
/**
|
|
76
63
|
* @param {Ctx}ctx
|
|
77
64
|
* @param {Be|string|symbol}be_OR_id
|
|
65
|
+
* @param {string}[ns]
|
|
78
66
|
*/
|
|
79
67
|
export function ctx__delete(
|
|
80
68
|
ctx,
|
|
81
69
|
be_OR_id,
|
|
70
|
+
ns = be_OR_id.ns ?? ''
|
|
82
71
|
) {
|
|
83
|
-
if (
|
|
84
|
-
|
|
85
|
-
ctx__delete(_ctx, be_OR_id)
|
|
86
|
-
}
|
|
72
|
+
if (ns != null) {
|
|
73
|
+
ctx.s[ns].delete(be_OR_id.id ?? be_OR_id)
|
|
87
74
|
} else {
|
|
88
|
-
|
|
75
|
+
for (let _source in ctx.s) {
|
|
76
|
+
ctx.s[_source].delete(be_OR_id.id ?? be_OR_id)
|
|
77
|
+
}
|
|
89
78
|
}
|
|
90
79
|
}
|
|
91
80
|
/**
|
|
92
|
-
* @param {Be|string}
|
|
93
|
-
* @param {Ctx}argv__ctx
|
|
81
|
+
* @param {[Be|string, Ctx]|[Be|string, Ctx, string]}arg_a
|
|
94
82
|
* @returns {boolean}
|
|
95
83
|
* @private
|
|
96
84
|
*/
|
|
97
|
-
export function be__has_(
|
|
98
|
-
return Boolean(
|
|
85
|
+
export function be__has_(...arg_a) {
|
|
86
|
+
return Boolean(be_map__find(...arg_a))
|
|
99
87
|
}
|
|
100
88
|
/**
|
|
101
|
-
* @param {Be
|
|
102
|
-
* @param {Ctx}
|
|
103
|
-
* @
|
|
89
|
+
* @param {Be}be_or_id
|
|
90
|
+
* @param {Ctx}ctx
|
|
91
|
+
* @param {string}[ns]
|
|
92
|
+
* @returns {Ctx}
|
|
104
93
|
* @private
|
|
105
94
|
*/
|
|
106
|
-
export function
|
|
107
|
-
|
|
108
|
-
for (let ctx of argv__ctx) {
|
|
109
|
-
let be__ctx = be__ctx_(be_or_id.id ?? be_or_id, ctx)
|
|
110
|
-
if (be__ctx) return be__ctx
|
|
111
|
-
}
|
|
112
|
-
} else {
|
|
113
|
-
if (argv__ctx.has(be_or_id.id ?? be_or_id)) return argv__ctx
|
|
114
|
-
}
|
|
95
|
+
export function be_map__find(be_or_id, ctx, ns = be_or_id.ns ?? '') {
|
|
96
|
+
return ctx.s[ns].has(be_or_id.id ?? be_or_id) ? ctx.s[ns] : _undefined
|
|
115
97
|
}
|
|
116
|
-
export { be__ctx_ as be__has__ctx_ }
|
|
117
98
|
/**
|
|
118
99
|
* @param {Be|string}be_or_id
|
|
119
|
-
* @param {Ctx}
|
|
120
|
-
* @
|
|
121
|
-
* @private
|
|
122
|
-
*/
|
|
123
|
-
export function be__val_(be_or_id, argv__ctx) {
|
|
124
|
-
let be__ctx = be__ctx_(be_or_id, argv__ctx)
|
|
125
|
-
if (be__ctx) return be__ctx.get(be_or_id.id ?? be_or_id)
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* @param {Ctx}argv__ctx
|
|
129
|
-
* @param {is_source__T}is_source_
|
|
100
|
+
* @param {Ctx}ctx
|
|
101
|
+
* @param {string}[ns]
|
|
130
102
|
* @returns {unknown}
|
|
131
103
|
* @private
|
|
132
104
|
*/
|
|
133
|
-
export function
|
|
134
|
-
|
|
135
|
-
for (let ctx of argv__ctx) {
|
|
136
|
-
let source__map_ctx = source__map_ctx_(ctx, is_source_)
|
|
137
|
-
if (source__map_ctx) return source__map_ctx
|
|
138
|
-
}
|
|
139
|
-
} else {
|
|
140
|
-
if (!is_source_ || is_source_(argv__ctx, argv__ctx)) {
|
|
141
|
-
return argv__ctx
|
|
142
|
-
}
|
|
143
|
-
}
|
|
105
|
+
export function be__val_(be_or_id, ctx, ns) {
|
|
106
|
+
return be_map__find(be_or_id, ctx, ns)?.get?.(be_or_id.id ?? be_or_id)
|
|
144
107
|
}
|