ctx-core 2.2.0 → 2.2.2
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/LessThan/index.d.ts +10 -0
- package/all/LessThan/index.js +1 -0
- package/all/MAX_INT/index.d.ts +1 -0
- package/all/MAX_INT/index.js +1 -0
- package/all/MIN_INT/index.d.ts +1 -0
- package/all/MIN_INT/index.js +1 -0
- package/all/Map__object/index.d.ts +5 -0
- package/all/Map__object/index.js +9 -0
- package/all/Map__object/index.test.ts +7 -0
- package/all/NoRepetition/index.d.ts +6 -0
- package/all/NoRepetition/index.js +1 -0
- package/all/NumericRange/index.d.ts +8 -0
- package/all/NumericRange/index.js +1 -0
- package/all/NumericUnit/index.d.ts +4 -0
- package/all/NumericUnit/index.js +1 -0
- package/all/PHI/index.d.ts +1 -0
- package/all/PHI/index.js +2 -0
- package/all/Request/index.d.ts +2 -0
- package/all/Request/index.js +2 -0
- package/all/Response/index.d.ts +1 -0
- package/all/Response/index.js +2 -0
- package/all/TagType/index.d.ts +2 -0
- package/all/TagType/index.js +1 -0
- package/all/Timeout/index.d.ts +1 -0
- package/all/Timeout/index.js +1 -0
- package/all/UnorderedTuple/index.d.ts +4 -0
- package/all/UnorderedTuple/index.js +1 -0
- package/all/a/index.d.ts +1 -0
- package/all/a/index.js +3 -0
- package/all/a_assign/index.d.ts +7 -0
- package/all/a_assign/index.js +12 -0
- package/all/a_in_idx_a_map/index.d.ts +12 -0
- package/all/a_in_idx_a_map/index.js +13 -0
- package/all/a_item/index.d.ts +12 -0
- package/all/a_item/index.js +1 -0
- package/all/a_length/index.d.ts +18 -0
- package/all/a_length/index.js +21 -0
- package/all/a_nowrap/index.d.ts +7 -0
- package/all/a_nowrap/index.js +1 -0
- package/all/a_present/index.d.ts +19 -0
- package/all/a_present/index.js +24 -0
- package/all/a_some/index.d.ts +13 -0
- package/all/a_some/index.js +20 -0
- package/all/abbrev_month_a/index.d.ts +2 -0
- package/all/abbrev_month_a/index.js +15 -0
- package/all/abbreviate_number_str/index.d.ts +10 -0
- package/all/abbreviate_number_str/index.js +28 -0
- package/all/acronym/index.d.ts +2 -0
- package/all/acronym/index.js +8 -0
- package/all/add/index.d.ts +11 -0
- package/all/add/index.js +24 -0
- package/all/add/index.test.ts +14 -0
- package/all/all_union_a/index.d.ts +10 -0
- package/all/all_union_a/index.js +8 -0
- package/all/and/index.d.ts +29 -0
- package/all/and/index.js +45 -0
- package/all/and/index.test.ts +10 -0
- package/all/and_call/index.d.ts +16 -0
- package/all/and_call/index.js +20 -0
- package/all/andand/index.d.ts +14 -0
- package/all/andand/index.js +19 -0
- package/all/andand_or/index.d.ts +13 -0
- package/all/andand_or/index.js +14 -0
- package/all/andandfn/index.d.ts +26 -0
- package/all/andandfn/index.js +39 -0
- package/all/apply/index.d.ts +14 -0
- package/all/apply/index.js +14 -0
- package/all/arg_i0_a/index.d.ts +11 -0
- package/all/arg_i0_a/index.js +11 -0
- package/all/array_types/index.d.ts +134 -0
- package/all/array_types/index.js +1 -0
- package/all/assign/index.d.ts +4 -0
- package/all/assign/index.js +5 -0
- package/all/assign_fn_key_a/index.d.ts +15 -0
- package/all/assign_fn_key_a/index.js +24 -0
- package/all/assign_unless_null/index.d.ts +7 -0
- package/all/assign_unless_null/index.js +11 -0
- package/all/async_gen_a/index.d.ts +3 -0
- package/all/async_gen_a/index.js +9 -0
- package/all/async_gen_a/index.test.ts +12 -0
- package/all/at_date/index.d.ts +1 -0
- package/all/at_date/index.js +9 -0
- package/all/atob/index.d.ts +3 -0
- package/all/atob/index.js +16 -0
- package/all/atob_Uint32Array/index.d.ts +5 -0
- package/all/atob_Uint32Array/index.js +16 -0
- package/all/bad_credentials/index.d.ts +30 -0
- package/all/bad_credentials/index.js +44 -0
- package/all/bad_gateway/index.d.ts +20 -0
- package/all/bad_gateway/index.js +45 -0
- package/all/bad_request/index.d.ts +20 -0
- package/all/bad_request/index.js +45 -0
- package/all/base16_random/index.d.ts +2 -0
- package/all/base16_random/index.js +14 -0
- package/all/base64__buffer/index.d.ts +6 -0
- package/all/base64__buffer/index.js +15 -0
- package/all/batch_queue/index.d.ts +5 -0
- package/all/batch_queue/index.js +44 -0
- package/all/batch_queue/index.test.ts +149 -0
- package/all/be/index.d.ts +5 -0
- package/all/be/index.js +11 -0
- package/all/be_/index.d.ts +124 -0
- package/all/be_/index.js +272 -0
- package/all/be_/index.test.ts +251 -0
- package/all/be_arg_triple/index.d.ts +21 -0
- package/all/be_arg_triple/index.js +41 -0
- package/all/be_prop_pair/index.d.ts +36 -0
- package/all/be_prop_pair/index.js +54 -0
- package/all/be_prop_pair/index.test.ts +137 -0
- package/all/binary_sort_rank/index.d.ts +12 -0
- package/all/binary_sort_rank/index.js +30 -0
- package/all/bind_apply/index.d.ts +17 -0
- package/all/bind_apply/index.js +18 -0
- package/all/bind_call/index.d.ts +21 -0
- package/all/bind_call/index.js +18 -0
- package/all/bind_map_apply/index.d.ts +17 -0
- package/all/bind_map_apply/index.js +19 -0
- package/all/bind_map_call/index.d.ts +18 -0
- package/all/bind_map_call/index.js +21 -0
- package/all/btoa/index.d.ts +3 -0
- package/all/btoa/index.js +18 -0
- package/all/btoa/index.test.ts +7 -0
- package/all/btoa_Uint32Array/index.d.ts +8 -0
- package/all/btoa_Uint32Array/index.js +20 -0
- package/all/buffer__base64/index.d.ts +6 -0
- package/all/buffer__base64/index.js +22 -0
- package/all/buffer__hex/index.d.ts +1 -0
- package/all/buffer__hex/index.js +14 -0
- package/all/call/index.d.ts +22 -0
- package/all/call/index.js +23 -0
- package/all/call_assign/index.d.ts +13 -0
- package/all/call_assign/index.js +18 -0
- package/all/call_fn_a/index.d.ts +7 -0
- package/all/call_fn_a/index.js +14 -0
- package/all/call_or_fn/index.d.ts +13 -0
- package/all/call_or_fn/index.js +20 -0
- package/all/case_insensitive_eql/index.d.ts +1 -0
- package/all/case_insensitive_eql/index.js +14 -0
- package/all/chain/index.d.ts +22 -0
- package/all/chain/index.js +48 -0
- package/all/chunk_aa/index.d.ts +35 -0
- package/all/chunk_aa/index.js +20 -0
- package/all/chunk_aa/index.test.ts +11 -0
- package/all/circular_idx/index.d.ts +10 -0
- package/all/circular_idx/index.js +13 -0
- package/all/clear_ctx/index.d.ts +10 -0
- package/all/clear_ctx/index.js +19 -0
- package/all/clone/index.d.ts +6 -0
- package/all/clone/index.js +9 -0
- package/all/clone_assign_fn_key_a/index.d.ts +14 -0
- package/all/clone_assign_fn_key_a/index.js +18 -0
- package/all/color_hex_rgb__comma_delim_str/index.d.ts +11 -0
- package/all/color_hex_rgb__comma_delim_str/index.js +16 -0
- package/all/color_hsv/index.d.ts +18 -0
- package/all/color_hsv/index.js +36 -0
- package/all/color_hsv_phi_rgb_a/index.d.ts +19 -0
- package/all/color_hsv_phi_rgb_a/index.js +32 -0
- package/all/color_invert_rgb_a/index.d.ts +12 -0
- package/all/color_invert_rgb_a/index.js +18 -0
- package/all/color_rgb/index.d.ts +7 -0
- package/all/color_rgb/index.js +22 -0
- package/all/color_rgb/index.test.ts +12 -0
- package/all/columns_nansum_matrix/index.d.ts +4 -0
- package/all/columns_nansum_matrix/index.js +17 -0
- package/all/combinators/index.d.ts +52 -0
- package/all/combinators/index.js +48 -0
- package/all/combinators/index.test.ts +8 -0
- package/all/comma_number_str/index.d.ts +2 -0
- package/all/comma_number_str/index.js +8 -0
- package/all/compact/index.d.ts +15 -0
- package/all/compact/index.js +27 -0
- package/all/compact_a_ctx/index.d.ts +11 -0
- package/all/compact_a_ctx/index.js +21 -0
- package/all/compare/index.d.ts +23 -0
- package/all/compare/index.js +32 -0
- package/all/compose/index.d.ts +9 -0
- package/all/compose/index.js +17 -0
- package/all/concat/index.d.ts +9 -0
- package/all/concat/index.js +17 -0
- package/all/concat_truthy_a/index.d.ts +15 -0
- package/all/concat_truthy_a/index.js +19 -0
- package/all/console__error/index.d.ts +7 -0
- package/all/console__error/index.js +18 -0
- package/all/crypto/index.d.ts +1 -0
- package/all/crypto/index.js +11 -0
- package/all/crypto__sign/index.d.ts +13 -0
- package/all/crypto__sign/index.js +18 -0
- package/all/ctx/index.d.ts +4 -0
- package/all/ctx/index.js +25 -0
- package/all/ctx/index.test.ts +16 -0
- package/all/currencies/index.d.ts +3 -0
- package/all/currencies/index.js +120 -0
- package/all/currency_code/index.d.ts +4 -0
- package/all/currency_code/index.js +1 -0
- package/all/currency_str/index.d.ts +23 -0
- package/all/currency_str/index.js +38 -0
- package/all/currency_symbol/index.d.ts +8 -0
- package/all/currency_symbol/index.js +19 -0
- package/all/curry/index.d.ts +14 -0
- package/all/curry/index.js +32 -0
- package/all/date/index.d.ts +15 -0
- package/all/date/index.js +5 -0
- package/all/date_append_local_tz/index.d.ts +2 -0
- package/all/date_append_local_tz/index.js +9 -0
- package/all/day/index.d.ts +7 -0
- package/all/day/index.js +8 -0
- package/all/day_seconds/index.d.ts +2 -0
- package/all/day_seconds/index.js +2 -0
- package/all/debounce/index.d.ts +22 -0
- package/all/debounce/index.js +44 -0
- package/all/debounce_mapreduce/index.d.ts +6 -0
- package/all/debounce_mapreduce/index.js +18 -0
- package/all/debounce_mapreduce/index.test.ts +26 -0
- package/all/deep_clone/index.d.ts +5 -0
- package/all/deep_clone/index.js +10 -0
- package/all/defaults/index.d.ts +6 -0
- package/all/defaults/index.js +14 -0
- package/all/deg_rad/index.d.ts +5 -0
- package/all/deg_rad/index.js +7 -0
- package/all/diff_date/index.d.ts +1 -0
- package/all/diff_date/index.js +9 -0
- package/all/difference_a/index.d.ts +12 -0
- package/all/difference_a/index.js +15 -0
- package/all/difference_by/index.d.ts +9 -0
- package/all/difference_by/index.js +30 -0
- package/all/difference_set/index.d.ts +13 -0
- package/all/difference_set/index.js +23 -0
- package/all/digest__algorithm/index.d.ts +1 -0
- package/all/digest__algorithm/index.js +1 -0
- package/all/distribution_random_float/index.d.ts +4 -0
- package/all/distribution_random_float/index.js +12 -0
- package/all/distribution_random_int/index.d.ts +4 -0
- package/all/distribution_random_int/index.js +12 -0
- package/all/div/index.d.ts +4 -0
- package/all/div/index.js +10 -0
- package/all/each/index.d.ts +14 -0
- package/all/each/index.js +23 -0
- package/all/ensure/index.d.ts +11 -0
- package/all/ensure/index.js +26 -0
- package/all/ensure__refresh/index.d.ts +20 -0
- package/all/ensure__refresh/index.js +23 -0
- package/all/entries_gen/index.d.ts +5 -0
- package/all/entries_gen/index.js +12 -0
- package/all/entries_gen/index.test.ts +20 -0
- package/all/eq/index.d.ts +21 -0
- package/all/eq/index.js +28 -0
- package/all/eql/index.d.ts +23 -0
- package/all/eql/index.js +37 -0
- package/all/eql_a/index.d.ts +11 -0
- package/all/eql_a/index.js +20 -0
- package/all/eql_fn_a/index.d.ts +16 -0
- package/all/eql_fn_a/index.js +22 -0
- package/all/equidistant_segment_point_a/index.d.ts +14 -0
- package/all/equidistant_segment_point_a/index.js +25 -0
- package/all/error__print/index.d.ts +5 -0
- package/all/error__print/index.js +18 -0
- package/all/error_o/index.d.ts +27 -0
- package/all/error_o/index.js +25 -0
- package/all/every/index.d.ts +33 -0
- package/all/every/index.js +43 -0
- package/all/every_arg/index.d.ts +15 -0
- package/all/every_arg/index.js +15 -0
- package/all/every_arg/index.test.ts +37 -0
- package/all/exclude/index.d.ts +7 -0
- package/all/exclude/index.js +17 -0
- package/all/extract/index.d.ts +14 -0
- package/all/extract/index.js +24 -0
- package/all/extract/index.test.ts +18 -0
- package/all/falsy/index.d.ts +7 -0
- package/all/falsy/index.js +1 -0
- package/all/falsy__none/index.d.ts +9 -0
- package/all/falsy__none/index.js +23 -0
- package/all/falsy__none/index.test.ts +58 -0
- package/all/falsy_async_guard/index.d.ts +7 -0
- package/all/falsy_async_guard/index.js +13 -0
- package/all/falsy_guard/index.d.ts +5 -0
- package/all/falsy_guard/index.js +13 -0
- package/all/fetch/index.d.ts +5 -0
- package/all/fetch/index.js +2 -0
- package/all/fetch__template_pair/index.d.ts +40 -0
- package/all/fetch__template_pair/index.js +20 -0
- package/all/fetch__template_pair/index.test.ts +46 -0
- package/all/fetch_method/index.d.ts +5 -0
- package/all/fetch_method/index.js +8 -0
- package/all/fetch_response__throw/index.d.ts +7 -0
- package/all/fetch_response__throw/index.js +15 -0
- package/all/fetch_response__throw/index.test.ts +19 -0
- package/all/fetch_response_pair/index.d.ts +5 -0
- package/all/fetch_response_pair/index.js +13 -0
- package/all/fibonacci_number/index.d.ts +5 -0
- package/all/fibonacci_number/index.js +11 -0
- package/all/filter/index.d.ts +35 -0
- package/all/filter/index.js +55 -0
- package/all/filter_o/index.d.ts +31 -0
- package/all/filter_o/index.js +39 -0
- package/all/find/index.d.ts +30 -0
- package/all/find/index.js +51 -0
- package/all/first/index.d.ts +17 -0
- package/all/first/index.js +23 -0
- package/all/flatten/index.d.ts +14 -0
- package/all/flatten/index.js +28 -0
- package/all/flip/index.d.ts +5 -0
- package/all/flip/index.js +10 -0
- package/all/float_isNaN/index.d.ts +2 -0
- package/all/float_isNaN/index.js +9 -0
- package/all/fn_mean/index.d.ts +13 -0
- package/all/fn_mean/index.js +21 -0
- package/all/fn_mean/index.test.ts +13 -0
- package/all/fn_pipe/index.d.ts +70 -0
- package/all/fn_pipe/index.js +11 -0
- package/all/fn_pipe/index.test.ts +18 -0
- package/all/fn_sum/index.d.ts +12 -0
- package/all/fn_sum/index.js +17 -0
- package/all/fn_sum/index.test.ts +13 -0
- package/all/format_date_prose/index.d.ts +1 -0
- package/all/format_date_prose/index.js +10 -0
- package/all/format_utc_date_prose/index.d.ts +1 -0
- package/all/format_utc_date_prose/index.js +10 -0
- package/all/globalThis__prop__ensure/index.d.ts +4 -0
- package/all/globalThis__prop__ensure/index.js +10 -0
- package/all/globalThis__prop__ensure/index.test.ts +22 -0
- package/all/gte_0_a/index.d.ts +11 -0
- package/all/gte_0_a/index.js +21 -0
- package/all/hasOwnProperty_pick/index.d.ts +9 -0
- package/all/hasOwnProperty_pick/index.js +17 -0
- package/all/has_key/index.d.ts +15 -0
- package/all/has_key/index.js +38 -0
- package/all/has_multiple/index.d.ts +9 -0
- package/all/has_multiple/index.js +14 -0
- package/all/has_some_key/index.d.ts +5 -0
- package/all/has_some_key/index.js +12 -0
- package/all/head_arg_a/index.d.ts +12 -0
- package/all/head_arg_a/index.js +15 -0
- package/all/headers/index.d.ts +2 -0
- package/all/headers/index.js +10 -0
- package/all/hex__digest/index.d.ts +5 -0
- package/all/hex__digest/index.js +24 -0
- package/all/hex_int/index.d.ts +5 -0
- package/all/hex_int/index.js +7 -0
- package/all/hmac/index.d.ts +6 -0
- package/all/hmac/index.js +32 -0
- package/all/hmac_key/index.d.ts +5 -0
- package/all/hmac_key/index.js +30 -0
- package/all/hostname/index.d.ts +2 -0
- package/all/hostname/index.js +9 -0
- package/all/hour/index.d.ts +7 -0
- package/all/hour/index.js +8 -0
- package/all/hour_seconds/index.d.ts +2 -0
- package/all/hour_seconds/index.js +2 -0
- package/all/http_error/index.d.ts +20 -0
- package/all/http_error/index.js +35 -0
- package/all/idx/index.d.ts +11 -0
- package/all/idx/index.js +17 -0
- package/all/idx_a/index.d.ts +9 -0
- package/all/idx_a/index.js +20 -0
- package/all/idx_a/index.test.ts +9 -0
- package/all/idx_filter/index.d.ts +32 -0
- package/all/idx_filter/index.js +57 -0
- package/all/idx_key_r/index.d.ts +49 -0
- package/all/idx_key_r/index.js +78 -0
- package/all/idx_reject/index.d.ts +30 -0
- package/all/idx_reject/index.js +45 -0
- package/all/idx_sort_a/index.d.ts +23 -0
- package/all/idx_sort_a/index.js +39 -0
- package/all/idx_sort_a__sort_idx_o/index.d.ts +16 -0
- package/all/idx_sort_a__sort_idx_o/index.js +21 -0
- package/all/idx_sort_r_a/index.d.ts +7 -0
- package/all/idx_sort_r_a/index.js +14 -0
- package/all/if_null_set_false/index.d.ts +7 -0
- package/all/if_null_set_false/index.js +14 -0
- package/all/ifelse/index.d.ts +6 -0
- package/all/ifelse/index.js +10 -0
- package/all/iife/index.d.ts +6 -0
- package/all/iife/index.js +9 -0
- package/all/indendation/index.d.ts +9 -0
- package/all/indendation/index.js +23 -0
- package/all/index.d.ts +408 -0
- package/all/index.js +408 -0
- package/all/indexOf/index.d.ts +6 -0
- package/all/indexOf/index.js +9 -0
- package/all/insert/index.d.ts +6 -0
- package/all/insert/index.js +10 -0
- package/all/int_hex/index.d.ts +5 -0
- package/all/int_hex/index.js +7 -0
- package/all/intersection_a/index.d.ts +15 -0
- package/all/intersection_a/index.js +15 -0
- package/all/intersection_by/index.d.ts +10 -0
- package/all/intersection_by/index.js +44 -0
- package/all/intersection_set/index.d.ts +14 -0
- package/all/intersection_set/index.js +25 -0
- package/all/invalid_argument/index.d.ts +30 -0
- package/all/invalid_argument/index.js +43 -0
- package/all/invalid_state/index.d.ts +32 -0
- package/all/invalid_state/index.js +44 -0
- package/all/invert/index.d.ts +4 -0
- package/all/invert/index.js +8 -0
- package/all/invert_idx_a/index.d.ts +12 -0
- package/all/invert_idx_a/index.js +20 -0
- package/all/invert_idx_a/index.test.ts +7 -0
- package/all/isArray/index.d.ts +5 -0
- package/all/isArray/index.js +9 -0
- package/all/isFloat/index.d.ts +1 -0
- package/all/isFloat/index.js +4 -0
- package/all/isFloat_andor/index.d.ts +3 -0
- package/all/isFloat_andor/index.js +9 -0
- package/all/isFloat_or/index.d.ts +1 -0
- package/all/isFloat_or/index.js +5 -0
- package/all/isLowerCase/index.d.ts +1 -0
- package/all/isLowerCase/index.js +7 -0
- package/all/isNumber/index.d.ts +5 -0
- package/all/isNumber/index.js +5 -0
- package/all/isNumber_andor/index.d.ts +3 -0
- package/all/isNumber_andor/index.js +8 -0
- package/all/isNumber_or/index.d.ts +1 -0
- package/all/isNumber_or/index.js +5 -0
- package/all/isObject/index.d.ts +8 -0
- package/all/isObject/index.js +12 -0
- package/all/isPromise/index.d.ts +1 -0
- package/all/isPromise/index.js +7 -0
- package/all/isString/index.d.ts +1 -0
- package/all/isString/index.js +7 -0
- package/all/isUpperCase/index.d.ts +1 -0
- package/all/isUpperCase/index.js +7 -0
- package/all/item_r_idx/index.d.ts +27 -0
- package/all/item_r_idx/index.js +38 -0
- package/all/json/index.d.ts +2 -0
- package/all/json/index.js +1 -0
- package/all/key_compare/index.d.ts +14 -0
- package/all/key_compare/index.js +19 -0
- package/all/key_r/index.d.ts +48 -0
- package/all/key_r/index.js +63 -0
- package/all/key_r_a/index.d.ts +15 -0
- package/all/key_r_a/index.js +26 -0
- package/all/keyof/index.d.ts +1 -0
- package/all/keyof/index.js +1 -0
- package/all/keys/index.d.ts +4 -0
- package/all/keys/index.js +5 -0
- package/all/lPad/index.d.ts +1 -0
- package/all/lPad/index.js +11 -0
- package/all/last/index.d.ts +18 -0
- package/all/last/index.js +22 -0
- package/all/left_and/index.d.ts +12 -0
- package/all/left_and/index.js +14 -0
- package/all/left_or/index.d.ts +11 -0
- package/all/left_or/index.js +14 -0
- package/all/line__parse/index.d.ts +18 -0
- package/all/line__parse/index.js +97 -0
- package/all/line__parse/index.test.ts +96 -0
- package/all/line__transform_stream/index.d.ts +8 -0
- package/all/line__transform_stream/index.js +53 -0
- package/all/line__transform_stream/index.test.ts +47 -0
- package/all/lte_0_a/index.d.ts +11 -0
- package/all/lte_0_a/index.js +20 -0
- package/all/m_m_yyyy/index.d.ts +8 -0
- package/all/m_m_yyyy/index.js +24 -0
- package/all/m_yy/index.d.ts +2 -0
- package/all/m_yy/index.js +9 -0
- package/all/m_yyyy/index.d.ts +2 -0
- package/all/m_yyyy/index.js +10 -0
- package/all/many_andand/index.d.ts +11 -0
- package/all/many_andand/index.js +12 -0
- package/all/many_andand_or/index.d.ts +17 -0
- package/all/many_andand_or/index.js +14 -0
- package/all/map/index.d.ts +42 -0
- package/all/map/index.js +45 -0
- package/all/map_andand/index.d.ts +30 -0
- package/all/map_andand/index.js +34 -0
- package/all/map_andand_or/index.d.ts +13 -0
- package/all/map_andand_or/index.js +13 -0
- package/all/map_andandfn/index.d.ts +28 -0
- package/all/map_andandfn/index.js +29 -0
- package/all/map_apply/index.d.ts +17 -0
- package/all/map_apply/index.js +15 -0
- package/all/map_call/index.d.ts +22 -0
- package/all/map_call/index.js +26 -0
- package/all/map_find/index.d.ts +32 -0
- package/all/map_find/index.js +38 -0
- package/all/map_fn/index.d.ts +4 -0
- package/all/map_fn/index.js +1 -0
- package/all/map_inverse/index.d.ts +5 -0
- package/all/map_inverse/index.js +9 -0
- package/all/map_obj/index.d.ts +30 -0
- package/all/map_obj/index.js +28 -0
- package/all/map_obj_andand/index.d.ts +28 -0
- package/all/map_obj_andand/index.js +28 -0
- package/all/matrix__dot/index.d.ts +6 -0
- package/all/matrix__dot/index.js +22 -0
- package/all/matrix__dot__scalar/index.d.ts +1 -0
- package/all/matrix__dot__scalar/index.js +9 -0
- package/all/matrix__normalize/index.d.ts +4 -0
- package/all/matrix__normalize/index.js +20 -0
- package/all/matrix__validate_length/index.d.ts +1 -0
- package/all/matrix__validate_length/index.js +13 -0
- package/all/maybe/index.d.ts +7 -0
- package/all/maybe/index.js +1 -0
- package/all/mean/index.d.ts +9 -0
- package/all/mean/index.js +17 -0
- package/all/mean/index.test.ts +10 -0
- package/all/median/index.d.ts +4 -0
- package/all/median/index.js +19 -0
- package/all/merge/index.d.ts +7 -0
- package/all/merge/index.js +25 -0
- package/all/minute/index.d.ts +7 -0
- package/all/minute/index.js +7 -0
- package/all/minute_seconds/index.d.ts +2 -0
- package/all/minute_seconds/index.js +2 -0
- package/all/missing_argument/index.d.ts +31 -0
- package/all/missing_argument/index.js +44 -0
- package/all/mixin/index.d.ts +13 -0
- package/all/mixin/index.js +34 -0
- package/all/money_str/index.d.ts +13 -0
- package/all/money_str/index.js +26 -0
- package/all/month_a/index.d.ts +5 -0
- package/all/month_a/index.js +18 -0
- package/all/month_ms/index.d.ts +5 -0
- package/all/month_ms/index.js +6 -0
- package/all/month_seconds/index.d.ts +2 -0
- package/all/month_seconds/index.js +2 -0
- package/all/ms/index.d.ts +5 -0
- package/all/ms/index.js +12 -0
- package/all/mul/index.d.ts +4 -0
- package/all/mul/index.js +12 -0
- package/all/name_sort/index.d.ts +14 -0
- package/all/name_sort/index.js +13 -0
- package/all/negative/index.d.ts +4 -0
- package/all/negative/index.js +8 -0
- package/all/neq/index.d.ts +14 -0
- package/all/neq/index.js +25 -0
- package/all/neql/index.d.ts +15 -0
- package/all/neql/index.js +24 -0
- package/all/next_idx/index.d.ts +8 -0
- package/all/next_idx/index.js +14 -0
- package/all/nf/index.d.ts +1 -0
- package/all/nf/index.js +1 -0
- package/all/no_comma_str/index.d.ts +2 -0
- package/all/no_comma_str/index.js +9 -0
- package/all/noinit/index.d.ts +9 -0
- package/all/noinit/index.js +16 -0
- package/all/noop/index.d.ts +4 -0
- package/all/noop/index.js +6 -0
- package/all/normal_random/index.d.ts +2 -0
- package/all/normal_random/index.js +19 -0
- package/all/normal_random_float/index.d.ts +2 -0
- package/all/normal_random_float/index.js +6 -0
- package/all/normal_random_int/index.d.ts +2 -0
- package/all/normal_random_int/index.js +6 -0
- package/all/not/index.d.ts +17 -0
- package/all/not/index.js +24 -0
- package/all/not_found/index.d.ts +20 -0
- package/all/not_found/index.js +44 -0
- package/all/not_nullish__query_str/index.d.ts +6 -0
- package/all/not_nullish__query_str/index.js +19 -0
- package/all/notnot/index.d.ts +12 -0
- package/all/notnot/index.js +23 -0
- package/all/null/index.d.ts +5 -0
- package/all/null/index.js +10 -0
- package/all/nullish/index.d.ts +2 -0
- package/all/nullish/index.js +1 -0
- package/all/nullish__guard/index.d.ts +10 -0
- package/all/nullish__guard/index.js +16 -0
- package/all/nullish__guard__async/index.d.ts +10 -0
- package/all/nullish__guard__async/index.js +18 -0
- package/all/nullish__none/index.d.ts +12 -0
- package/all/nullish__none/index.js +25 -0
- package/all/nullish__none/index.test.ts +58 -0
- package/all/nullish__not_all/index.d.ts +8 -0
- package/all/nullish__not_all/index.js +16 -0
- package/all/nullish__not_all/index.test.ts +70 -0
- package/all/nullish_or/index.d.ts +5 -0
- package/all/nullish_or/index.js +11 -0
- package/all/number__count/index.d.ts +4 -0
- package/all/number__count/index.js +13 -0
- package/all/number__count/index.test.ts +7 -0
- package/all/number_or_mdash_str/index.d.ts +2 -0
- package/all/number_or_mdash_str/index.js +5 -0
- package/all/numerator_or_0_avg/index.d.ts +5 -0
- package/all/numerator_or_0_avg/index.js +10 -0
- package/all/numerator_or_0_sum/index.d.ts +5 -0
- package/all/numerator_or_0_sum/index.js +10 -0
- package/all/numeric_range/index.d.ts +7 -0
- package/all/numeric_range/index.js +19 -0
- package/all/numeric_range/index.test.ts +9 -0
- package/all/o_a_present/index.d.ts +18 -0
- package/all/o_a_present/index.js +18 -0
- package/all/o_some/index.d.ts +13 -0
- package/all/o_some/index.js +16 -0
- package/all/obj_key_r/index.d.ts +10 -0
- package/all/obj_key_r/index.js +19 -0
- package/all/offset_destructure_aa/index.d.ts +13 -0
- package/all/offset_destructure_aa/index.js +22 -0
- package/all/offset_i/index.d.ts +8 -0
- package/all/offset_i/index.js +13 -0
- package/all/offset_i_slice/index.d.ts +19 -0
- package/all/offset_i_slice/index.js +26 -0
- package/all/omit/index.d.ts +15 -0
- package/all/omit/index.js +26 -0
- package/all/omit/index.test.ts +12 -0
- package/all/one_andand/index.d.ts +13 -0
- package/all/one_andand/index.js +15 -0
- package/all/one_andand_or/index.d.ts +19 -0
- package/all/one_andand_or/index.js +18 -0
- package/all/or/index.d.ts +41 -0
- package/all/or/index.js +47 -0
- package/all/or_in/index.d.ts +9 -0
- package/all/or_in/index.js +14 -0
- package/all/or_null/index.d.ts +11 -0
- package/all/or_null/index.js +10 -0
- package/all/or_property/index.d.ts +9 -0
- package/all/or_property/index.js +15 -0
- package/all/pad2/index.d.ts +1 -0
- package/all/pad2/index.js +7 -0
- package/all/parseFloat_andor/index.d.ts +3 -0
- package/all/parseFloat_andor/index.js +5 -0
- package/all/parseFloat_andor/index.test.ts +11 -0
- package/all/parseFloat_or/index.d.ts +1 -0
- package/all/parseFloat_or/index.js +5 -0
- package/all/parseFloat_or/index.test.ts +9 -0
- package/all/parseInt_andor/index.d.ts +5 -0
- package/all/parseInt_andor/index.js +5 -0
- package/all/parseInt_andor/index.test.ts +11 -0
- package/all/parseInt_or/index.d.ts +1 -0
- package/all/parseInt_or/index.js +5 -0
- package/all/parseInt_or/index.test.ts +10 -0
- package/all/pathname/index.d.ts +2 -0
- package/all/pathname/index.js +8 -0
- package/all/percentage_str/index.d.ts +2 -0
- package/all/percentage_str/index.js +9 -0
- package/all/percentage_str_float/index.d.ts +2 -0
- package/all/percentage_str_float/index.js +4 -0
- package/all/performance__now/index.d.ts +1 -0
- package/all/performance__now/index.js +32 -0
- package/all/pick/index.d.ts +18 -0
- package/all/pick/index.js +35 -0
- package/all/pick_keys/index.d.ts +8 -0
- package/all/pick_keys/index.js +12 -0
- package/all/pick_val_a/index.d.ts +14 -0
- package/all/pick_val_a/index.js +22 -0
- package/all/prev_idx/index.d.ts +8 -0
- package/all/prev_idx/index.js +14 -0
- package/all/promise/index.d.ts +2 -0
- package/all/promise/index.js +1 -0
- package/all/promise_o/index.d.ts +7 -0
- package/all/promise_o/index.js +11 -0
- package/all/promise_timeout/index.d.ts +5 -0
- package/all/promise_timeout/index.js +23 -0
- package/all/prototype_mixin/index.d.ts +8 -0
- package/all/prototype_mixin/index.js +20 -0
- package/all/push/index.d.ts +15 -0
- package/all/push/index.js +17 -0
- package/all/quantile/index.d.ts +5 -0
- package/all/quantile/index.js +16 -0
- package/all/query_str/index.d.ts +27 -0
- package/all/query_str/index.js +46 -0
- package/all/query_str/index.test.ts +43 -0
- package/all/query_str__searchParams/index.d.ts +1 -0
- package/all/query_str__searchParams/index.js +8 -0
- package/all/query_str__searchParams_o/index.d.ts +3 -0
- package/all/query_str__searchParams_o/index.js +11 -0
- package/all/queue/index.d.ts +23 -0
- package/all/queue/index.js +130 -0
- package/all/queue/index.test.ts +207 -0
- package/all/rPad/index.d.ts +1 -0
- package/all/rPad/index.js +11 -0
- package/all/r_val_a/index.d.ts +23 -0
- package/all/r_val_a/index.js +28 -0
- package/all/rad_deg/index.d.ts +5 -0
- package/all/rad_deg/index.js +7 -0
- package/all/random_idx/index.d.ts +8 -0
- package/all/random_idx/index.js +12 -0
- package/all/rank/index.d.ts +10 -0
- package/all/rank/index.js +16 -0
- package/all/rate_limit/index.d.ts +10 -0
- package/all/rate_limit/index.js +49 -0
- package/all/rc_be/index.d.ts +9 -0
- package/all/rc_be/index.js +17 -0
- package/all/rc_be_/index.d.ts +42 -0
- package/all/rc_be_/index.js +62 -0
- package/all/re_/index.d.ts +1 -0
- package/all/re_/index.js +8 -0
- package/all/readable_stream_OR_reader/index.d.ts +7 -0
- package/all/readable_stream_OR_reader/index.js +1 -0
- package/all/reduce/index.d.ts +51 -0
- package/all/reduce/index.js +51 -0
- package/all/regex_indexOf/index.d.ts +10 -0
- package/all/regex_indexOf/index.js +14 -0
- package/all/regex_lastIndexOf/index.d.ts +7 -0
- package/all/regex_lastIndexOf/index.js +25 -0
- package/all/reject/index.d.ts +39 -0
- package/all/reject/index.js +40 -0
- package/all/remove/index.d.ts +16 -0
- package/all/remove/index.js +27 -0
- package/all/remove_idx/index.d.ts +12 -0
- package/all/remove_idx/index.js +14 -0
- package/all/resolver_curry/index.d.ts +6 -0
- package/all/resolver_curry/index.js +1 -0
- package/all/response_o/index.d.ts +10 -0
- package/all/response_o/index.js +17 -0
- package/all/response_pair/index.d.ts +11 -0
- package/all/response_pair/index.js +23 -0
- package/all/response_pair/index.test.ts +30 -0
- package/all/reverse/index.d.ts +16 -0
- package/all/reverse/index.js +16 -0
- package/all/right_and/index.d.ts +14 -0
- package/all/right_and/index.js +15 -0
- package/all/right_or/index.d.ts +14 -0
- package/all/right_or/index.js +16 -0
- package/all/round/index.d.ts +4 -0
- package/all/round/index.js +14 -0
- package/all/run/index.d.ts +8 -0
- package/all/run/index.js +10 -0
- package/all/run_pipe/index.d.ts +61 -0
- package/all/run_pipe/index.js +11 -0
- package/all/run_pipe/index.test.ts +19 -0
- package/all/scalar__matrix__multiply/index.d.ts +7 -0
- package/all/scalar__matrix__multiply/index.js +16 -0
- package/all/searchParams_o/index.d.ts +3 -0
- package/all/searchParams_o/index.js +13 -0
- package/all/seconds/index.d.ts +2 -0
- package/all/seconds/index.js +10 -0
- package/all/segment_point_index/index.d.ts +5 -0
- package/all/segment_point_index/index.js +13 -0
- package/all/selector_splice/index.d.ts +13 -0
- package/all/selector_splice/index.js +17 -0
- package/all/sequence/index.d.ts +2 -0
- package/all/sequence/index.js +8 -0
- package/all/set_member/index.d.ts +6 -0
- package/all/set_member/index.js +1 -0
- package/all/since_time_text/index.d.ts +5 -0
- package/all/since_time_text/index.js +38 -0
- package/all/sleep/index.d.ts +1 -0
- package/all/sleep/index.js +7 -0
- package/all/slice/index.d.ts +38 -0
- package/all/slice/index.js +48 -0
- package/all/slice_arg_a/index.d.ts +28 -0
- package/all/slice_arg_a/index.js +17 -0
- package/all/slice_arg_spread_a/index.d.ts +29 -0
- package/all/slice_arg_spread_a/index.js +15 -0
- package/all/sort/index.d.ts +37 -0
- package/all/sort/index.js +41 -0
- package/all/sort_a/index.d.ts +24 -0
- package/all/sort_a/index.js +28 -0
- package/all/sort_idx_a/index.d.ts +21 -0
- package/all/sort_idx_a/index.js +25 -0
- package/all/sort_idx_o/index.d.ts +29 -0
- package/all/sort_idx_o/index.js +53 -0
- package/all/sort_idx_o/index.test.ts +12 -0
- package/all/sort_val_a/index.d.ts +21 -0
- package/all/sort_val_a/index.js +23 -0
- package/all/sort_val_a__transition_idx_a/index.d.ts +61 -0
- package/all/sort_val_a__transition_idx_a/index.js +108 -0
- package/all/sort_val_a__transition_idx_a/index.test.ts +99 -0
- package/all/sparse_a/index.d.ts +14 -0
- package/all/sparse_a/index.js +19 -0
- package/all/splice/index.d.ts +19 -0
- package/all/splice/index.js +23 -0
- package/all/splice_str/index.d.ts +8 -0
- package/all/splice_str/index.js +20 -0
- package/all/spread/index.d.ts +22 -0
- package/all/spread/index.js +24 -0
- package/all/spread_slice/index.d.ts +10 -0
- package/all/spread_slice/index.js +14 -0
- package/all/stacktrace/index.d.ts +5 -0
- package/all/stacktrace/index.js +42 -0
- package/all/std/index.d.ts +2 -0
- package/all/std/index.js +13 -0
- package/all/sub/index.d.ts +4 -0
- package/all/sub/index.js +10 -0
- package/all/table_txt/index.d.ts +2 -0
- package/all/table_txt/index.js +29 -0
- package/all/table_txt/index.test.ts +17 -0
- package/all/tap/index.d.ts +22 -0
- package/all/tap/index.js +26 -0
- package/all/tf/index.d.ts +2 -0
- package/all/tf/index.js +2 -0
- package/all/throttle/index.d.ts +9 -0
- package/all/throttle/index.js +26 -0
- package/all/tick/index.d.ts +8 -0
- package/all/tick/index.js +23 -0
- package/all/timedout/index.d.ts +2 -0
- package/all/timedout/index.js +9 -0
- package/all/timeout_promise/index.d.ts +10 -0
- package/all/timeout_promise/index.js +12 -0
- package/all/times/index.d.ts +8 -0
- package/all/times/index.js +13 -0
- package/all/timestamp_ms/index.d.ts +6 -0
- package/all/timestamp_ms/index.js +8 -0
- package/all/title_case_/index.d.ts +7 -0
- package/all/title_case_/index.js +24 -0
- package/all/toLocalDateString/index.d.ts +1 -0
- package/all/toLocalDateString/index.js +7 -0
- package/all/toString/index.d.ts +5 -0
- package/all/toString/index.js +5 -0
- package/all/tup/index.d.ts +13 -0
- package/all/tup/index.js +14 -0
- package/all/tuple__o/index.d.ts +7 -0
- package/all/tuple__o/index.js +1 -0
- package/all/tuple__union/index.d.ts +1 -0
- package/all/tuple__union/index.js +1 -0
- package/all/tuple_a_o/index.d.ts +10 -0
- package/all/tuple_a_o/index.js +1 -0
- package/all/unauthorized/index.d.ts +20 -0
- package/all/unauthorized/index.js +43 -0
- package/all/unformat_currency_str/index.d.ts +10 -0
- package/all/unformat_currency_str/index.js +27 -0
- package/all/uniform_random/index.d.ts +2 -0
- package/all/uniform_random/index.js +4 -0
- package/all/uniform_random_float/index.d.ts +2 -0
- package/all/uniform_random_float/index.js +6 -0
- package/all/uniform_random_int/index.d.ts +2 -0
- package/all/uniform_random_int/index.js +6 -0
- package/all/union_a/index.d.ts +14 -0
- package/all/union_a/index.js +18 -0
- package/all/union_by/index.d.ts +11 -0
- package/all/union_by/index.js +28 -0
- package/all/union_set/index.d.ts +14 -0
- package/all/union_set/index.js +18 -0
- package/all/unit_matrix/index.d.ts +1 -0
- package/all/unit_matrix/index.js +11 -0
- package/all/unpick/index.d.ts +11 -0
- package/all/unpick/index.js +28 -0
- package/all/unpick_keys/index.d.ts +8 -0
- package/all/unpick_keys/index.js +12 -0
- package/all/url__join/index.d.ts +5 -0
- package/all/url__join/index.js +24 -0
- package/all/url_basename/index.d.ts +2 -0
- package/all/url_basename/index.js +10 -0
- package/all/url_segment/index.d.ts +2 -0
- package/all/url_segment/index.js +1 -0
- package/all/urn_url/index.d.ts +11 -0
- package/all/urn_url/index.js +15 -0
- package/all/utc_MM_yyyy/index.d.ts +8 -0
- package/all/utc_MM_yyyy/index.js +24 -0
- package/all/utc_M_yyyy/index.d.ts +6 -0
- package/all/utc_M_yyyy/index.js +13 -0
- package/all/utc_m_yy/index.d.ts +5 -0
- package/all/utc_m_yy/index.js +12 -0
- package/all/utc_yyyymmdd/index.d.ts +5 -0
- package/all/utc_yyyymmdd/index.js +13 -0
- package/all/utc_yyyymmddhhmmss/index.d.ts +5 -0
- package/all/utc_yyyymmddhhmmss/index.js +18 -0
- package/all/uuid/index.d.ts +5 -0
- package/all/uuid/index.js +19 -0
- package/all/val/index.d.ts +4 -0
- package/all/val/index.js +8 -0
- package/all/value_key_aa/index.d.ts +10 -0
- package/all/value_key_aa/index.js +20 -0
- package/all/value_key_zip_r/index.d.ts +13 -0
- package/all/value_key_zip_r/index.js +20 -0
- package/all/value_r/index.d.ts +29 -0
- package/all/value_r/index.js +37 -0
- package/all/valueof/index.d.ts +1 -0
- package/all/valueof/index.js +1 -0
- package/all/values/index.d.ts +5 -0
- package/all/values/index.js +5 -0
- package/all/waitfor/index.d.ts +5 -0
- package/all/waitfor/index.js +16 -0
- package/all/waitfor_fibonacci_backoff/index.d.ts +8 -0
- package/all/waitfor_fibonacci_backoff/index.js +27 -0
- package/all/waitfor_val/index.d.ts +6 -0
- package/all/waitfor_val/index.js +20 -0
- package/all/weak_r/index.d.ts +28 -0
- package/all/weak_r/index.js +87 -0
- package/all/week/index.d.ts +1 -0
- package/all/week/index.js +2 -0
- package/all/wrap_a/index.d.ts +32 -0
- package/all/wrap_a/index.js +19 -0
- package/all/wrap_a_item/index.d.ts +5 -0
- package/all/wrap_a_item/index.js +1 -0
- package/all/wrap_aa/index.d.ts +23 -0
- package/all/wrap_aa/index.js +14 -0
- package/all/wrap_aa_item/index.d.ts +5 -0
- package/all/wrap_aa_item/index.js +1 -0
- package/all/wrap_concat/index.d.ts +11 -0
- package/all/wrap_concat/index.js +13 -0
- package/all/year_ms/index.d.ts +5 -0
- package/all/year_ms/index.js +6 -0
- package/all/year_seconds/index.d.ts +2 -0
- package/all/year_seconds/index.js +2 -0
- package/all/yyyymmdd/index.d.ts +2 -0
- package/all/yyyymmdd/index.js +10 -0
- package/all/yyyymmddhhmmss/index.d.ts +2 -0
- package/all/yyyymmddhhmmss/index.js +11 -0
- package/all/zip/index.d.ts +11 -0
- package/all/zip/index.js +17 -0
- package/all/zip__tuple_a/index.d.ts +13 -0
- package/all/zip__tuple_a/index.js +1 -0
- package/all/zip_o/index.d.ts +15 -0
- package/all/zip_o/index.js +22 -0
- package/all/zip_with/index.d.ts +43 -0
- package/all/zip_with/index.js +56 -0
- package/index.js +2 -0
- package/package.json +6 -1
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { crypto_ } from '../crypto/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* @param {import('../hex__digest/index.js').digest__algorithm_T}algorithm
|
|
4
|
+
* @param {string|BufferSource}message
|
|
5
|
+
* @returns {Promise<string>}
|
|
6
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest}
|
|
7
|
+
*/
|
|
8
|
+
export async function hex__digest(
|
|
9
|
+
algorithm,
|
|
10
|
+
message,
|
|
11
|
+
) {
|
|
12
|
+
if (typeof message === 'string') {
|
|
13
|
+
// encode as (utf-8) Uint8Array
|
|
14
|
+
message = new TextEncoder().encode(message)
|
|
15
|
+
}
|
|
16
|
+
const crypto = await crypto_()
|
|
17
|
+
const hash_buffer =
|
|
18
|
+
await crypto.subtle.digest(algorithm, message) // hash the message
|
|
19
|
+
const hash_array =
|
|
20
|
+
Array.from(new Uint8Array(hash_buffer)) // convert hash_buffer to byte array
|
|
21
|
+
return hash_array
|
|
22
|
+
.map((b)=>b.toString(16).padStart(2, '0'))
|
|
23
|
+
.join('') // convert bytes to hex string
|
|
24
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { buffer__hex_ } from '../buffer__hex/index.js'
|
|
2
|
+
import { crypto__sign } from '../crypto__sign/index.js'
|
|
3
|
+
import { hmac_key_ } from '../hmac_key/index.js'
|
|
4
|
+
/**
|
|
5
|
+
* @param {import('../hmac/index.js').digest__algorithm_T}algorithm
|
|
6
|
+
* @param {string|BufferSource|CryptoKey}key
|
|
7
|
+
* @param {string|BufferSource}data
|
|
8
|
+
* @returns {Promise<string>}
|
|
9
|
+
* @see https://lukasmurdock.com/web-hmac/
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
export async function hmac_(
|
|
13
|
+
algorithm,
|
|
14
|
+
key,
|
|
15
|
+
data
|
|
16
|
+
) {
|
|
17
|
+
if (!key.algorithm) {
|
|
18
|
+
key = await hmac_key_(algorithm, key)
|
|
19
|
+
}
|
|
20
|
+
if (typeof data === 'string') {
|
|
21
|
+
const encoder = new TextEncoder()
|
|
22
|
+
data = encoder.encode(data)
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/sign#hmac_2
|
|
26
|
+
*/
|
|
27
|
+
const signature = await crypto__sign(
|
|
28
|
+
'HMAC',
|
|
29
|
+
key,
|
|
30
|
+
data)
|
|
31
|
+
return buffer__hex_(signature)
|
|
32
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { crypto_ } from '../crypto/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* @param {import('../hmac_key/index.js').digest__algorithm_T}algorithm
|
|
4
|
+
* @param {string|BufferSource}key
|
|
5
|
+
* @returns {Promise<CryptoKey>}
|
|
6
|
+
* @see https://lukasmurdock.com/web-hmac/
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
export async function hmac_key_(
|
|
10
|
+
algorithm,
|
|
11
|
+
key
|
|
12
|
+
) {
|
|
13
|
+
if (typeof key === 'string') {
|
|
14
|
+
const encoder = new TextEncoder()
|
|
15
|
+
key = encoder.encode(key)
|
|
16
|
+
}
|
|
17
|
+
const crypto = await crypto_()
|
|
18
|
+
/**
|
|
19
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey
|
|
20
|
+
*/
|
|
21
|
+
return crypto.subtle.importKey(
|
|
22
|
+
'raw',
|
|
23
|
+
key,
|
|
24
|
+
{
|
|
25
|
+
name: 'HMAC',
|
|
26
|
+
hash: algorithm
|
|
27
|
+
},
|
|
28
|
+
true,
|
|
29
|
+
['sign', 'verify'])
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { argument__error_o_T, error_o_error_T } from '../error_o/index.js'
|
|
2
|
+
export declare function http_error_(
|
|
3
|
+
message?:string,
|
|
4
|
+
error_o?:argument__error_o_T
|
|
5
|
+
):HttpError
|
|
6
|
+
/**
|
|
7
|
+
* HttpError
|
|
8
|
+
* @example
|
|
9
|
+
* http_error__throw('Error fetching document') // Unauthorized
|
|
10
|
+
*/
|
|
11
|
+
export declare function http_error__throw(
|
|
12
|
+
message?:string,
|
|
13
|
+
error_o?:argument__error_o_T
|
|
14
|
+
):void
|
|
15
|
+
export declare class HttpError extends Error implements error_o_error_T {
|
|
16
|
+
data?:any
|
|
17
|
+
http__message?:string
|
|
18
|
+
http__status?:number
|
|
19
|
+
url?:string
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { assign } from '../assign/index.js'
|
|
2
|
+
/** @typedef {import('../error_o/index.d.ts').argument__error_o_T} */
|
|
3
|
+
/** @typedef {import('../http_error/index.d.ts').HttpError}HttpError */
|
|
4
|
+
/**
|
|
5
|
+
* @param {string}[message]
|
|
6
|
+
* @param {argument__error_o_T}[error_o]
|
|
7
|
+
* @returns {HttpError}
|
|
8
|
+
*/
|
|
9
|
+
export function http_error_(message, error_o) {
|
|
10
|
+
return assign(
|
|
11
|
+
new /** @type {any} */HttpError(message),
|
|
12
|
+
error_o)
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* HttpError
|
|
16
|
+
* @param {string}[message]
|
|
17
|
+
* @param {argument__error_o_T}error_o
|
|
18
|
+
* @example
|
|
19
|
+
* http_error__throw(ctx) // Unauthorized
|
|
20
|
+
*/
|
|
21
|
+
export function http_error__throw(message, error_o) {
|
|
22
|
+
throw http_error_(message, error_o)
|
|
23
|
+
}
|
|
24
|
+
/** @type {import('./index.d.ts')} */
|
|
25
|
+
export class HttpError extends Error {
|
|
26
|
+
/**
|
|
27
|
+
* @param {string}[message]
|
|
28
|
+
*/
|
|
29
|
+
constructor(message) {
|
|
30
|
+
super(message)
|
|
31
|
+
this.name = 'HttpError'
|
|
32
|
+
this.http__message = message
|
|
33
|
+
this.http__status = 500
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { is_match__T } from '../array_types/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* Returns idx of first match in `a` with `compare`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function idx_<
|
|
6
|
+
Val extends unknown = unknown
|
|
7
|
+
>(
|
|
8
|
+
in_a:readonly Val[]|undefined,
|
|
9
|
+
compare:is_match__T<Val>
|
|
10
|
+
):number
|
|
11
|
+
export { idx_ as _idx, }
|
package/all/idx/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns idx of first match in `a` with `compare`.
|
|
3
|
+
* @param {unknown[]|undefined}in_a
|
|
4
|
+
* @param {import('../array_types/index.js').is_match__T}compare
|
|
5
|
+
* @returns {number}
|
|
6
|
+
*/
|
|
7
|
+
export function idx_(in_a, compare) {
|
|
8
|
+
if (in_a) {
|
|
9
|
+
const a = in_a
|
|
10
|
+
for (let idx = 0; idx < a.length; idx++) {
|
|
11
|
+
const value = a[idx]
|
|
12
|
+
if (value === compare || typeof compare === 'function' && compare(value, idx)) return idx
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return -1
|
|
16
|
+
}
|
|
17
|
+
export { idx_ as _idx, }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns an Array of incrementing index (`idx`) values with `start=0`.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @param count{number}
|
|
6
|
+
* @param start{number}
|
|
7
|
+
* @returns {number[]}
|
|
8
|
+
*/
|
|
9
|
+
export function idx_a_(count, start = 0) {
|
|
10
|
+
const idx_a = []
|
|
11
|
+
for (let i = 0; i < count; i++) {
|
|
12
|
+
idx_a.push(start + i)
|
|
13
|
+
}
|
|
14
|
+
return idx_a
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
idx_a_ as idx_a1_fn,
|
|
18
|
+
idx_a_ as _idx_a1,
|
|
19
|
+
idx_a_ as _a1__idx,
|
|
20
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { a_item_T } from '../a_item/index.js'
|
|
2
|
+
import type { is_match__T } from '../array_types/index.js'
|
|
3
|
+
/**
|
|
4
|
+
* Returns Array of `idx` indices filtered by `fn`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function idx_filter<I extends readonly unknown[]>(
|
|
7
|
+
in_a:I,
|
|
8
|
+
is_match_?:is_match__T<a_item_T<I>>
|
|
9
|
+
):number[]
|
|
10
|
+
export declare function maybe_idx_filter<
|
|
11
|
+
I extends readonly number[], Or = null
|
|
12
|
+
>(
|
|
13
|
+
maybe_a:I|undefined,
|
|
14
|
+
is_match_?:is_match__T<a_item_T<I>>,
|
|
15
|
+
or?:Or
|
|
16
|
+
):number[]|Or
|
|
17
|
+
/**
|
|
18
|
+
* Returns function that returns value from [idx_filter](#idx_filter) with `fn` argument.
|
|
19
|
+
*/
|
|
20
|
+
export declare function idx_filter_(
|
|
21
|
+
is_match_?:is_match__T<number>
|
|
22
|
+
):(a:number[])=>number[]
|
|
23
|
+
export declare function maybe_idx_filter_(
|
|
24
|
+
is_match_?:is_match__T<number>
|
|
25
|
+
):(a:number[]|undefined)=>number[]|undefined
|
|
26
|
+
export {
|
|
27
|
+
idx_filter as filter__idx,
|
|
28
|
+
idx_filter_ as _idx_filter,
|
|
29
|
+
maybe_idx_filter_ as _maybe_idx_filter,
|
|
30
|
+
idx_filter_ as _filter__idx,
|
|
31
|
+
idx_filter_ as _fn__filter__idx,
|
|
32
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { I__ } from '../combinators/index.js'
|
|
2
|
+
/** @typedef {import('../a_item/index.d.ts').a_item_T}a_item_T */
|
|
3
|
+
/** @typedef {import('../array_types/index.d.ts').is_match__T}is_match__T */
|
|
4
|
+
/**
|
|
5
|
+
* Returns Array of `idx` indices filtered by `fn`.
|
|
6
|
+
* @param {unknown[]}in_a
|
|
7
|
+
* @param {is_match__T<a_item_T<unknown>>}is_match_
|
|
8
|
+
* @returns {number[]}
|
|
9
|
+
*/
|
|
10
|
+
export function idx_filter(in_a, is_match_ = I__) {
|
|
11
|
+
const a = in_a
|
|
12
|
+
const idx_a = []
|
|
13
|
+
for (let idx = 0; idx < a.length; idx++) {
|
|
14
|
+
const value = a[idx]
|
|
15
|
+
if (is_match_(value, idx)) {
|
|
16
|
+
idx_a.push(idx)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return idx_a
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @param maybe_a{number[]|undefined}
|
|
23
|
+
* @param is_match_{is_match__T<a_item_T<unknown>>}
|
|
24
|
+
* @param or{number[]|null|undefined}
|
|
25
|
+
* @returns {number[]|null|undefined}
|
|
26
|
+
*/
|
|
27
|
+
export function maybe_idx_filter(
|
|
28
|
+
maybe_a,
|
|
29
|
+
is_match_ = I__,
|
|
30
|
+
or = null
|
|
31
|
+
) {
|
|
32
|
+
if (!maybe_a) return or
|
|
33
|
+
return idx_filter(maybe_a, is_match_)
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Returns function that returns value from [idx_filter](#idx_filter) with `fn` argument.
|
|
37
|
+
* @param is_match_{is_match__T<number>}
|
|
38
|
+
* @returns {(a:number[])=>number[]}
|
|
39
|
+
*/
|
|
40
|
+
export function idx_filter_(is_match_ = I__) {
|
|
41
|
+
return (a)=>idx_filter(a, is_match_)
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @param is_match_{is_match__T<number>}
|
|
45
|
+
* @returns {(a:number[]|undefined)=>number[]|undefined}
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
export function maybe_idx_filter_(is_match_ = I__) {
|
|
49
|
+
return (a)=>maybe_idx_filter(a, is_match_)
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
idx_filter as filter__idx,
|
|
53
|
+
idx_filter_ as _idx_filter,
|
|
54
|
+
maybe_idx_filter_ as _maybe_idx_filter,
|
|
55
|
+
idx_filter_ as _filter__idx,
|
|
56
|
+
idx_filter_ as _fn__filter__idx,
|
|
57
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { item_key_idx_val_fn_T } from '../array_types/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* Returns a Hash where each key is `a[idx][key]` & value is `idx`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function idx_key_r_<
|
|
6
|
+
Obj extends Record<string, string> = Record<string, string>
|
|
7
|
+
>(
|
|
8
|
+
a:readonly Obj[],
|
|
9
|
+
key:string|number,
|
|
10
|
+
item_key_idx_val_?:item_key_idx_val_fn_T<string, Obj>
|
|
11
|
+
):idx_key_r_T
|
|
12
|
+
export declare type idx_key_r_T = Record<string, number>
|
|
13
|
+
export declare function maybe_idx_key_r_<
|
|
14
|
+
Obj extends Record<string, string> = Record<string, string>, Or = null
|
|
15
|
+
>(
|
|
16
|
+
maybe_a:readonly Obj[]|undefined,
|
|
17
|
+
key:string|number,
|
|
18
|
+
item_key_idx_val_?:item_key_idx_val_fn_T<string, Obj>,
|
|
19
|
+
or?:Or
|
|
20
|
+
):idx_key_r_T|Or
|
|
21
|
+
export {
|
|
22
|
+
idx_key_r_ as idx_key_h_,
|
|
23
|
+
idx_key_r_ as _idx_key_hash,
|
|
24
|
+
idx_key_r_ as _hash__key__idx,
|
|
25
|
+
maybe_idx_key_r_ as maybe_idx_key_h_,
|
|
26
|
+
maybe_idx_key_r_ as _maybe_idx_key_hash,
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns function that returns from [_idx_key_hash](#_idx_key_hash) with `item_key_idx_val_` function argument.
|
|
30
|
+
*/
|
|
31
|
+
export declare function idx_key_r__<
|
|
32
|
+
Obj extends Record<string, string> = Record<string, string>
|
|
33
|
+
>(
|
|
34
|
+
item_key_idx_val_?:item_key_idx_val_fn_T<string, Obj>
|
|
35
|
+
):(a:readonly Obj[], key:string|number)=>idx_key_r_T
|
|
36
|
+
export declare function maybe_idx_key_r__<
|
|
37
|
+
Obj extends Record<string, string> = Record<string, string>,
|
|
38
|
+
Or = null
|
|
39
|
+
>(
|
|
40
|
+
item_key_idx_val_?:item_key_idx_val_fn_T<string, Obj>,
|
|
41
|
+
or?:Or
|
|
42
|
+
):(maybe_a:Obj[]|undefined, key:string)=>idx_key_r_T|Or
|
|
43
|
+
export {
|
|
44
|
+
idx_key_r__ as idx_key_h_2,
|
|
45
|
+
idx_key_r__ as _idx_key_hash_fn,
|
|
46
|
+
idx_key_r__ as _fn__idx_key_hash,
|
|
47
|
+
maybe_idx_key_r__ as _maybe_idx_key_hash_fn,
|
|
48
|
+
maybe_idx_key_r__ as maybe_idx_key_h_2,
|
|
49
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { I__ } from '../combinators/index.js'
|
|
2
|
+
/** @typedef {import('../array_types/index.d.ts').item_key_idx_val_fn_T}item_key_idx_val_fn_T */
|
|
3
|
+
/** @typedef {import('../idx_key_r/index.d.ts').idx_key_r_T}idx_key_r_T */
|
|
4
|
+
/**
|
|
5
|
+
* Returns a Hash where each key is `a[idx][key]` & value is `idx`.
|
|
6
|
+
* @param {unknown[]}a
|
|
7
|
+
* @param {string|number}key
|
|
8
|
+
* @param {item_key_idx_val_fn_T<string, Record<string, string>>}item_key_idx_val_
|
|
9
|
+
* @returns {idx_key_r_T}
|
|
10
|
+
*/
|
|
11
|
+
export function idx_key_r_(a, key, item_key_idx_val_ = I__) {
|
|
12
|
+
let idx_key_r = {}
|
|
13
|
+
if (a) {
|
|
14
|
+
for (let idx = 0; idx < a.length; idx++) {
|
|
15
|
+
const obj = a[idx]
|
|
16
|
+
const val =
|
|
17
|
+
item_key_idx_val_
|
|
18
|
+
? item_key_idx_val_(obj && obj[key], obj, key, idx)
|
|
19
|
+
: obj && obj[key]
|
|
20
|
+
if (!val) continue
|
|
21
|
+
idx_key_r[val] = idx
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return idx_key_r
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @param {unknown[]|undefined}maybe_a
|
|
28
|
+
* @param {string|number}key
|
|
29
|
+
* @param {item_key_idx_val_fn_T<string, Record<string, string>>}item_key_idx_val_
|
|
30
|
+
* @param {idx_key_r_T|null|undefined}or
|
|
31
|
+
* @returns {idx_key_r_T|null|undefined}
|
|
32
|
+
*/
|
|
33
|
+
export function maybe_idx_key_r_(
|
|
34
|
+
maybe_a,
|
|
35
|
+
key,
|
|
36
|
+
item_key_idx_val_ = I__,
|
|
37
|
+
or = null
|
|
38
|
+
) {
|
|
39
|
+
return maybe_a ? idx_key_r_(maybe_a, key, item_key_idx_val_) : or
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
idx_key_r_ as idx_key_h_,
|
|
43
|
+
idx_key_r_ as _idx_key_hash,
|
|
44
|
+
idx_key_r_ as _hash__key__idx,
|
|
45
|
+
maybe_idx_key_r_ as maybe_idx_key_h_,
|
|
46
|
+
maybe_idx_key_r_ as _maybe_idx_key_hash,
|
|
47
|
+
}
|
|
48
|
+
/** @typedef {import('./index.d.ts').idx_key_r_T}idx_key_r_T */
|
|
49
|
+
/** @typedef {import('../array_types/index.d.ts').item_key_idx_val_fn_T}item_key_idx_val_f n_T */
|
|
50
|
+
/**
|
|
51
|
+
* Returns function that returns from [_idx_key_hash](#_idx_key_hash) with `item_key_idx_val_` function argument.
|
|
52
|
+
* @param {item_key_idx_val_fn_T<string, Record<string, string>>}item_key_idx_val_
|
|
53
|
+
* @returns {(a:Record<string, string>[], key:string|number)=>idx_key_r_T}
|
|
54
|
+
*/
|
|
55
|
+
export function idx_key_r__(
|
|
56
|
+
item_key_idx_val_ = I__
|
|
57
|
+
) {
|
|
58
|
+
return (a, key)=>idx_key_r_(a, key, item_key_idx_val_)
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @param {item_key_idx_val_fn_T<string, Record<string, string>>}item_key_idx_val_
|
|
62
|
+
* @param {idx_key_r_T|null|unknown}or
|
|
63
|
+
* @returns {(maybe_a:Record<string, string>[]|undefined, key:string)=>idx_key_r_T|null|unknown}
|
|
64
|
+
*/
|
|
65
|
+
export function maybe_idx_key_r__(
|
|
66
|
+
item_key_idx_val_ = I__,
|
|
67
|
+
or = null
|
|
68
|
+
) {
|
|
69
|
+
return (maybe_a, key)=>
|
|
70
|
+
maybe_idx_key_r_(maybe_a, key, item_key_idx_val_, or)
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
idx_key_r__ as idx_key_h_2,
|
|
74
|
+
idx_key_r__ as _idx_key_hash_fn,
|
|
75
|
+
idx_key_r__ as _fn__idx_key_hash,
|
|
76
|
+
maybe_idx_key_r__ as _maybe_idx_key_hash_fn,
|
|
77
|
+
maybe_idx_key_r__ as maybe_idx_key_h_2,
|
|
78
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { is_match__T } from '../array_types/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* Returns Array of indices `idx` not rejected by `is_match_`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function idx_reject<
|
|
6
|
+
Val extends unknown = unknown
|
|
7
|
+
>(
|
|
8
|
+
a:readonly Val[], is_match_:is_match__T<Val>
|
|
9
|
+
):number[]
|
|
10
|
+
export declare function maybe_idx_reject<
|
|
11
|
+
Val extends unknown = unknown, Or = null
|
|
12
|
+
>(
|
|
13
|
+
maybe_a:readonly Val[]|undefined,
|
|
14
|
+
is_match_:is_match__T<Val>,
|
|
15
|
+
or?:Or
|
|
16
|
+
):number[]|Or
|
|
17
|
+
export { idx_reject as reject__idx, }
|
|
18
|
+
/**
|
|
19
|
+
* Returns function that returns value from [idx_reject](#idx_reject) with `is_match_` argument.
|
|
20
|
+
*/
|
|
21
|
+
export declare function idx_reject_<
|
|
22
|
+
Val extends unknown = unknown
|
|
23
|
+
>(
|
|
24
|
+
is_match_:is_match__T<Val>
|
|
25
|
+
):(a:readonly Val[])=>number[]
|
|
26
|
+
export {
|
|
27
|
+
idx_reject_ as _idx_reject,
|
|
28
|
+
idx_reject_ as _reject__idx,
|
|
29
|
+
idx_reject_ as _fn__reject__idx,
|
|
30
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** @typedef {import('../array_types/index.d.ts').is_match__T} */
|
|
2
|
+
/**
|
|
3
|
+
* Returns Array of indices `idx` not rejected by `is_match_`.
|
|
4
|
+
* @param {unknown[]}a
|
|
5
|
+
* @param {is_match__T}is_match_
|
|
6
|
+
* @returns {number[]}
|
|
7
|
+
*/
|
|
8
|
+
export function idx_reject(a, is_match_) {
|
|
9
|
+
const out_a = []
|
|
10
|
+
for (let idx = 0; idx < a.length; idx++) {
|
|
11
|
+
const value = a[idx]
|
|
12
|
+
if (is_match_(value, idx)) {
|
|
13
|
+
out_a.push(idx)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return out_a
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @param {unknown[]|undefined}maybe_a
|
|
20
|
+
* @param {is_match__T}is_match_
|
|
21
|
+
* @param {number[]|null|undefined}or
|
|
22
|
+
* @returns {number[]|null|undefined}
|
|
23
|
+
*/
|
|
24
|
+
export function maybe_idx_reject(
|
|
25
|
+
maybe_a,
|
|
26
|
+
is_match_,
|
|
27
|
+
or = null
|
|
28
|
+
) {
|
|
29
|
+
if (!maybe_a) return or
|
|
30
|
+
return idx_reject(maybe_a, is_match_)
|
|
31
|
+
}
|
|
32
|
+
export { idx_reject as reject__idx, }
|
|
33
|
+
/**
|
|
34
|
+
* Returns function that returns the value from [idx_reject](#idx_reject) with `is_match_` argument.
|
|
35
|
+
* @param {is_match__T}is_match_
|
|
36
|
+
* @returns {(a:unknown[])=>number[]}
|
|
37
|
+
*/
|
|
38
|
+
export function idx_reject_(is_match_) {
|
|
39
|
+
return a=>idx_reject(a, is_match_)
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
idx_reject_ as _idx_reject,
|
|
43
|
+
idx_reject_ as _reject__idx,
|
|
44
|
+
idx_reject_ as _fn__reject__idx,
|
|
45
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sort `val_a` by an array of indices in `in_sort_idx_a`.
|
|
3
|
+
*/
|
|
4
|
+
export declare function idx_sort_a_<
|
|
5
|
+
I extends unknown = unknown
|
|
6
|
+
>(
|
|
7
|
+
val_a:readonly I[],
|
|
8
|
+
in_sort_idx_a:readonly number[]|undefined
|
|
9
|
+
):I[]
|
|
10
|
+
export declare function maybe_idx_sort_a_<
|
|
11
|
+
I = unknown, Or = null
|
|
12
|
+
>(
|
|
13
|
+
in_val_a:readonly I[]|undefined,
|
|
14
|
+
in_sort_idx_a:readonly number[]|undefined,
|
|
15
|
+
or?:Or
|
|
16
|
+
):I[]|Or
|
|
17
|
+
export {
|
|
18
|
+
idx_sort_a_ as idx_sort_a1_fn,
|
|
19
|
+
idx_sort_a_ as _idx_sort_a1,
|
|
20
|
+
idx_sort_a_ as _a1__sort__idx,
|
|
21
|
+
maybe_idx_sort_a_ as maybe_idx_sort_a1_fn,
|
|
22
|
+
maybe_idx_sort_a_ as _maybe_idx_sort_a1,
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sort `val_a` by an array of indices in `in_sort_idx_a`.
|
|
3
|
+
* @param {unknown[]}val_a
|
|
4
|
+
* @param {number[]|undefined}in_sort_idx_a
|
|
5
|
+
* @returns {unknown[]}
|
|
6
|
+
*/
|
|
7
|
+
export function idx_sort_a_(val_a, in_sort_idx_a) {
|
|
8
|
+
const sort_idx_a = in_sort_idx_a
|
|
9
|
+
const idx_sort_a = []
|
|
10
|
+
for (let i = 0; i < sort_idx_a.length; i++) {
|
|
11
|
+
const idx = sort_idx_a[i]
|
|
12
|
+
idx_sort_a.push(val_a[idx])
|
|
13
|
+
}
|
|
14
|
+
return idx_sort_a
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
idx_sort_a_ as idx_sort_a1_fn,
|
|
18
|
+
idx_sort_a_ as _idx_sort_a1,
|
|
19
|
+
idx_sort_a_ as _a1__sort__idx,
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @param {unknown[]|undefined}in_val_a
|
|
23
|
+
* @param {number[]|undefined}in_sort_idx_a
|
|
24
|
+
* @param {unknown[]|null|undefined}or
|
|
25
|
+
* @returns {unknown[]|null|undefined}
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
export function maybe_idx_sort_a_(
|
|
29
|
+
in_val_a,
|
|
30
|
+
in_sort_idx_a,
|
|
31
|
+
or = null
|
|
32
|
+
) {
|
|
33
|
+
if (!in_sort_idx_a || !in_val_a) return or
|
|
34
|
+
return idx_sort_a_(in_val_a, in_sort_idx_a)
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
maybe_idx_sort_a_ as maybe_idx_sort_a1_fn,
|
|
38
|
+
maybe_idx_sort_a_ as _maybe_idx_sort_a1,
|
|
39
|
+
}
|