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,14 @@
|
|
|
1
|
+
import { and } from '../and/index.js'
|
|
2
|
+
import { wrap_concat } from '../wrap_concat/index.js'
|
|
3
|
+
/**
|
|
4
|
+
* Returns function that returns the first falsy in `a_unwrap` or `value`.
|
|
5
|
+
* @param {import('../a_nowrap/index.js').a_nowrap_T}a_unwrap
|
|
6
|
+
* @returns {(val:unknown)=>unknown}
|
|
7
|
+
*/
|
|
8
|
+
export function left_and_(a_unwrap) {
|
|
9
|
+
return val=>and(wrap_concat(a_unwrap, val))
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
left_and_ as _left_and,
|
|
13
|
+
left_and_ as _and__left,
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { a_nowrap_T } from '../a_nowrap/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* Returns function that returns first truthy item in `a_unwrap` or value.
|
|
4
|
+
*/
|
|
5
|
+
export declare function left_or_<
|
|
6
|
+
Val extends unknown = unknown
|
|
7
|
+
>(a_unwrap:a_nowrap_T<Val>):(val:Val)=>(Val|undefined)
|
|
8
|
+
export {
|
|
9
|
+
left_or_ as _left_or,
|
|
10
|
+
left_or_ as _or__left,
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { or } from '../or/index.js'
|
|
2
|
+
import { wrap_concat } from '../wrap_concat/index.js'
|
|
3
|
+
/**
|
|
4
|
+
* Returns function that returns first truthy item in `a_unwrap` or value.
|
|
5
|
+
* @param {import('../a_nowrap/index.js').a_nowrap_T}a_unwrap
|
|
6
|
+
* @returns {(val:unknown)=>unknown}
|
|
7
|
+
*/
|
|
8
|
+
export function left_or_(a_unwrap) {
|
|
9
|
+
return val=>or(wrap_concat(a_unwrap, val))
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
left_or_ as _left_or,
|
|
13
|
+
left_or_ as _or__left,
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { readable_stream_OR_reader_T } from '../readable_stream_OR_reader/index.js'
|
|
2
|
+
export declare function line__parse(
|
|
3
|
+
readable_stream_or_reader:readable_stream_OR_reader_T,
|
|
4
|
+
params?:line__parse__params_T
|
|
5
|
+
):AsyncIterable<string>
|
|
6
|
+
export declare function line__parse(
|
|
7
|
+
on_line:line_iterator__on_line_T,
|
|
8
|
+
readable_stream_or_reader:readable_stream_OR_reader_T,
|
|
9
|
+
params?:line__parse__params_T
|
|
10
|
+
):void
|
|
11
|
+
export {
|
|
12
|
+
line__parse as line_iterator_,
|
|
13
|
+
}
|
|
14
|
+
export interface line__parse__params_T {
|
|
15
|
+
include_line_separator?:boolean
|
|
16
|
+
text_decoder?:TextDecoder
|
|
17
|
+
}
|
|
18
|
+
export type line_iterator__on_line_T = (line:string)=>any
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** @typedef {import('../readable_stream_OR_reader/index.d.ts').readable_stream_OR_reader_T} */
|
|
2
|
+
/** @typedef {import('../line__parse/index.d.ts').line_iterator__on_line_T} */
|
|
3
|
+
/** @typedef {import('../line__parse/index.d.ts').line__parse__params_T} */
|
|
4
|
+
/**
|
|
5
|
+
* @param {line_iterator__on_line_T|readable_stream_OR_reader_T}on_line_or_readable_stream_or_reader
|
|
6
|
+
* @param {readable_stream_OR_reader_T|line__parse__params_T}[readable_stream_or_reader_or_params]
|
|
7
|
+
* @param {line__parse__params_T}[params]
|
|
8
|
+
* @returns {void|AsyncIterable<string>}
|
|
9
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/read#example_2_-_handling_text_line_by_line}
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
12
|
+
export function line__parse(
|
|
13
|
+
on_line_or_readable_stream_or_reader,
|
|
14
|
+
readable_stream_or_reader_or_params,
|
|
15
|
+
params
|
|
16
|
+
) {
|
|
17
|
+
const on_line =
|
|
18
|
+
typeof on_line_or_readable_stream_or_reader === 'function'
|
|
19
|
+
? on_line_or_readable_stream_or_reader
|
|
20
|
+
: null
|
|
21
|
+
/** @type {readable_stream_OR_reader_T} */
|
|
22
|
+
const readable_stream_or_reader =
|
|
23
|
+
on_line
|
|
24
|
+
? readable_stream_or_reader_or_params
|
|
25
|
+
: on_line_or_readable_stream_or_reader
|
|
26
|
+
if (!on_line) params = readable_stream_or_reader_or_params
|
|
27
|
+
const text_decoder =
|
|
28
|
+
params?.text_decoder
|
|
29
|
+
?? new TextDecoder('utf-8')
|
|
30
|
+
const include_line_separator =
|
|
31
|
+
params?.include_line_separator
|
|
32
|
+
?? false
|
|
33
|
+
return (
|
|
34
|
+
on_line
|
|
35
|
+
? line__parse__iterator_().next().then($=>$.value)
|
|
36
|
+
: line__parse__iterator_())
|
|
37
|
+
async function* line__parse__iterator_() {
|
|
38
|
+
/** @type {ReadableStreamDefaultReader|ReadableStreamBYOBReader} */
|
|
39
|
+
const reader =
|
|
40
|
+
(/** @type {ReadableStream} */readable_stream_or_reader).getReader
|
|
41
|
+
? (/** @type {ReadableStream} */readable_stream_or_reader).getReader()
|
|
42
|
+
: readable_stream_or_reader
|
|
43
|
+
let {
|
|
44
|
+
value: chunk,
|
|
45
|
+
done: readerDone
|
|
46
|
+
} = await reader.read()
|
|
47
|
+
chunk =
|
|
48
|
+
chunk
|
|
49
|
+
? chunk.byteLength
|
|
50
|
+
? text_decoder.decode(chunk, { stream: true })
|
|
51
|
+
: chunk
|
|
52
|
+
: ''
|
|
53
|
+
const re = /\r\n|\n|\r/gm
|
|
54
|
+
let startIndex = 0
|
|
55
|
+
for (; ;) {
|
|
56
|
+
let result = re.exec(chunk)
|
|
57
|
+
if (!result) {
|
|
58
|
+
if (readerDone) {
|
|
59
|
+
break
|
|
60
|
+
}
|
|
61
|
+
let remainder = chunk.substring(startIndex);
|
|
62
|
+
({ value: chunk, done: readerDone } = await reader.read())
|
|
63
|
+
chunk =
|
|
64
|
+
remainder
|
|
65
|
+
+ (
|
|
66
|
+
chunk
|
|
67
|
+
? chunk.byteLength
|
|
68
|
+
? text_decoder.decode(chunk, { stream: true })
|
|
69
|
+
: chunk
|
|
70
|
+
: '')
|
|
71
|
+
startIndex = re.lastIndex = 0
|
|
72
|
+
continue
|
|
73
|
+
}
|
|
74
|
+
const line = chunk.substring(
|
|
75
|
+
startIndex,
|
|
76
|
+
result.index + (include_line_separator ? result[0].length : 0))
|
|
77
|
+
if (on_line) {
|
|
78
|
+
on_line(line)
|
|
79
|
+
} else {
|
|
80
|
+
yield line
|
|
81
|
+
}
|
|
82
|
+
startIndex = re.lastIndex
|
|
83
|
+
}
|
|
84
|
+
if (startIndex < chunk.length) {
|
|
85
|
+
// last line didn't end in a newline char
|
|
86
|
+
let line = chunk.slice(startIndex)
|
|
87
|
+
if (on_line) {
|
|
88
|
+
on_line(line)
|
|
89
|
+
} else {
|
|
90
|
+
yield line
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
line__parse as line_iterator_,
|
|
97
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { test } from 'uvu'
|
|
2
|
+
import { equal } from 'uvu/assert'
|
|
3
|
+
import { line__parse } from '..//line__parse/index.js'
|
|
4
|
+
test('line__parse|!include_line_separator|callback', async ()=>{
|
|
5
|
+
const text_encoder = new TextEncoder()
|
|
6
|
+
const readable_stream = new ReadableStream({
|
|
7
|
+
start(controller) {
|
|
8
|
+
controller.enqueue(text_encoder.encode('foo\n'))
|
|
9
|
+
controller.enqueue('bar\nbaz\n')
|
|
10
|
+
controller.enqueue(text_encoder.encode('\n'))
|
|
11
|
+
},
|
|
12
|
+
pull(controller) {
|
|
13
|
+
controller.close()
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
const line_a:string[] = []
|
|
17
|
+
await line__parse(
|
|
18
|
+
line=>line_a.push(line),
|
|
19
|
+
readable_stream)
|
|
20
|
+
equal(line_a, [
|
|
21
|
+
'foo',
|
|
22
|
+
'bar',
|
|
23
|
+
'baz',
|
|
24
|
+
'',
|
|
25
|
+
])
|
|
26
|
+
})
|
|
27
|
+
test('line__parse|include_line_separator|callback', async ()=>{
|
|
28
|
+
const readable_stream = new ReadableStream({
|
|
29
|
+
start(controller) {
|
|
30
|
+
controller.enqueue('foo\n')
|
|
31
|
+
controller.enqueue('bar baz\r\n')
|
|
32
|
+
controller.enqueue('quux\r')
|
|
33
|
+
},
|
|
34
|
+
pull(controller) {
|
|
35
|
+
controller.close()
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
const line_a:string[] = []
|
|
39
|
+
await line__parse(
|
|
40
|
+
line=>line_a.push(line),
|
|
41
|
+
readable_stream,
|
|
42
|
+
{ include_line_separator: true })
|
|
43
|
+
equal(line_a, [
|
|
44
|
+
'foo\n',
|
|
45
|
+
'bar baz\r\n',
|
|
46
|
+
'quux\r',
|
|
47
|
+
])
|
|
48
|
+
})
|
|
49
|
+
test('line__parse|!include_line_separator|iterator', async ()=>{
|
|
50
|
+
const readable_stream = new ReadableStream({
|
|
51
|
+
start(controller) {
|
|
52
|
+
controller.enqueue('foo\n')
|
|
53
|
+
controller.enqueue('bar baz\n')
|
|
54
|
+
controller.enqueue('\n')
|
|
55
|
+
controller.enqueue(null)
|
|
56
|
+
},
|
|
57
|
+
pull(controller) {
|
|
58
|
+
controller.close()
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
const line_a:string[] = []
|
|
62
|
+
for await (const line of line__parse(readable_stream)) {
|
|
63
|
+
line_a.push(line)
|
|
64
|
+
}
|
|
65
|
+
equal(line_a, [
|
|
66
|
+
'foo',
|
|
67
|
+
'bar baz',
|
|
68
|
+
'',
|
|
69
|
+
])
|
|
70
|
+
})
|
|
71
|
+
test('line__parse|!include_line_separator|iterator', async ()=>{
|
|
72
|
+
const readable_stream = new ReadableStream({
|
|
73
|
+
start(controller) {
|
|
74
|
+
controller.enqueue('foo\n')
|
|
75
|
+
controller.enqueue('bar baz\n')
|
|
76
|
+
controller.enqueue('\n')
|
|
77
|
+
controller.enqueue(null)
|
|
78
|
+
},
|
|
79
|
+
pull(controller) {
|
|
80
|
+
controller.close()
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
const line_a:string[] = []
|
|
84
|
+
for await (const line of line__parse(
|
|
85
|
+
readable_stream,
|
|
86
|
+
{ include_line_separator: true }
|
|
87
|
+
)) {
|
|
88
|
+
line_a.push(line)
|
|
89
|
+
}
|
|
90
|
+
equal(line_a, [
|
|
91
|
+
'foo\n',
|
|
92
|
+
'bar baz\n',
|
|
93
|
+
'\n',
|
|
94
|
+
])
|
|
95
|
+
})
|
|
96
|
+
test.run()
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function line__transform_stream_(
|
|
2
|
+
params?:line__transform_stream___params_T,
|
|
3
|
+
writable_strategy?:QueuingStrategy<string>,
|
|
4
|
+
readable_strategy?:QueuingStrategy<string>
|
|
5
|
+
):TransformStream<string, string>
|
|
6
|
+
export interface line__transform_stream___params_T {
|
|
7
|
+
include_line_separator?:boolean
|
|
8
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/** @typedef {import('../line__transform_stream/index.d.ts').line__transform_stream___params_T} */
|
|
2
|
+
/**
|
|
3
|
+
* @param {line__transform_stream___params_T}[params]
|
|
4
|
+
* @param {QueuingStrategy<string>}[writable_strategy]
|
|
5
|
+
* @param {QueuingStrategy<string>}[readable_strategy]
|
|
6
|
+
* @returns {TransformStream<string, string>}
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
export function line__transform_stream_(
|
|
10
|
+
params = {},
|
|
11
|
+
writable_strategy,
|
|
12
|
+
readable_strategy,
|
|
13
|
+
) {
|
|
14
|
+
/** @type {string} */
|
|
15
|
+
let chunk = ''
|
|
16
|
+
const re = /\r\n|\n|\r/gm
|
|
17
|
+
return new TransformStream(
|
|
18
|
+
{
|
|
19
|
+
transform(
|
|
20
|
+
arg__chunk,
|
|
21
|
+
controller
|
|
22
|
+
) {
|
|
23
|
+
chunk += arg__chunk
|
|
24
|
+
let startIndex = 0
|
|
25
|
+
for (; ;) {
|
|
26
|
+
const result = re.exec(chunk)
|
|
27
|
+
if (!result) {
|
|
28
|
+
if (startIndex) {
|
|
29
|
+
chunk = chunk.substring(startIndex)
|
|
30
|
+
}
|
|
31
|
+
re.lastIndex = 0
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
const line =
|
|
35
|
+
chunk.substring(
|
|
36
|
+
startIndex,
|
|
37
|
+
result.index
|
|
38
|
+
+ (params.include_line_separator ? result[0].length : 0))
|
|
39
|
+
controller.enqueue(line)
|
|
40
|
+
startIndex = re.lastIndex
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
flush(controller) {
|
|
44
|
+
if (chunk.length) {
|
|
45
|
+
controller.enqueue(chunk)
|
|
46
|
+
chunk = ''
|
|
47
|
+
}
|
|
48
|
+
controller.terminate()
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
writable_strategy,
|
|
52
|
+
readable_strategy)
|
|
53
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { test } from 'uvu'
|
|
2
|
+
import { equal } from 'uvu/assert'
|
|
3
|
+
import { line__transform_stream_ } from '../line__transform_stream/index.js'
|
|
4
|
+
test('line__transform_stream_|!include_line_separator|callback', async ()=>{
|
|
5
|
+
const readable_stream = new ReadableStream({
|
|
6
|
+
start(controller) {
|
|
7
|
+
controller.enqueue('foo\n')
|
|
8
|
+
controller.enqueue('bar\nbaz\n')
|
|
9
|
+
controller.enqueue('\n')
|
|
10
|
+
},
|
|
11
|
+
pull(controller) {
|
|
12
|
+
controller.enqueue('last line')
|
|
13
|
+
controller.close()
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
const line__transform_stream = line__transform_stream_()
|
|
17
|
+
const reader = readable_stream.pipeThrough(line__transform_stream).getReader()
|
|
18
|
+
equal(await reader.read(), { value: 'foo', done: false })
|
|
19
|
+
equal(await reader.read(), { value: 'bar', done: false })
|
|
20
|
+
equal(await reader.read(), { value: 'baz', done: false })
|
|
21
|
+
equal(await reader.read(), { value: '', done: false })
|
|
22
|
+
equal(await reader.read(), { value: 'last line', done: false })
|
|
23
|
+
equal(await reader.read(), { value: undefined, done: true })
|
|
24
|
+
})
|
|
25
|
+
test('line__transform_stream_|include_line_separator|callback', async ()=>{
|
|
26
|
+
const readable_stream = new ReadableStream({
|
|
27
|
+
start(controller) {
|
|
28
|
+
controller.enqueue('foo\n')
|
|
29
|
+
controller.enqueue('bar baz\r\n')
|
|
30
|
+
controller.enqueue('quux\r')
|
|
31
|
+
},
|
|
32
|
+
pull(controller) {
|
|
33
|
+
controller.enqueue('last line')
|
|
34
|
+
controller.close()
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
const line__transform_stream = line__transform_stream_({
|
|
38
|
+
include_line_separator: true
|
|
39
|
+
})
|
|
40
|
+
const reader = readable_stream.pipeThrough(line__transform_stream).getReader()
|
|
41
|
+
equal(await reader.read(), { value: 'foo\n', done: false })
|
|
42
|
+
equal(await reader.read(), { value: 'bar baz\r\n', done: false })
|
|
43
|
+
equal(await reader.read(), { value: 'quux\r', done: false })
|
|
44
|
+
equal(await reader.read(), { value: 'last line', done: false })
|
|
45
|
+
equal(await reader.read(), { value: undefined, done: true })
|
|
46
|
+
})
|
|
47
|
+
test.run()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns Array of values `<= 0` in `val_a`.
|
|
3
|
+
* @param {number[]}val_a
|
|
4
|
+
* @returns {number[]}
|
|
5
|
+
*/
|
|
6
|
+
export function lte_0_a_(val_a) {
|
|
7
|
+
const lte_0_a = []
|
|
8
|
+
for (let i = 0; i < val_a.length; i++) {
|
|
9
|
+
const val = val_a[i]
|
|
10
|
+
if (val <= 0) {
|
|
11
|
+
lte_0_a.push(val)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return lte_0_a
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
lte_0_a_ as lte_0_a1_fn,
|
|
18
|
+
lte_0_a_ as _lte_0_a1,
|
|
19
|
+
lte_0_a_ as _a1__lte__0,
|
|
20
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { month_a } from '../month_a/index.js'
|
|
2
|
+
import { pad2 } from '../pad2/index.js'
|
|
3
|
+
/**
|
|
4
|
+
* @param {Date}[date]
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
export function MM_yyyy_(date) {
|
|
8
|
+
date = date || new Date()
|
|
9
|
+
return `${month_a[date.getMonth()]} ${date.getFullYear()}`
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
MM_yyyy_ as _MM_yyyy,
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @param {Date}[date]
|
|
16
|
+
* @returns {string}
|
|
17
|
+
*/
|
|
18
|
+
export function mm_yyyy_(date) {
|
|
19
|
+
date = date || new Date()
|
|
20
|
+
return `${pad2(date.getMonth() + 1)}/${date.getFullYear()}`
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
mm_yyyy_ as _mm_yyyy,
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { abbrev_month_a } from '../abbrev_month_a/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* @param {Date}[date]
|
|
4
|
+
* @returns {string}
|
|
5
|
+
*/
|
|
6
|
+
export function M_yyyy_(date) {
|
|
7
|
+
date = date || new Date()
|
|
8
|
+
return `${abbrev_month_a[date.getMonth()]} ${date.getFullYear()}`
|
|
9
|
+
}
|
|
10
|
+
export { M_yyyy_ as _M_yyyy, }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { andand_key__T } from '../andand/index.js'
|
|
2
|
+
export declare function many_andand_<
|
|
3
|
+
Val extends unknown = unknown
|
|
4
|
+
>(...name_a:(keyof Val|andand_key__T<Val>)[]):many_andand_T<Val>
|
|
5
|
+
export {
|
|
6
|
+
many_andand_ as _many_andand,
|
|
7
|
+
many_andand_ as _andand__many,
|
|
8
|
+
}
|
|
9
|
+
export declare type many_andand_T<
|
|
10
|
+
Val extends unknown = unknown
|
|
11
|
+
> = (obj:Val, ...arg_a:(keyof Val|andand_key__T<Val>)[])=>Val|null
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { andand } from '../andand/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* @param {string|import('../andand/index.js').andand_key_T}name_a
|
|
4
|
+
* @returns {import('#alll/many_andand/index.js').many_andand_T}
|
|
5
|
+
*/
|
|
6
|
+
export function many_andand_(...name_a) {
|
|
7
|
+
return (obj, ...arg_a)=>andand(obj, ...arg_a, ...name_a)
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
many_andand_ as _many_andand,
|
|
11
|
+
many_andand_ as _andand__many,
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { andand_key_T } from '../andand/index.js'
|
|
2
|
+
import type { andand_or_T } from '../andand_or/index.js'
|
|
3
|
+
export declare function many_andand_or_<
|
|
4
|
+
Val extends unknown = unknown,
|
|
5
|
+
Out extends unknown = unknown
|
|
6
|
+
>(
|
|
7
|
+
name_a:andand_key_T<Val>[], or_:andand_or_T<Val, Out>
|
|
8
|
+
):many_andand_or_T<Val, Out>
|
|
9
|
+
export declare type many_andand_or_T<
|
|
10
|
+
Val extends unknown = unknown,
|
|
11
|
+
Out extends unknown = unknown
|
|
12
|
+
> = (obj:Val, ...arg_a:andand_key_T<Val>[])=>Out
|
|
13
|
+
export {
|
|
14
|
+
many_andand_or_ as _many_andand_or,
|
|
15
|
+
many_andand_or_ as _andand_or__many,
|
|
16
|
+
many_andand_or_ as _andand__or__many,
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { andand_or } from '../andand_or/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* @param {import('../andand/index.js').andand_key_T}name_a
|
|
4
|
+
* @param {import('../andand_or/index.js').andand_or_T}or_
|
|
5
|
+
* @returns {import('../many_andand_or/index.d.ts').many_andand_or_T}
|
|
6
|
+
*/
|
|
7
|
+
export function many_andand_or_(name_a, or_) {
|
|
8
|
+
return (obj, ...arg_a)=>andand_or(obj, arg_a.concat(name_a), or_)
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
many_andand_or_ as _many_andand_or,
|
|
12
|
+
many_andand_or_ as _andand_or__many,
|
|
13
|
+
many_andand_or_ as _andand__or__many,
|
|
14
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { map_fn_T } from '../map_fn/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* Map return value of `fn(a[], i)` into an Array.
|
|
4
|
+
*/
|
|
5
|
+
export declare function map<
|
|
6
|
+
Val extends unknown = unknown,
|
|
7
|
+
Out extends unknown = unknown
|
|
8
|
+
>(
|
|
9
|
+
a:readonly Val[],
|
|
10
|
+
fn:map_fn_T<Val, Out>
|
|
11
|
+
):Out[]
|
|
12
|
+
export declare function maybe_map<
|
|
13
|
+
Val extends unknown,
|
|
14
|
+
Out extends unknown,
|
|
15
|
+
Or = null
|
|
16
|
+
>(
|
|
17
|
+
maybe_a:readonly Val[]|undefined,
|
|
18
|
+
fn:map_fn_T<Val, Out>,
|
|
19
|
+
or?:Or
|
|
20
|
+
):Out[]|Or
|
|
21
|
+
/**
|
|
22
|
+
* Returns Function returning [map](#map) with `fn`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function map_<
|
|
25
|
+
I extends unknown = unknown,
|
|
26
|
+
O extends unknown = unknown
|
|
27
|
+
>(
|
|
28
|
+
fn:(val:I, idx:number)=>O
|
|
29
|
+
):(a:readonly I[])=>O[]
|
|
30
|
+
export declare function maybe_map_<
|
|
31
|
+
I extends unknown = unknown,
|
|
32
|
+
O extends unknown = unknown,
|
|
33
|
+
Or = null
|
|
34
|
+
>(
|
|
35
|
+
fn:(val:I, idx:number)=>O,
|
|
36
|
+
or?:Or
|
|
37
|
+
):(a:readonly I[]|undefined)=>O[]|Or
|
|
38
|
+
export {
|
|
39
|
+
map_ as _map,
|
|
40
|
+
map_ as _fn__map,
|
|
41
|
+
maybe_map_ as _maybe_map,
|
|
42
|
+
}
|
package/all/map/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** @typedef {import('../index.d.ts').map_fn_T}map_fn_T */
|
|
2
|
+
/**
|
|
3
|
+
* Map return value of `fn(a[], i)` into an Array.
|
|
4
|
+
* @param {unknown[]}a
|
|
5
|
+
* @param {map_fn_T}fn
|
|
6
|
+
* @returns {unknown[]}
|
|
7
|
+
*/
|
|
8
|
+
export function map(a, fn) {
|
|
9
|
+
const out_a = []
|
|
10
|
+
for (let i = 0; i < a.length; i++) {
|
|
11
|
+
out_a.push(fn(a[i], i))
|
|
12
|
+
}
|
|
13
|
+
return out_a
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @param {unknown[]|undefined}maybe_a
|
|
17
|
+
* @param {fnmap_fn_T}fn
|
|
18
|
+
* @param {unknown[]|null|undefined}or
|
|
19
|
+
* @returns {unknown[]|null|undefined}
|
|
20
|
+
*/
|
|
21
|
+
export function maybe_map(maybe_a, fn, or = null) {
|
|
22
|
+
if (!maybe_a) return or
|
|
23
|
+
return maybe_a?.map(fn)
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns Function returning [map](#map) with `fn`.
|
|
27
|
+
* @param {(val:unknown, idx:number)=>unknown}fn
|
|
28
|
+
* @returns {(a:unknown[])=>unknown[]}
|
|
29
|
+
*/
|
|
30
|
+
export function map_(fn) {
|
|
31
|
+
return a=>a.map(fn)
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @param {(val:unknown, idx:number)=>unknown}fn
|
|
35
|
+
* @param {unknown[]|null|undefined}or
|
|
36
|
+
* @returns {(a:unknown[]|undefined)=>unknown[]|null|undefined}
|
|
37
|
+
*/
|
|
38
|
+
export function maybe_map_(fn, or = null) {
|
|
39
|
+
return a=>a ? a.map(fn) : or
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
map_ as _map,
|
|
43
|
+
map_ as _fn__map,
|
|
44
|
+
maybe_map_ as _maybe_map,
|
|
45
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { andand_key_T } from '../andand/index.js'
|
|
2
|
+
/**
|
|
3
|
+
* Returns Array of mapped `a` with `_andand(...name_a)`.
|
|
4
|
+
*/
|
|
5
|
+
export declare function map_andand<
|
|
6
|
+
In extends unknown = unknown, Out extends unknown = unknown
|
|
7
|
+
>(
|
|
8
|
+
a:readonly In[],
|
|
9
|
+
...name_a:readonly andand_key_T<In>[]
|
|
10
|
+
):Out[]
|
|
11
|
+
export declare function maybe_map_andand<
|
|
12
|
+
Val extends unknown, Out extends unknown
|
|
13
|
+
>(
|
|
14
|
+
a:readonly Val[]|undefined,
|
|
15
|
+
...name_a:readonly andand_key_T<Val>[]
|
|
16
|
+
):Out[]|undefined
|
|
17
|
+
export { map_andand as map__andand, }
|
|
18
|
+
/**
|
|
19
|
+
* Returns function that returns value from [map_andand](#map_andand) with `...attr_a`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function map_andand_<
|
|
22
|
+
In extends unknown, Out extends unknown
|
|
23
|
+
>(
|
|
24
|
+
...attr_a:readonly andand_key_T<In>[]
|
|
25
|
+
):(a:readonly In[])=>Out[]
|
|
26
|
+
export {
|
|
27
|
+
map_andand_ as _map_andand,
|
|
28
|
+
map_andand_ as _map__andand,
|
|
29
|
+
map_andand_ as _fn__map__andand,
|
|
30
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { andand } from '../andand/index.js'
|
|
2
|
+
import { andand_ } from '../one_andand/index.js'
|
|
3
|
+
/** @typedef {import('../andand/index.d.ts').andand_key_T} */
|
|
4
|
+
/**
|
|
5
|
+
* Returns Array of mapped `a` with `andand_(...name_a)`.
|
|
6
|
+
* @param {unknown[]}a
|
|
7
|
+
* @param {andand_key_T}name_a
|
|
8
|
+
* @returns {unknown[]}
|
|
9
|
+
*/
|
|
10
|
+
export function map_andand(a, ...name_a) {
|
|
11
|
+
return a.map(item=>andand(item, ...name_a))
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @param {unknown[]|undefined}a
|
|
15
|
+
* @param {andand_key_T}name_a
|
|
16
|
+
* @returns {unknown[]|undefined}
|
|
17
|
+
*/
|
|
18
|
+
export function maybe_map_andand(a, ...name_a) {
|
|
19
|
+
return a?.map(andand_(...name_a))
|
|
20
|
+
}
|
|
21
|
+
export { map_andand as map__andand, }
|
|
22
|
+
/**
|
|
23
|
+
* Returns function that returns value from [map_andand](#map_andand) with `...attr_a`.
|
|
24
|
+
* @param {andand_key_T}attr_a
|
|
25
|
+
* @returns {(a:unknown[])=>unknown[]}
|
|
26
|
+
*/
|
|
27
|
+
export function map_andand_(...attr_a) {
|
|
28
|
+
return a=>map_andand(a, ...attr_a)
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
map_andand_ as _map_andand,
|
|
32
|
+
map_andand_ as _map__andand,
|
|
33
|
+
map_andand_ as _fn__map__andand,
|
|
34
|
+
}
|