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,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns Array of `r[key_a[]]`.
|
|
3
|
+
* @param {Record<string, unknown>}r
|
|
4
|
+
* @param {string}key_a
|
|
5
|
+
* @returns {unknown[]}
|
|
6
|
+
*/
|
|
7
|
+
export function r_val_a_(r, key_a) {
|
|
8
|
+
return key_a ? key_a.map(key=>r[key]) : Object.values(r)
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @param {Record<string, unknown>|undefined}r
|
|
12
|
+
* @param {string}key_a
|
|
13
|
+
* @param {unknown[]|null|undefined}or
|
|
14
|
+
* @returns {unknown[]|null|undefined}
|
|
15
|
+
*/
|
|
16
|
+
export function maybe_r_val_a_(r, key_a, or = null) {
|
|
17
|
+
if (!r) return or
|
|
18
|
+
return r_val_a_(r, key_a)
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
r_val_a_ as key_a_from_val_a_,
|
|
22
|
+
r_val_a_ as key_a1_from_val_a1_fn,
|
|
23
|
+
r_val_a_ as _key_a1_from_val_a1,
|
|
24
|
+
r_val_a_ as _a1__val__from__a1__key,
|
|
25
|
+
maybe_r_val_a_ as maybe_key_a_from_val_a_,
|
|
26
|
+
maybe_r_val_a_ as maybe_key_a1_from_val_a1_fn,
|
|
27
|
+
maybe_r_val_a_ as _maybe_key_a1_from_val_a1,
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { compare_1_T } from '../array_types/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* Returns the rank of the items where the compare function === 0
|
|
4
|
+
*/
|
|
5
|
+
export declare function rank<
|
|
6
|
+
I extends unknown = unknown
|
|
7
|
+
>(
|
|
8
|
+
a:readonly I[], compare_1:compare_1_T
|
|
9
|
+
):number
|
|
10
|
+
export { rank as rank__a1, }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the rank of the items where the compare function === 0
|
|
3
|
+
* @param {unknown[]}a
|
|
4
|
+
* @param {import('../array_types/index.js').compare_1_T}compare_1
|
|
5
|
+
* @returns {number}
|
|
6
|
+
*/
|
|
7
|
+
export function rank(a, compare_1) {
|
|
8
|
+
let i_rank = 1
|
|
9
|
+
for (let i = 0; i < a.length; i++) {
|
|
10
|
+
if (compare_1(a[i]) > 0) {
|
|
11
|
+
i_rank++
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return i_rank
|
|
15
|
+
}
|
|
16
|
+
export { rank as rank__a1, }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rate limit function factory.
|
|
3
|
+
* @link {@see https://www.matteoagosti.com/blog/2013/01/22/rate-limiting-function-calls-in-javascript/}
|
|
4
|
+
*/
|
|
5
|
+
export declare function rate_limit_<Out>(
|
|
6
|
+
ops_max:number, interval:number, allow_bursts?:boolean
|
|
7
|
+
):rate_limit__T<Out>
|
|
8
|
+
export declare type rate_limit__T<Out> = (fn:rate_limit_fn_T<Out>)=>Promise<Out>
|
|
9
|
+
export declare type rate_limit_fn_T<Out> = ()=>Promise<Out>
|
|
10
|
+
export { rate_limit_ as _rate_limit, }
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rate limit function factory.
|
|
3
|
+
* @param {number}ops_max
|
|
4
|
+
* @param {number}interval_millis
|
|
5
|
+
* @param {boolean}allow_bursts
|
|
6
|
+
* @returns {import('./index.d.ts').rate_limit__T}
|
|
7
|
+
* @link {@see https://www.matteoagosti.com/blog/2013/01/22/rate-limiting-function-calls-in-javascript/}
|
|
8
|
+
*/
|
|
9
|
+
export function rate_limit_(
|
|
10
|
+
ops_max, interval_millis, allow_bursts = false
|
|
11
|
+
) {
|
|
12
|
+
const max_rate = allow_bursts ? ops_max : ops_max / interval_millis
|
|
13
|
+
let ops_num = 0
|
|
14
|
+
let start = new Date().getTime()
|
|
15
|
+
const queue_a = []
|
|
16
|
+
function rate_limit(fn) {
|
|
17
|
+
let rate = 0
|
|
18
|
+
const now = new Date().getTime()
|
|
19
|
+
const elapsed = now - start
|
|
20
|
+
if (elapsed > interval_millis) {
|
|
21
|
+
ops_num = 0
|
|
22
|
+
start = now
|
|
23
|
+
}
|
|
24
|
+
rate = ops_num / (allow_bursts ? 1 : elapsed)
|
|
25
|
+
return new Promise(async (resolve, reject)=>{
|
|
26
|
+
try {
|
|
27
|
+
if (rate < max_rate) {
|
|
28
|
+
if (queue_a.length) {
|
|
29
|
+
if (fn) queue_a.push(async ()=>resolve(await fn())
|
|
30
|
+
)
|
|
31
|
+
ops_num += 1
|
|
32
|
+
queue_a.shift()().then()
|
|
33
|
+
} else {
|
|
34
|
+
ops_num += 1
|
|
35
|
+
resolve(await fn())
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
if (fn) queue_a.push(async ()=>resolve(await fn())
|
|
39
|
+
)
|
|
40
|
+
setTimeout(rate_limit, 1 / max_rate)
|
|
41
|
+
}
|
|
42
|
+
} catch (err) {
|
|
43
|
+
reject(err)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
return rate_limit
|
|
48
|
+
}
|
|
49
|
+
export { rate_limit_ as _rate_limit, }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Ctx } from '../be_/index.js'
|
|
2
|
+
import type { rc_be__val__T } from '../rc_be_/index.js'
|
|
3
|
+
export declare function rc_be<
|
|
4
|
+
Out extends NonNullable<unknown>
|
|
5
|
+
>(ctx:Ctx, val_:rc_be__val__T<Out>):Out
|
|
6
|
+
export declare function rc_be<
|
|
7
|
+
Out extends NonNullable<unknown>
|
|
8
|
+
>(ctx:Ctx, key:string, val_:rc_be__val__T<Out>):Out
|
|
9
|
+
export { rc_be as rc_b, }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { rc_be_ } from '../rc_be_/index.js'
|
|
2
|
+
/** @typedef {import('../be_/index.d.ts').Ctx}Ctx */
|
|
3
|
+
/** @typedef {import('../rc_be_/index.d.ts').rc_be__val__T}rc_be__val__T */
|
|
4
|
+
/**
|
|
5
|
+
* @param {Ctx}ctx
|
|
6
|
+
* @param {string|rc_be__val__T<NonNullable<unknown>>}key_or_val
|
|
7
|
+
* @param {rc_be__val__T<NonNullable<unknown>>}[val_]
|
|
8
|
+
* @returns {NonNullable<unknown>}
|
|
9
|
+
*/
|
|
10
|
+
export function rc_be(
|
|
11
|
+
ctx,
|
|
12
|
+
key_or_val,
|
|
13
|
+
val_
|
|
14
|
+
) {
|
|
15
|
+
return val_ ? rc_be_(key_or_val, val_)(ctx) : rc_be_(key_or_val)(ctx)
|
|
16
|
+
}
|
|
17
|
+
export { rc_be as rc_b, }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Be, be__val__T, be_params_T, Ctx } from '../be_/index.js'
|
|
2
|
+
export declare const be_m_set_key:unique symbol
|
|
3
|
+
/**
|
|
4
|
+
* Returns _be with referencing counting.
|
|
5
|
+
* When all unsubscribes have been called, the ctx[key] is deleted.
|
|
6
|
+
*/
|
|
7
|
+
export declare function rc_be_<
|
|
8
|
+
Out extends NonNullable<unknown>
|
|
9
|
+
>(val_:rc_be__val__T<Out>):rc_be__return_T<Out>
|
|
10
|
+
export declare function rc_be_<
|
|
11
|
+
Out extends NonNullable<unknown>
|
|
12
|
+
>(key:string, val_:rc_be__val__T<Out>):rc_be__return_T<Out>
|
|
13
|
+
export declare type rc_be__return_T<
|
|
14
|
+
Out extends NonNullable<unknown>
|
|
15
|
+
> = (ctx:Ctx, opts?:rc_be_params_T)=>RcBe_return_T<Out>
|
|
16
|
+
export {
|
|
17
|
+
rc_be_ as _rc_be,
|
|
18
|
+
rc_be_ as _rc_b,
|
|
19
|
+
}
|
|
20
|
+
export declare type be_m_set_T<
|
|
21
|
+
Out extends NonNullable<unknown>
|
|
22
|
+
> = Map<Be<Out>, Set<any>>
|
|
23
|
+
export declare type val_this_on_destroy_T = (...destroy_a:rc_be_destroy_T[])=>void
|
|
24
|
+
export interface val_this_T {
|
|
25
|
+
on_destroy:val_this_on_destroy_T
|
|
26
|
+
onDestroy:val_this_on_destroy_T
|
|
27
|
+
}
|
|
28
|
+
export interface rc_be_params_T extends be_params_T {
|
|
29
|
+
owner?:object
|
|
30
|
+
}
|
|
31
|
+
export declare type rc_be__val__T<
|
|
32
|
+
Out extends NonNullable<unknown>
|
|
33
|
+
> = be__val__T<Out>&((this:val_this_T, ctx:Ctx, key:Be<Out>, opts?:rc_be_params_T)=>Out)
|
|
34
|
+
export declare type rc_be_destroy_T = ()=>void
|
|
35
|
+
export interface RcBe_return_T<Out extends unknown = unknown> {
|
|
36
|
+
value:Out
|
|
37
|
+
destroy:rc_be_destroy_T
|
|
38
|
+
}
|
|
39
|
+
export declare type RcBe<
|
|
40
|
+
Out extends NonNullable<unknown>
|
|
41
|
+
> = (ctx:Ctx, opts?:be_params_T)=>RcBe_return_T<Out>
|
|
42
|
+
export declare type RcB<Out extends NonNullable<unknown>> = RcBe<Out>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { be_ } from '../be_/index.js'
|
|
2
|
+
/** @typedef {import('../rc_be_/index.d.ts').rc_be__val__T}rc_be__val__T */
|
|
3
|
+
export const be_m_set_key = Symbol('be_m_set')
|
|
4
|
+
/**
|
|
5
|
+
* @param {string|rc_be__val__T}key_or_val_
|
|
6
|
+
* @param {rc_be__val__T}[val_]
|
|
7
|
+
* @returns {import('./index.d.ts').rc_be__return_T}
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
export function rc_be_(key_or_val_, val_) {
|
|
11
|
+
return (ctx1, opts1)=>{
|
|
12
|
+
const ctx_any = ctx1
|
|
13
|
+
const destroy_cb_a = []
|
|
14
|
+
const val_this = {
|
|
15
|
+
on_destroy,
|
|
16
|
+
onDestroy: on_destroy
|
|
17
|
+
}
|
|
18
|
+
/** @type {rc_be__val__T} */
|
|
19
|
+
const val_ = val_ ? val_ : key_or_val_
|
|
20
|
+
const key = val_ ? key_or_val_ : null
|
|
21
|
+
const be1 =
|
|
22
|
+
val_
|
|
23
|
+
? be_(val_)
|
|
24
|
+
: be_(
|
|
25
|
+
key,
|
|
26
|
+
(ctx, be, opts)=>
|
|
27
|
+
val_.call(val_this, ctx, be, opts)
|
|
28
|
+
)
|
|
29
|
+
let be_m_set = ctx_any[be_m_set_key]
|
|
30
|
+
if (!be_m_set) {
|
|
31
|
+
be_m_set = new Map()
|
|
32
|
+
ctx_any[be_m_set_key] = be_m_set
|
|
33
|
+
}
|
|
34
|
+
let rc_set = be_m_set.get(be1)
|
|
35
|
+
if (!rc_set) {
|
|
36
|
+
rc_set = new Set()
|
|
37
|
+
be_m_set.set(be1, rc_set)
|
|
38
|
+
}
|
|
39
|
+
const owner = (opts1 === null || opts1 === void 0 ? void 0 : opts1.owner) || {}
|
|
40
|
+
rc_set.add(owner)
|
|
41
|
+
let destroy = ()=>{
|
|
42
|
+
rc_set.delete(owner)
|
|
43
|
+
if (!rc_set.size) {
|
|
44
|
+
for (const destroy_cb of destroy_cb_a) {
|
|
45
|
+
destroy_cb()
|
|
46
|
+
}
|
|
47
|
+
ctx1.delete(be1)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
value: be1(ctx1, opts1),
|
|
52
|
+
destroy
|
|
53
|
+
}
|
|
54
|
+
function on_destroy(...in_destroy_cb_a) {
|
|
55
|
+
destroy_cb_a.push(...in_destroy_cb_a)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
rc_be_ as _rc_be,
|
|
61
|
+
rc_be_ as _rc_b,
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function re_(pattern:RegExp|string, flags?:string):RegExp
|
package/all/re_/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type readable_stream_OR_reader_T =
|
|
2
|
+
{ getReader():ReadableStreamDefaultReader<any> }
|
|
3
|
+
|ReadableStreamDefaultReader
|
|
4
|
+
|ReadableStreamBYOBReader
|
|
5
|
+
export type readable_stream_or_reader_T = readable_stream_OR_reader_T
|
|
6
|
+
export declare type readable_reader_T = readable_stream_OR_reader_T
|
|
7
|
+
export declare type line_iterator__readable_reader_T = readable_stream_OR_reader_T
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns reduced `memo` iterating over `a` with `fn(memo, a[], i, a)`.
|
|
3
|
+
*/
|
|
4
|
+
export declare function reduce<
|
|
5
|
+
I extends unknown = unknown, O extends unknown = unknown
|
|
6
|
+
>(
|
|
7
|
+
a:readonly I[],
|
|
8
|
+
fn:reduce_fn_T<I, O>,
|
|
9
|
+
memo:O
|
|
10
|
+
):O
|
|
11
|
+
export declare type reduce_fn_T<
|
|
12
|
+
I extends unknown = unknown, O extends unknown = unknown
|
|
13
|
+
> = (
|
|
14
|
+
memo:O, item:I, idx:number, a:readonly I[]
|
|
15
|
+
)=>O
|
|
16
|
+
export declare function maybe_reduce<
|
|
17
|
+
I extends unknown = unknown,
|
|
18
|
+
O extends unknown = unknown,
|
|
19
|
+
Or = null
|
|
20
|
+
>(
|
|
21
|
+
maybe_a:readonly I[]|undefined,
|
|
22
|
+
fn:reduce_fn_T<I, O>,
|
|
23
|
+
memo:O,
|
|
24
|
+
or?:Or
|
|
25
|
+
):O|Or
|
|
26
|
+
/**
|
|
27
|
+
* Return Function that returns from `reduce` with `fn` and factory `memo_(a)`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function reduce_<
|
|
30
|
+
I extends unknown = unknown, O extends unknown = unknown
|
|
31
|
+
>(
|
|
32
|
+
fn:reduce_fn_T<I, O>, memo_:memo_fn_T<I, O>
|
|
33
|
+
):(a:readonly I[], memo:O)=>O
|
|
34
|
+
export declare type memo_fn_T<
|
|
35
|
+
I extends unknown = unknown, O extends unknown = unknown
|
|
36
|
+
> =
|
|
37
|
+
(a:readonly I[])=>O
|
|
38
|
+
export declare function maybe_reduce_<
|
|
39
|
+
I extends unknown = unknown,
|
|
40
|
+
O extends unknown = unknown,
|
|
41
|
+
Or = null
|
|
42
|
+
>(
|
|
43
|
+
fn:reduce_fn_T<I, O|undefined>,
|
|
44
|
+
memo_fn:memo_fn_T<I, O>|undefined,
|
|
45
|
+
or?:Or
|
|
46
|
+
):(a:readonly I[], memo:O)=>O|Or
|
|
47
|
+
export {
|
|
48
|
+
reduce_ as _reduce,
|
|
49
|
+
reduce_ as _fn__reduce,
|
|
50
|
+
maybe_reduce_ as _maybe_reduce,
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** @typedef {import('../reduce/index.d.ts').reduce_fn_T}reduce_fn_T */
|
|
2
|
+
/**
|
|
3
|
+
* Returns reduced `memo` iterating over `a` with `fn(memo, a[], i, a)`.
|
|
4
|
+
* @param {unknown[]}a
|
|
5
|
+
* @param {reduce_fn_T}fn
|
|
6
|
+
* @param {unknown}memo
|
|
7
|
+
* @returns {unknown}
|
|
8
|
+
*/
|
|
9
|
+
export function reduce(a, fn, memo) {
|
|
10
|
+
for (let i = 0; i < a.length; i++) {
|
|
11
|
+
const o = a[i]
|
|
12
|
+
memo = fn(memo, o, i, a)
|
|
13
|
+
}
|
|
14
|
+
return memo
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @param {unknown[]|undefined}maybe_a
|
|
18
|
+
* @param {reduce_fn_T}fn
|
|
19
|
+
* @param {unknown}memo
|
|
20
|
+
* @param {unknown}or
|
|
21
|
+
* @returns {unknown}
|
|
22
|
+
*/
|
|
23
|
+
export function maybe_reduce(
|
|
24
|
+
maybe_a, fn, memo, or = null
|
|
25
|
+
) {
|
|
26
|
+
if (!maybe_a) return or
|
|
27
|
+
return reduce(maybe_a, fn, memo)
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Return Function that returns from `reduce` with `fn` and factory `memo_(a)`.
|
|
31
|
+
* @param {reduce_fn_T}fn
|
|
32
|
+
* @param {memo_fn_T}memo_
|
|
33
|
+
* @returns {(a:unknown, memo:unknown)=>unknown}
|
|
34
|
+
*/
|
|
35
|
+
export function reduce_(fn, memo_) {
|
|
36
|
+
return (a, memo)=>a.reduce(fn, memo == null ? memo_ && memo_(a) : memo)
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @param {reduce_fn_T}fn
|
|
40
|
+
* @param {memo_fn_T}memo_fn
|
|
41
|
+
* @param {unknown}or
|
|
42
|
+
* @returns {(a:unknown[], memo:unknown)=>unknown}
|
|
43
|
+
*/
|
|
44
|
+
export function maybe_reduce_(fn, memo_fn, or = null) {
|
|
45
|
+
return (a, memo)=>a ? a.reduce(fn, memo == null ? memo_fn && memo_fn(a) : memo) : or
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
reduce_ as _reduce,
|
|
49
|
+
reduce_ as _fn__reduce,
|
|
50
|
+
maybe_reduce_ as _maybe_reduce,
|
|
51
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* indexOf with regex
|
|
3
|
+
* @param {str}str
|
|
4
|
+
* @param {RegExp}regex
|
|
5
|
+
* @param {number}in_startpos
|
|
6
|
+
* @returns {number}
|
|
7
|
+
* @see {@link https://github.com/capaj/index-of-regex}
|
|
8
|
+
*/
|
|
9
|
+
export function regex_indexOf(str, regex, in_startpos) {
|
|
10
|
+
const startpos = in_startpos || 0
|
|
11
|
+
const indexOf = str.substring(startpos).search(regex)
|
|
12
|
+
return indexOf >= 0 ? indexOf + startpos : indexOf
|
|
13
|
+
}
|
|
14
|
+
export { regex_indexOf as indexOf__regex }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lastIndexOf with regex
|
|
3
|
+
* @param {string}str
|
|
4
|
+
* @param {RegExp}regex
|
|
5
|
+
* @param {number}startpos
|
|
6
|
+
* @returns {number}
|
|
7
|
+
*/
|
|
8
|
+
export function regex_lastIndexOf(str, regex, startpos) {
|
|
9
|
+
regex = regex.global ? regex : new RegExp(regex.source, 'g' + (regex.ignoreCase ? 'i' : '') + (regex.multiline ? 'm' : ''))
|
|
10
|
+
if (typeof startpos === 'undefined') {
|
|
11
|
+
startpos = str.length
|
|
12
|
+
} else if (startpos < 0) {
|
|
13
|
+
startpos = 0
|
|
14
|
+
}
|
|
15
|
+
const stringToWorkWith = str.substring(0, startpos + 1)
|
|
16
|
+
let lastIndexOf = -1
|
|
17
|
+
let nextStop = 0
|
|
18
|
+
let result
|
|
19
|
+
while ((result = regex.exec(stringToWorkWith)) != null) {
|
|
20
|
+
lastIndexOf = result.index
|
|
21
|
+
regex.lastIndex = ++nextStop
|
|
22
|
+
}
|
|
23
|
+
return lastIndexOf
|
|
24
|
+
}
|
|
25
|
+
export { regex_lastIndexOf as lastIndexOf__regex }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { is_match__T } from '../array_types/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* Returns Array of items not rejected by `fn`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function reject<
|
|
6
|
+
Val extends unknown = unknown, Out extends unknown = readonly Val[]
|
|
7
|
+
>(
|
|
8
|
+
a:readonly Val[], is_match_:is_match__T<Val>
|
|
9
|
+
):Out
|
|
10
|
+
export declare function maybe_reject<
|
|
11
|
+
Val extends unknown = unknown,
|
|
12
|
+
Out extends unknown = readonly Val[],
|
|
13
|
+
Or = null
|
|
14
|
+
>(
|
|
15
|
+
maybe_a:readonly Val[]|undefined,
|
|
16
|
+
is_match_:is_match__T<Val>,
|
|
17
|
+
or?:Or
|
|
18
|
+
):Out|Or
|
|
19
|
+
/**
|
|
20
|
+
* Returns function that returns value from [reject](#reject) with `fn` argument.
|
|
21
|
+
*/
|
|
22
|
+
export declare function reject_<
|
|
23
|
+
I extends unknown = unknown, O extends unknown = readonly I[]
|
|
24
|
+
>(
|
|
25
|
+
is_match_:is_match__T<I>
|
|
26
|
+
):(a:readonly I[])=>O
|
|
27
|
+
export declare function maybe_reject_<
|
|
28
|
+
I extends unknown = unknown,
|
|
29
|
+
O extends unknown = readonly I[],
|
|
30
|
+
Or = null
|
|
31
|
+
>(
|
|
32
|
+
is_match_:is_match__T<I>,
|
|
33
|
+
or?:Or
|
|
34
|
+
):(a:readonly I[]|undefined)=>O|Or
|
|
35
|
+
export {
|
|
36
|
+
reject_ as _reject,
|
|
37
|
+
reject_ as _fn__reject,
|
|
38
|
+
maybe_reject_ as _maybe_reject,
|
|
39
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** @typedef {import('../array_types/index.d.ts').is_match__T}is_match__T */
|
|
2
|
+
/**
|
|
3
|
+
* Returns Array of items not rejected by `fn`.
|
|
4
|
+
* @param {unknown[]}a
|
|
5
|
+
* @param {is_match__T}is_match_
|
|
6
|
+
* @returns {unknown}
|
|
7
|
+
*/
|
|
8
|
+
export function reject(a, is_match_) {
|
|
9
|
+
return a.filter((value, idx)=>!is_match_(value, idx))
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @param {unknown[]|undefined}maybe_a
|
|
13
|
+
* @param {is_match__T}is_match_
|
|
14
|
+
* @param {unknown}or
|
|
15
|
+
* @returns {unknown}
|
|
16
|
+
*/
|
|
17
|
+
export function maybe_reject(maybe_a, is_match_, or = null) {
|
|
18
|
+
return maybe_a ? maybe_a.filter((value, idx)=>!is_match_(value, idx)) : or
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Returns function that returns value from [reject](#reject) with `fn` argument.
|
|
22
|
+
* @param {is_match__T}is_match_
|
|
23
|
+
* @returns {(a:unknown[])=>unknown}
|
|
24
|
+
*/
|
|
25
|
+
export function reject_(is_match_) {
|
|
26
|
+
return a=>reject(a, is_match_)
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @param {is_match__T}is_match_
|
|
30
|
+
* @param {unknown}or
|
|
31
|
+
* @returns {(a:unknown[]|undefined)=>unknown}
|
|
32
|
+
*/
|
|
33
|
+
export function maybe_reject_(is_match_, or = null) {
|
|
34
|
+
return a=>maybe_reject(a, is_match_, or)
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
reject_ as _reject,
|
|
38
|
+
reject_ as _fn__reject,
|
|
39
|
+
maybe_reject_ as _maybe_reject,
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove each `...item_a` from `a`.
|
|
3
|
+
*/
|
|
4
|
+
export declare function remove<
|
|
5
|
+
I extends unknown = unknown, O extends unknown = readonly I[]
|
|
6
|
+
>(
|
|
7
|
+
a:readonly I[],
|
|
8
|
+
...item_a:readonly I[]
|
|
9
|
+
):O
|
|
10
|
+
export declare function maybe_remove<
|
|
11
|
+
I extends unknown = unknown, O extends unknown = readonly I[]
|
|
12
|
+
>(
|
|
13
|
+
maybe_a:readonly I[]|undefined,
|
|
14
|
+
...item_a:readonly I[]
|
|
15
|
+
):O|undefined
|
|
16
|
+
export { remove as remove__a1, }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { remove_idx } from '../remove_idx/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* Remove each `...item_a` from `a`.
|
|
4
|
+
* @param {unknown[]}a
|
|
5
|
+
* @param {unknown}item_a
|
|
6
|
+
* @returns {unknown}
|
|
7
|
+
*/
|
|
8
|
+
export function remove(a, ...item_a) {
|
|
9
|
+
for (let i = 0; i < item_a.length; i++) {
|
|
10
|
+
const key = item_a[i]
|
|
11
|
+
let index
|
|
12
|
+
while ((index = a.lastIndexOf(key)) > -1) {
|
|
13
|
+
remove_idx(a, index)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return a
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @param {unknown[]|undefined}maybe_a
|
|
20
|
+
* @param {unknown}item_a
|
|
21
|
+
* @returns {unknown}
|
|
22
|
+
*/
|
|
23
|
+
export function maybe_remove(maybe_a, ...item_a) {
|
|
24
|
+
if (!maybe_a) return
|
|
25
|
+
return remove(maybe_a, ...item_a)
|
|
26
|
+
}
|
|
27
|
+
export { remove as remove__a1, }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove `count = 1` items from `a` at position `idx`.
|
|
3
|
+
*/
|
|
4
|
+
export declare function remove_idx<
|
|
5
|
+
I extends unknown = unknown, O extends unknown = readonly I[]
|
|
6
|
+
>(
|
|
7
|
+
a:readonly I[], idx:number, count?:number
|
|
8
|
+
):O
|
|
9
|
+
export {
|
|
10
|
+
remove_idx as remove__idx,
|
|
11
|
+
remove_idx as remove__index,
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove `count = 1` items from `a` at position `idx`.
|
|
3
|
+
* @param {unknown[]}a
|
|
4
|
+
* @param {number}idx
|
|
5
|
+
* @param {number}count
|
|
6
|
+
* @returns {unknown[]}
|
|
7
|
+
*/
|
|
8
|
+
export function remove_idx(a, idx, count = 1) {
|
|
9
|
+
return a.splice(idx, count)
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
remove_idx as remove__idx,
|
|
13
|
+
remove_idx as remove__index,
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|