structured-outputs 0.1.0-beta.2 → 0.1.0-beta.21
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +77 -6
- package/esm/ResponseFormat.d.ts +18 -11
- package/esm/ResponseFormat.d.ts.map +1 -1
- package/esm/ResponseFormat.js +57 -5
- package/esm/ResponseFormat.js.map +1 -1
- package/esm/Tool.d.ts +13 -0
- package/esm/Tool.d.ts.map +1 -0
- package/esm/Tool.js +17 -0
- package/esm/Tool.js.map +1 -0
- package/esm/_dnt.polyfills.d.ts +12 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -0
- package/esm/_dnt.polyfills.js +16 -0
- package/esm/_dnt.polyfills.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/_utils.d.ts +6 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/_utils.js +19 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/_utils.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.d.ts +41 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.js +51 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_by.d.ts +37 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_by.js +45 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_with.d.ts +33 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_with.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_with.js +41 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/associate_with.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/chunk.d.ts +38 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/chunk.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/chunk.js +51 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/chunk.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/deep_merge.d.ts +322 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/deep_merge.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/deep_merge.js +96 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/deep_merge.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct.d.ts +23 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct.js +28 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct_by.d.ts +26 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct_by.js +39 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/distinct_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_last_while.d.ts +26 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_last_while.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_last_while.js +33 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_last_while.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_while.d.ts +25 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_while.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_while.js +34 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/drop_while.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_entries.d.ts +32 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_entries.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_entries.js +43 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_entries.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_keys.d.ts +36 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_keys.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_keys.js +46 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_keys.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_values.d.ts +35 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_values.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_values.js +46 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/filter_values.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/find_single.d.ts +31 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/find_single.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/find_single.js +45 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/find_single.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.d.ts +32 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.js +42 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/includes_value.d.ts +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/includes_value.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/includes_value.js +39 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/includes_value.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/intersect.d.ts +25 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/intersect.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/intersect.js +36 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/intersect.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert.d.ts +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert.js +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert_by.d.ts +34 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert_by.js +46 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/invert_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/join_to_string.d.ts +75 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/join_to_string.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/join_to_string.js +59 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/join_to_string.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_entries.d.ts +37 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_entries.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_entries.js +47 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_entries.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_keys.d.ts +33 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_keys.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_keys.js +42 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_keys.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.d.ts +32 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.js +43 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_values.d.ts +71 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_values.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_values.js +13 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/map_values.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_by.d.ts +117 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_by.js +15 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_of.d.ts +61 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_of.js +17 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_with.d.ts +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_with.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_with.js +41 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/max_with.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_by.d.ts +115 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_by.js +15 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_of.d.ts +61 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_of.js +17 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_with.d.ts +25 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_with.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_with.js +37 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/min_with.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/mod.d.ts +73 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/mod.js +75 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/mod.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/omit.d.ts +24 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/omit.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/omit.js +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/omit.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition.d.ts +60 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition.js +16 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition_entries.d.ts +39 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition_entries.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition_entries.js +54 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/partition_entries.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/permutations.d.ts +27 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/permutations.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/permutations.js +58 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/permutations.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/pick.d.ts +25 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/pick.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/pick.js +33 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/pick.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/reduce_groups.d.ts +35 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/reduce_groups.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/reduce_groups.js +40 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/reduce_groups.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/running_reduce.d.ts +27 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/running_reduce.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/running_reduce.js +32 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/running_reduce.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sample.d.ts +24 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sample.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sample.js +35 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sample.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sliding_windows.d.ts +66 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sliding_windows.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sliding_windows.js +57 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sliding_windows.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sort_by.d.ts +161 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sort_by.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sort_by.js +30 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sort_by.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sum_of.d.ts +29 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sum_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sum_of.js +37 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/sum_of.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_last_while.d.ts +27 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_last_while.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_last_while.js +34 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_last_while.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_while.d.ts +30 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_while.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_while.js +39 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/take_while.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/union.d.ts +24 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/union.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/union.js +34 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/union.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/unzip.d.ts +32 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/unzip.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/unzip.js +46 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/unzip.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/without_all.d.ts +23 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/without_all.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/without_all.js +28 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/without_all.js.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/zip.d.ts +34 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/zip.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/zip.js +43 -0
- package/esm/deps/jsr.io/@std/collections/1.0.9/zip.js.map +1 -0
- package/esm/mod.d.ts +3 -14
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +3 -10
- package/esm/mod.js.map +1 -1
- package/esm/oai.d.ts +5 -0
- package/esm/oai.d.ts.map +1 -0
- package/esm/oai.js +2 -0
- package/esm/oai.js.map +1 -0
- package/esm/types/Ref.d.ts +4 -0
- package/esm/types/Ref.d.ts.map +1 -0
- package/esm/types/Ref.js +11 -0
- package/esm/types/Ref.js.map +1 -0
- package/esm/types/RootTy.d.ts +8 -0
- package/esm/types/RootTy.d.ts.map +1 -0
- package/esm/types/RootTy.js +19 -0
- package/esm/types/RootTy.js.map +1 -0
- package/esm/types/Ty.d.ts +27 -0
- package/esm/types/Ty.d.ts.map +1 -0
- package/esm/types/Ty.js +17 -0
- package/esm/types/Ty.js.map +1 -0
- package/esm/types/array.d.ts +3 -0
- package/esm/types/array.d.ts.map +1 -0
- package/esm/types/array.js +9 -0
- package/esm/types/array.js.map +1 -0
- package/esm/types/constant.d.ts +3 -0
- package/esm/types/constant.d.ts.map +1 -0
- package/esm/types/constant.js +8 -0
- package/esm/types/constant.js.map +1 -0
- package/esm/types/constantUnion.d.ts +3 -0
- package/esm/types/constantUnion.d.ts.map +1 -0
- package/esm/types/constantUnion.js +25 -0
- package/esm/types/constantUnion.js.map +1 -0
- package/esm/types/leaves.d.ts +6 -0
- package/esm/types/leaves.d.ts.map +1 -0
- package/esm/types/leaves.js +18 -0
- package/esm/types/leaves.js.map +1 -0
- package/esm/types/mod.d.ts +11 -0
- package/esm/types/mod.d.ts.map +1 -0
- package/esm/types/mod.js +11 -0
- package/esm/types/mod.js.map +1 -0
- package/esm/types/object.d.ts +6 -0
- package/esm/types/object.d.ts.map +1 -0
- package/esm/{object.js → types/object.js} +4 -4
- package/esm/types/object.js.map +1 -0
- package/esm/types/std/Option.d.ts +7 -0
- package/esm/types/std/Option.d.ts.map +1 -0
- package/esm/types/std/Option.js +9 -0
- package/esm/types/std/Option.js.map +1 -0
- package/esm/types/std/Wrapper.d.ts +7 -0
- package/esm/types/std/Wrapper.d.ts.map +1 -0
- package/esm/types/std/Wrapper.js +5 -0
- package/esm/types/std/Wrapper.js.map +1 -0
- package/esm/types/std/mod.d.ts +3 -0
- package/esm/types/std/mod.d.ts.map +1 -0
- package/esm/types/std/mod.js +3 -0
- package/esm/types/std/mod.js.map +1 -0
- package/esm/types/taggedUnion.d.ts +8 -0
- package/esm/types/taggedUnion.d.ts.map +1 -0
- package/esm/types/taggedUnion.js +20 -0
- package/esm/types/taggedUnion.js.map +1 -0
- package/esm/util/phantoms.d.ts +2 -0
- package/esm/util/phantoms.d.ts.map +1 -0
- package/esm/util/phantoms.js +4 -0
- package/esm/util/phantoms.js.map +1 -0
- package/esm/util/recombineTaggedTemplateArgs.d.ts +2 -0
- package/esm/util/recombineTaggedTemplateArgs.d.ts.map +1 -0
- package/esm/util/recombineTaggedTemplateArgs.js +4 -0
- package/esm/util/recombineTaggedTemplateArgs.js.map +1 -0
- package/package.json +7 -9
- package/src/ResponseFormat.ts +80 -22
- package/src/Tool.ts +38 -0
- package/src/_dnt.polyfills.ts +27 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/_utils.ts +26 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/aggregate_groups.ts +62 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/associate_by.ts +50 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/associate_with.ts +46 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/chunk.ts +56 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/deep_merge.ts +578 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/distinct.ts +29 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/distinct_by.ts +42 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/drop_last_while.ts +36 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/drop_while.ts +39 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/filter_entries.ts +48 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/filter_keys.ts +51 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/filter_values.ts +51 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/find_single.ts +48 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/first_not_nullish_of.ts +47 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/includes_value.ts +45 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/intersect.ts +35 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/invert.ts +38 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/invert_by.ts +56 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/join_to_string.ts +109 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/map_entries.ts +53 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/map_keys.ts +47 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/map_not_nullish.ts +49 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/map_values.ts +96 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/max_by.ts +153 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/max_of.ts +90 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/max_with.ts +46 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/min_by.ts +151 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/min_of.ts +90 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/min_with.ts +42 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/mod.ts +76 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/omit.ts +34 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/partition.ts +85 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/partition_entries.ts +58 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/permutations.ts +66 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/pick.ts +34 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/reduce_groups.ts +45 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/running_reduce.ts +38 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/sample.ts +36 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/sliding_windows.ts +86 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/sort_by.ts +219 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/sum_of.ts +42 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/take_last_while.ts +37 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/take_while.ts +44 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/union.ts +36 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/unzip.ts +50 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/without_all.ts +28 -0
- package/src/deps/jsr.io/@std/collections/1.0.9/zip.ts +49 -0
- package/src/mod.ts +3 -18
- package/src/oai.ts +5 -0
- package/src/types/Ref.ts +16 -0
- package/src/types/RootTy.ts +40 -0
- package/src/types/Ty.ts +57 -0
- package/src/types/array.ts +9 -0
- package/src/types/constant.ts +8 -0
- package/src/types/constantUnion.ts +27 -0
- package/src/types/leaves.ts +21 -0
- package/src/types/mod.ts +10 -0
- package/src/types/object.ts +15 -0
- package/src/types/std/Option.ts +15 -0
- package/src/types/std/Wrapper.ts +8 -0
- package/src/types/std/mod.ts +2 -0
- package/src/types/taggedUnion.ts +28 -0
- package/src/util/phantoms.ts +3 -0
- package/src/util/recombineTaggedTemplateArgs.ts +6 -0
- package/esm/F.d.ts +0 -13
- package/esm/F.d.ts.map +0 -1
- package/esm/F.js +0 -10
- package/esm/F.js.map +0 -1
- package/esm/_base.d.ts +0 -13
- package/esm/_base.d.ts.map +0 -1
- package/esm/_base.js +0 -40
- package/esm/_base.js.map +0 -1
- package/esm/array.d.ts +0 -4
- package/esm/array.d.ts.map +0 -1
- package/esm/array.js +0 -9
- package/esm/array.js.map +0 -1
- package/esm/common.d.ts +0 -6
- package/esm/common.d.ts.map +0 -1
- package/esm/common.js +0 -2
- package/esm/common.js.map +0 -1
- package/esm/literal.d.ts +0 -4
- package/esm/literal.d.ts.map +0 -1
- package/esm/literal.js +0 -8
- package/esm/literal.js.map +0 -1
- package/esm/number.d.ts +0 -4
- package/esm/number.d.ts.map +0 -1
- package/esm/number.js +0 -8
- package/esm/number.js.map +0 -1
- package/esm/object.d.ts +0 -7
- package/esm/object.d.ts.map +0 -1
- package/esm/object.js.map +0 -1
- package/esm/schema.d.ts +0 -4
- package/esm/schema.d.ts.map +0 -1
- package/esm/schema.js +0 -9
- package/esm/schema.js.map +0 -1
- package/esm/string.d.ts +0 -4
- package/esm/string.d.ts.map +0 -1
- package/esm/string.js +0 -8
- package/esm/string.js.map +0 -1
- package/esm/union.d.ts +0 -6
- package/esm/union.d.ts.map +0 -1
- package/esm/union.js +0 -8
- package/esm/union.js.map +0 -1
- package/src/F.ts +0 -27
- package/src/_base.ts +0 -25
- package/src/array.ts +0 -11
- package/src/common.ts +0 -6
- package/src/literal.ts +0 -10
- package/src/number.ts +0 -10
- package/src/object.ts +0 -17
- package/src/schema.ts +0 -10
- package/src/string.ts +0 -10
- package/src/union.ts +0 -12
@@ -0,0 +1,37 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
// This module is browser compatible.
|
3
|
+
/**
|
4
|
+
* Returns the first element having the smallest value according to the provided
|
5
|
+
* comparator or undefined if there are no elements.
|
6
|
+
*
|
7
|
+
* @typeParam T The type of the elements in the array.
|
8
|
+
*
|
9
|
+
* @param array The array to find the minimum element in.
|
10
|
+
* @param comparator The function to compare elements.
|
11
|
+
*
|
12
|
+
* @returns The first element that is the smallest value of the given function
|
13
|
+
* or undefined if there are no elements.
|
14
|
+
*
|
15
|
+
* @example Basic usage
|
16
|
+
* ```ts
|
17
|
+
* import { minWith } from "@std/collections/min-with";
|
18
|
+
* import { assertEquals } from "@std/assert";
|
19
|
+
*
|
20
|
+
* const people = ["Kim", "Anna", "John"];
|
21
|
+
* const smallestName = minWith(people, (a, b) => a.length - b.length);
|
22
|
+
*
|
23
|
+
* assertEquals(smallestName, "Kim");
|
24
|
+
* ```
|
25
|
+
*/
|
26
|
+
export function minWith(array, comparator) {
|
27
|
+
let min;
|
28
|
+
let isFirst = true;
|
29
|
+
for (const current of array) {
|
30
|
+
if (isFirst || comparator(current, min) < 0) {
|
31
|
+
min = current;
|
32
|
+
isFirst = false;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
return min;
|
36
|
+
}
|
37
|
+
//# sourceMappingURL=min_with.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"min_with.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/min_with.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AAErC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,OAAO,CACrB,KAAkB,EAClB,UAAkC;IAElC,IAAI,GAAkB,CAAC;IACvB,IAAI,OAAO,GAAG,IAAI,CAAC;IAEnB,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,CAAC;QAC5B,IAAI,OAAO,IAAI,UAAU,CAAC,OAAO,EAAM,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YAChD,GAAG,GAAG,OAAO,CAAC;YACd,OAAO,GAAG,KAAK,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
/**
|
2
|
+
* Pure functions for common tasks around collection types like arrays and
|
3
|
+
* objects.
|
4
|
+
*
|
5
|
+
* Inspired by
|
6
|
+
* {@link https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/ | Kotlin's Collections}
|
7
|
+
* package and {@link https://lodash.com/ | Lodash}.
|
8
|
+
*
|
9
|
+
* ```ts
|
10
|
+
* import { intersect, sample, pick } from "@std/collections";
|
11
|
+
* import { assertEquals, assertArrayIncludes } from "@std/assert";
|
12
|
+
*
|
13
|
+
* const lisaInterests = ["Cooking", "Music", "Hiking"];
|
14
|
+
* const kimInterests = ["Music", "Tennis", "Cooking"];
|
15
|
+
*
|
16
|
+
* assertEquals(intersect(lisaInterests, kimInterests), ["Cooking", "Music"]);
|
17
|
+
*
|
18
|
+
* assertArrayIncludes(lisaInterests, [sample(lisaInterests)]);
|
19
|
+
*
|
20
|
+
* const cat = { name: "Lulu", age: 3, breed: "Ragdoll" };
|
21
|
+
*
|
22
|
+
* assertEquals(pick(cat, ["name", "breed"]), { name: "Lulu", breed: "Ragdoll"});
|
23
|
+
* ```
|
24
|
+
*
|
25
|
+
* @module
|
26
|
+
*/
|
27
|
+
export * from "./aggregate_groups.js";
|
28
|
+
export * from "./associate_by.js";
|
29
|
+
export * from "./associate_with.js";
|
30
|
+
export * from "./chunk.js";
|
31
|
+
export * from "./deep_merge.js";
|
32
|
+
export * from "./distinct.js";
|
33
|
+
export * from "./distinct_by.js";
|
34
|
+
export * from "./drop_last_while.js";
|
35
|
+
export * from "./drop_while.js";
|
36
|
+
export * from "./filter_entries.js";
|
37
|
+
export * from "./filter_keys.js";
|
38
|
+
export * from "./filter_values.js";
|
39
|
+
export * from "./find_single.js";
|
40
|
+
export * from "./first_not_nullish_of.js";
|
41
|
+
export * from "./includes_value.js";
|
42
|
+
export * from "./intersect.js";
|
43
|
+
export * from "./invert_by.js";
|
44
|
+
export * from "./invert.js";
|
45
|
+
export * from "./join_to_string.js";
|
46
|
+
export * from "./map_entries.js";
|
47
|
+
export * from "./map_keys.js";
|
48
|
+
export * from "./map_not_nullish.js";
|
49
|
+
export * from "./map_values.js";
|
50
|
+
export * from "./max_by.js";
|
51
|
+
export * from "./max_of.js";
|
52
|
+
export * from "./max_with.js";
|
53
|
+
export * from "./min_by.js";
|
54
|
+
export * from "./min_of.js";
|
55
|
+
export * from "./min_with.js";
|
56
|
+
export * from "./omit.js";
|
57
|
+
export * from "./partition.js";
|
58
|
+
export * from "./partition_entries.js";
|
59
|
+
export * from "./permutations.js";
|
60
|
+
export * from "./pick.js";
|
61
|
+
export * from "./reduce_groups.js";
|
62
|
+
export * from "./running_reduce.js";
|
63
|
+
export * from "./sample.js";
|
64
|
+
export * from "./sliding_windows.js";
|
65
|
+
export * from "./sort_by.js";
|
66
|
+
export * from "./sum_of.js";
|
67
|
+
export * from "./take_last_while.js";
|
68
|
+
export * from "./take_while.js";
|
69
|
+
export * from "./union.js";
|
70
|
+
export * from "./unzip.js";
|
71
|
+
export * from "./without_all.js";
|
72
|
+
export * from "./zip.js";
|
73
|
+
//# sourceMappingURL=mod.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC"}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
// This module is browser compatible.
|
3
|
+
/**
|
4
|
+
* Pure functions for common tasks around collection types like arrays and
|
5
|
+
* objects.
|
6
|
+
*
|
7
|
+
* Inspired by
|
8
|
+
* {@link https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/ | Kotlin's Collections}
|
9
|
+
* package and {@link https://lodash.com/ | Lodash}.
|
10
|
+
*
|
11
|
+
* ```ts
|
12
|
+
* import { intersect, sample, pick } from "@std/collections";
|
13
|
+
* import { assertEquals, assertArrayIncludes } from "@std/assert";
|
14
|
+
*
|
15
|
+
* const lisaInterests = ["Cooking", "Music", "Hiking"];
|
16
|
+
* const kimInterests = ["Music", "Tennis", "Cooking"];
|
17
|
+
*
|
18
|
+
* assertEquals(intersect(lisaInterests, kimInterests), ["Cooking", "Music"]);
|
19
|
+
*
|
20
|
+
* assertArrayIncludes(lisaInterests, [sample(lisaInterests)]);
|
21
|
+
*
|
22
|
+
* const cat = { name: "Lulu", age: 3, breed: "Ragdoll" };
|
23
|
+
*
|
24
|
+
* assertEquals(pick(cat, ["name", "breed"]), { name: "Lulu", breed: "Ragdoll"});
|
25
|
+
* ```
|
26
|
+
*
|
27
|
+
* @module
|
28
|
+
*/
|
29
|
+
export * from "./aggregate_groups.js";
|
30
|
+
export * from "./associate_by.js";
|
31
|
+
export * from "./associate_with.js";
|
32
|
+
export * from "./chunk.js";
|
33
|
+
export * from "./deep_merge.js";
|
34
|
+
export * from "./distinct.js";
|
35
|
+
export * from "./distinct_by.js";
|
36
|
+
export * from "./drop_last_while.js";
|
37
|
+
export * from "./drop_while.js";
|
38
|
+
export * from "./filter_entries.js";
|
39
|
+
export * from "./filter_keys.js";
|
40
|
+
export * from "./filter_values.js";
|
41
|
+
export * from "./find_single.js";
|
42
|
+
export * from "./first_not_nullish_of.js";
|
43
|
+
export * from "./includes_value.js";
|
44
|
+
export * from "./intersect.js";
|
45
|
+
export * from "./invert_by.js";
|
46
|
+
export * from "./invert.js";
|
47
|
+
export * from "./join_to_string.js";
|
48
|
+
export * from "./map_entries.js";
|
49
|
+
export * from "./map_keys.js";
|
50
|
+
export * from "./map_not_nullish.js";
|
51
|
+
export * from "./map_values.js";
|
52
|
+
export * from "./max_by.js";
|
53
|
+
export * from "./max_of.js";
|
54
|
+
export * from "./max_with.js";
|
55
|
+
export * from "./min_by.js";
|
56
|
+
export * from "./min_of.js";
|
57
|
+
export * from "./min_with.js";
|
58
|
+
export * from "./omit.js";
|
59
|
+
export * from "./partition.js";
|
60
|
+
export * from "./partition_entries.js";
|
61
|
+
export * from "./permutations.js";
|
62
|
+
export * from "./pick.js";
|
63
|
+
export * from "./reduce_groups.js";
|
64
|
+
export * from "./running_reduce.js";
|
65
|
+
export * from "./sample.js";
|
66
|
+
export * from "./sliding_windows.js";
|
67
|
+
export * from "./sort_by.js";
|
68
|
+
export * from "./sum_of.js";
|
69
|
+
export * from "./take_last_while.js";
|
70
|
+
export * from "./take_while.js";
|
71
|
+
export * from "./union.js";
|
72
|
+
export * from "./unzip.js";
|
73
|
+
export * from "./without_all.js";
|
74
|
+
export * from "./zip.js";
|
75
|
+
//# sourceMappingURL=mod.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/mod.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**
|
2
|
+
* Creates a new object by excluding the specified keys from the provided object.
|
3
|
+
*
|
4
|
+
* @typeParam T The type of the object.
|
5
|
+
* @typeParam K The type of the keys to omit.
|
6
|
+
*
|
7
|
+
* @param obj The object to omit keys from.
|
8
|
+
* @param keys The keys to omit from the object.
|
9
|
+
*
|
10
|
+
* @returns A new object with the specified keys omitted.
|
11
|
+
*
|
12
|
+
* @example Basic usage
|
13
|
+
* ```ts
|
14
|
+
* import { omit } from "@std/collections/omit";
|
15
|
+
* import { assertEquals } from "@std/assert";
|
16
|
+
*
|
17
|
+
* const obj = { a: 5, b: 6, c: 7, d: 8 };
|
18
|
+
* const omitted = omit(obj, ["a", "c"]);
|
19
|
+
*
|
20
|
+
* assertEquals(omitted, { b: 6, d: 8 });
|
21
|
+
* ```
|
22
|
+
*/
|
23
|
+
export declare function omit<T extends object, K extends keyof T>(obj: Readonly<T>, keys: readonly K[]): Omit<T, K>;
|
24
|
+
//# sourceMappingURL=omit.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"omit.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/omit.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EACtD,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,SAAS,CAAC,EAAE,GACjB,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAKZ"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
// This module is browser compatible.
|
3
|
+
/**
|
4
|
+
* Creates a new object by excluding the specified keys from the provided object.
|
5
|
+
*
|
6
|
+
* @typeParam T The type of the object.
|
7
|
+
* @typeParam K The type of the keys to omit.
|
8
|
+
*
|
9
|
+
* @param obj The object to omit keys from.
|
10
|
+
* @param keys The keys to omit from the object.
|
11
|
+
*
|
12
|
+
* @returns A new object with the specified keys omitted.
|
13
|
+
*
|
14
|
+
* @example Basic usage
|
15
|
+
* ```ts
|
16
|
+
* import { omit } from "@std/collections/omit";
|
17
|
+
* import { assertEquals } from "@std/assert";
|
18
|
+
*
|
19
|
+
* const obj = { a: 5, b: 6, c: 7, d: 8 };
|
20
|
+
* const omitted = omit(obj, ["a", "c"]);
|
21
|
+
*
|
22
|
+
* assertEquals(omitted, { b: 6, d: 8 });
|
23
|
+
* ```
|
24
|
+
*/
|
25
|
+
export function omit(obj, keys) {
|
26
|
+
const excludes = new Set(keys);
|
27
|
+
return Object.fromEntries(Object.entries(obj).filter(([k, _]) => !excludes.has(k)));
|
28
|
+
}
|
29
|
+
//# sourceMappingURL=omit.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"omit.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/omit.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AAErC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,IAAI,CAClB,GAAgB,EAChB,IAAkB;IAElB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAM,CAAC,CAAC,CAChD,CAAC;AAClB,CAAC"}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
/**
|
2
|
+
* Returns a tuple of two arrays with the first one containing all elements in
|
3
|
+
* the given array that match the given predicate and the second one containing
|
4
|
+
* all that do not.
|
5
|
+
*
|
6
|
+
* @typeParam T The type of the elements in the array.
|
7
|
+
*
|
8
|
+
* @param array The array to partition.
|
9
|
+
* @param predicate The predicate function to determine which array an element
|
10
|
+
* belongs to.
|
11
|
+
*
|
12
|
+
* @returns A tuple of two arrays. The first array contains all elements that
|
13
|
+
* match the predicate, the second contains all elements that do not.
|
14
|
+
*
|
15
|
+
* @example Basic usage
|
16
|
+
* ```ts
|
17
|
+
* import { partition } from "@std/collections/partition";
|
18
|
+
* import { assertEquals } from "@std/assert";
|
19
|
+
*
|
20
|
+
* const numbers = [5, 6, 7, 8, 9];
|
21
|
+
* const [even, odd] = partition(numbers, (it) => it % 2 === 0);
|
22
|
+
*
|
23
|
+
* assertEquals(even, [6, 8]);
|
24
|
+
* assertEquals(odd, [5, 7, 9]);
|
25
|
+
* ```
|
26
|
+
*/
|
27
|
+
export declare function partition<T>(array: Iterable<T>, predicate: (el: T) => boolean): [T[], T[]];
|
28
|
+
/**
|
29
|
+
* Returns a tuple of two arrays with the first one containing all elements in
|
30
|
+
* the given array that match the given predicate and the second one containing
|
31
|
+
* all that do not.
|
32
|
+
*
|
33
|
+
* This version of the function is a type-guard version of the function. It
|
34
|
+
* allows you to specify a type-guard predicate function that narrows the type
|
35
|
+
* of the elements in the array.
|
36
|
+
*
|
37
|
+
* @typeParam T The type of the elements in the array.
|
38
|
+
* @typeParam U The type of the elements that match the predicate.
|
39
|
+
*
|
40
|
+
* @param array The array to partition.
|
41
|
+
* @param predicate The type-guard predicate function to determine which array
|
42
|
+
* an element belongs to.
|
43
|
+
*
|
44
|
+
* @returns A tuple of two arrays. The first array contains all elements that
|
45
|
+
* match the predicate, the second contains all elements that do not.
|
46
|
+
*
|
47
|
+
* @example Basic usage
|
48
|
+
* ```ts
|
49
|
+
* import { partition } from "@std/collections/partition";
|
50
|
+
* import { assertEquals } from "@std/assert";
|
51
|
+
*
|
52
|
+
* const numbers = [5, 6, 7, 8, 9];
|
53
|
+
* const [even, odd] = partition(numbers, (it) => it % 2 === 0);
|
54
|
+
*
|
55
|
+
* assertEquals(even, [6, 8]);
|
56
|
+
* assertEquals(odd, [5, 7, 9]);
|
57
|
+
* ```
|
58
|
+
*/
|
59
|
+
export declare function partition<T, U extends T>(array: Iterable<T>, predicate: (el: T) => el is U): [U[], Exclude<T, U>[]];
|
60
|
+
//# sourceMappingURL=partition.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"partition.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/partition.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAClB,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,OAAO,GAC5B,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;AACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAClB,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,GAC5B,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
// This module is browser compatible.
|
3
|
+
export function partition(array, predicate) {
|
4
|
+
const matches = [];
|
5
|
+
const rest = [];
|
6
|
+
for (const element of array) {
|
7
|
+
if (predicate(element)) {
|
8
|
+
matches.push(element);
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
rest.push(element);
|
12
|
+
}
|
13
|
+
}
|
14
|
+
return [matches, rest];
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=partition.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"partition.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/partition.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AAmErC,MAAM,UAAU,SAAS,CACvB,KAAwB,EACxB,SAAmC;IAEnC,MAAM,OAAO,GAAmB,EAAE,CAAC;IACnC,MAAM,IAAI,GAAmB,EAAE,CAAC;IAEhC,KAAK,MAAM,OAAO,IAAI,KAAK,EAAE,CAAC;QAC5B,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACzB,CAAC"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* Returns a tuple of two records with the first one containing all entries of
|
3
|
+
* the given record that match the given predicate and the second one containing
|
4
|
+
* all that do not.
|
5
|
+
*
|
6
|
+
* @typeParam T The type of the values in the record.
|
7
|
+
*
|
8
|
+
* @param record The record to partition.
|
9
|
+
* @param predicate The predicate function to determine which entries go where.
|
10
|
+
*
|
11
|
+
* @returns A tuple containing two records, the first one containing all entries
|
12
|
+
* that match the predicate and the second one containing all that do not.
|
13
|
+
*
|
14
|
+
* @example Basic usage
|
15
|
+
* ```ts
|
16
|
+
* import { partitionEntries } from "@std/collections/partition-entries";
|
17
|
+
* import { assertEquals } from "@std/assert";
|
18
|
+
*
|
19
|
+
* const menu = {
|
20
|
+
* Salad: 11,
|
21
|
+
* Soup: 8,
|
22
|
+
* Pasta: 13,
|
23
|
+
* };
|
24
|
+
* const myOptions = partitionEntries(
|
25
|
+
* menu,
|
26
|
+
* ([item, price]) => item !== "Pasta" && price < 10,
|
27
|
+
* );
|
28
|
+
*
|
29
|
+
* assertEquals(
|
30
|
+
* myOptions,
|
31
|
+
* [
|
32
|
+
* { Soup: 8 },
|
33
|
+
* { Salad: 11, Pasta: 13 },
|
34
|
+
* ],
|
35
|
+
* );
|
36
|
+
* ```
|
37
|
+
*/
|
38
|
+
export declare function partitionEntries<T>(record: Readonly<Record<string, T>>, predicate: (entry: [string, T]) => boolean): [match: Record<string, T>, rest: Record<string, T>];
|
39
|
+
//# sourceMappingURL=partition_entries.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"partition_entries.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/partition_entries.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EACnC,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,OAAO,GACzC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAcrD"}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
// This module is browser compatible.
|
3
|
+
/**
|
4
|
+
* Returns a tuple of two records with the first one containing all entries of
|
5
|
+
* the given record that match the given predicate and the second one containing
|
6
|
+
* all that do not.
|
7
|
+
*
|
8
|
+
* @typeParam T The type of the values in the record.
|
9
|
+
*
|
10
|
+
* @param record The record to partition.
|
11
|
+
* @param predicate The predicate function to determine which entries go where.
|
12
|
+
*
|
13
|
+
* @returns A tuple containing two records, the first one containing all entries
|
14
|
+
* that match the predicate and the second one containing all that do not.
|
15
|
+
*
|
16
|
+
* @example Basic usage
|
17
|
+
* ```ts
|
18
|
+
* import { partitionEntries } from "@std/collections/partition-entries";
|
19
|
+
* import { assertEquals } from "@std/assert";
|
20
|
+
*
|
21
|
+
* const menu = {
|
22
|
+
* Salad: 11,
|
23
|
+
* Soup: 8,
|
24
|
+
* Pasta: 13,
|
25
|
+
* };
|
26
|
+
* const myOptions = partitionEntries(
|
27
|
+
* menu,
|
28
|
+
* ([item, price]) => item !== "Pasta" && price < 10,
|
29
|
+
* );
|
30
|
+
*
|
31
|
+
* assertEquals(
|
32
|
+
* myOptions,
|
33
|
+
* [
|
34
|
+
* { Soup: 8 },
|
35
|
+
* { Salad: 11, Pasta: 13 },
|
36
|
+
* ],
|
37
|
+
* );
|
38
|
+
* ```
|
39
|
+
*/
|
40
|
+
export function partitionEntries(record, predicate) {
|
41
|
+
const match = {};
|
42
|
+
const rest = {};
|
43
|
+
const entries = Object.entries(record);
|
44
|
+
for (const [key, value] of entries) {
|
45
|
+
if (predicate([key, value])) {
|
46
|
+
match[key] = value;
|
47
|
+
}
|
48
|
+
else {
|
49
|
+
rest[key] = value;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
return [match, rest];
|
53
|
+
}
|
54
|
+
//# sourceMappingURL=partition_entries.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"partition_entries.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/partition_entries.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAmC,EACnC,SAA0C;IAE1C,MAAM,KAAK,GAAsB,EAAE,CAAC;IACpC,MAAM,IAAI,GAAsB,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,OAAO,EAAE,CAAC;QACnC,IAAI,SAAS,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;YAC5B,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACrB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACvB,CAAC"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* Builds all possible orders of all elements in the given array
|
3
|
+
* Ignores equality of elements, meaning this will always return the same
|
4
|
+
* number of permutations for a given length of input.
|
5
|
+
*
|
6
|
+
* @typeParam T The type of the elements in the array.
|
7
|
+
*
|
8
|
+
* @param inputArray The array to build permutations from.
|
9
|
+
*
|
10
|
+
* @returns An array of all possible permutations of the given array.
|
11
|
+
*
|
12
|
+
* @example Basic usage
|
13
|
+
* ```ts
|
14
|
+
* import { permutations } from "@std/collections/permutations";
|
15
|
+
* import { assertEquals } from "@std/assert";
|
16
|
+
*
|
17
|
+
* const numbers = [ 1, 2 ];
|
18
|
+
* const windows = permutations(numbers);
|
19
|
+
*
|
20
|
+
* assertEquals(windows, [
|
21
|
+
* [ 1, 2 ],
|
22
|
+
* [ 2, 1 ],
|
23
|
+
* ]);
|
24
|
+
* ```
|
25
|
+
*/
|
26
|
+
export declare function permutations<T>(inputArray: Iterable<T>): T[][];
|
27
|
+
//# sourceMappingURL=permutations.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"permutations.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/permutations.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAqC9D"}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
// This module is browser compatible.
|
3
|
+
/**
|
4
|
+
* Builds all possible orders of all elements in the given array
|
5
|
+
* Ignores equality of elements, meaning this will always return the same
|
6
|
+
* number of permutations for a given length of input.
|
7
|
+
*
|
8
|
+
* @typeParam T The type of the elements in the array.
|
9
|
+
*
|
10
|
+
* @param inputArray The array to build permutations from.
|
11
|
+
*
|
12
|
+
* @returns An array of all possible permutations of the given array.
|
13
|
+
*
|
14
|
+
* @example Basic usage
|
15
|
+
* ```ts
|
16
|
+
* import { permutations } from "@std/collections/permutations";
|
17
|
+
* import { assertEquals } from "@std/assert";
|
18
|
+
*
|
19
|
+
* const numbers = [ 1, 2 ];
|
20
|
+
* const windows = permutations(numbers);
|
21
|
+
*
|
22
|
+
* assertEquals(windows, [
|
23
|
+
* [ 1, 2 ],
|
24
|
+
* [ 2, 1 ],
|
25
|
+
* ]);
|
26
|
+
* ```
|
27
|
+
*/
|
28
|
+
export function permutations(inputArray) {
|
29
|
+
const result = [];
|
30
|
+
const array = [...inputArray];
|
31
|
+
const k = array.length;
|
32
|
+
if (k === 0) {
|
33
|
+
return result;
|
34
|
+
}
|
35
|
+
// Heap's Algorithm
|
36
|
+
const c = new Array(k).fill(0);
|
37
|
+
result.push([...array]);
|
38
|
+
let i = 1;
|
39
|
+
while (i < k) {
|
40
|
+
if (c[i] < i) {
|
41
|
+
if (i % 2 === 0) {
|
42
|
+
[array[0], array[i]] = [array[i], array[0]];
|
43
|
+
}
|
44
|
+
else {
|
45
|
+
[array[c[i]], array[i]] = [array[i], array[c[i]]];
|
46
|
+
}
|
47
|
+
result.push([...array]);
|
48
|
+
c[i] += 1;
|
49
|
+
i = 1;
|
50
|
+
}
|
51
|
+
else {
|
52
|
+
c[i] = 0;
|
53
|
+
i += 1;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
return result;
|
57
|
+
}
|
58
|
+
//# sourceMappingURL=permutations.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"permutations.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/permutations.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,YAAY,CAAI,UAAuB;IACrD,MAAM,MAAM,GAAU,EAAE,CAAC;IAEzB,MAAM,KAAK,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC;IAE9B,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;IAEvB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,mBAAmB;IACnB,MAAM,CAAC,GAAG,IAAI,KAAK,CAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEvC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAExB,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,CAAC,CAAE,GAAG,CAAC,EAAE,CAAC;YACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBAChB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAW,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACN,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAW,CAAC;YAChE,CAAC;YAED,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;YAExB,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,CAAC;YACX,CAAC,GAAG,CAAC,CAAC;QACR,CAAC;aAAM,CAAC;YACN,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACT,CAAC,IAAI,CAAC,CAAC;QACT,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/**
|
2
|
+
* Creates a new object by including the specified keys from the provided
|
3
|
+
* object.
|
4
|
+
*
|
5
|
+
* @typeParam T The type of the object.
|
6
|
+
* @typeParam K The type of the keys.
|
7
|
+
*
|
8
|
+
* @param obj The object to pick keys from.
|
9
|
+
* @param keys The keys to include in the new object.
|
10
|
+
*
|
11
|
+
* @returns A new object with the specified keys from the provided object.
|
12
|
+
*
|
13
|
+
* @example Basic usage
|
14
|
+
* ```ts
|
15
|
+
* import { pick } from "@std/collections/pick";
|
16
|
+
* import { assertEquals } from "@std/assert";
|
17
|
+
*
|
18
|
+
* const obj = { a: 5, b: 6, c: 7, d: 8 };
|
19
|
+
* const picked = pick(obj, ["a", "c"]);
|
20
|
+
*
|
21
|
+
* assertEquals(picked, { a: 5, c: 7 });
|
22
|
+
* ```
|
23
|
+
*/
|
24
|
+
export declare function pick<T extends object, K extends keyof T>(obj: Readonly<T>, keys: readonly K[]): Pick<T, K>;
|
25
|
+
//# sourceMappingURL=pick.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pick.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/pick.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EACtD,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,EAChB,IAAI,EAAE,SAAS,CAAC,EAAE,GACjB,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAIZ"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2
|
+
// This module is browser compatible.
|
3
|
+
/**
|
4
|
+
* Creates a new object by including the specified keys from the provided
|
5
|
+
* object.
|
6
|
+
*
|
7
|
+
* @typeParam T The type of the object.
|
8
|
+
* @typeParam K The type of the keys.
|
9
|
+
*
|
10
|
+
* @param obj The object to pick keys from.
|
11
|
+
* @param keys The keys to include in the new object.
|
12
|
+
*
|
13
|
+
* @returns A new object with the specified keys from the provided object.
|
14
|
+
*
|
15
|
+
* @example Basic usage
|
16
|
+
* ```ts
|
17
|
+
* import { pick } from "@std/collections/pick";
|
18
|
+
* import { assertEquals } from "@std/assert";
|
19
|
+
*
|
20
|
+
* const obj = { a: 5, b: 6, c: 7, d: 8 };
|
21
|
+
* const picked = pick(obj, ["a", "c"]);
|
22
|
+
*
|
23
|
+
* assertEquals(picked, { a: 5, c: 7 });
|
24
|
+
* ```
|
25
|
+
*/
|
26
|
+
export function pick(obj, keys) {
|
27
|
+
const result = {};
|
28
|
+
for (const key of keys)
|
29
|
+
if (key in obj)
|
30
|
+
result[key] = obj[key];
|
31
|
+
return result;
|
32
|
+
}
|
33
|
+
//# sourceMappingURL=pick.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pick.js","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/pick.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,qCAAqC;AAErC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,IAAI,CAClB,GAAgB,EAChB,IAAkB;IAElB,MAAM,MAAM,GAAG,EAAgB,CAAC;IAChC,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,IAAI,GAAG,IAAI,GAAG;YAAE,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/**
|
2
|
+
* Applies the given reducer to each group in the given grouping, returning the
|
3
|
+
* results together with the respective group keys.
|
4
|
+
*
|
5
|
+
* @typeParam T input type of an item in a group in the given grouping.
|
6
|
+
* @typeParam A type of the accumulator value, which will match the returned
|
7
|
+
* record's values.
|
8
|
+
*
|
9
|
+
* @param record The grouping to reduce.
|
10
|
+
* @param reducer The reducer function to apply to each group.
|
11
|
+
* @param initialValue The initial value of the accumulator.
|
12
|
+
*
|
13
|
+
* @returns A record with the same keys as the input grouping, where each value
|
14
|
+
* is the result of applying the reducer to the respective group.
|
15
|
+
*
|
16
|
+
* @example Basic usage
|
17
|
+
* ```ts
|
18
|
+
* import { reduceGroups } from "@std/collections/reduce-groups";
|
19
|
+
* import { assertEquals } from "@std/assert";
|
20
|
+
*
|
21
|
+
* const votes = {
|
22
|
+
* Woody: [2, 3, 1, 4],
|
23
|
+
* Buzz: [5, 9],
|
24
|
+
* };
|
25
|
+
*
|
26
|
+
* const totalVotes = reduceGroups(votes, (sum, vote) => sum + vote, 0);
|
27
|
+
*
|
28
|
+
* assertEquals(totalVotes, {
|
29
|
+
* Woody: 10,
|
30
|
+
* Buzz: 14,
|
31
|
+
* });
|
32
|
+
* ```
|
33
|
+
*/
|
34
|
+
export declare function reduceGroups<T, A>(record: Readonly<Record<string, ReadonlyArray<T>>>, reducer: (accumulator: A, current: T) => A, initialValue: A): Record<string, A>;
|
35
|
+
//# sourceMappingURL=reduce_groups.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"reduce_groups.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/collections/1.0.9/reduce_groups.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAC/B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAClD,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,EAC1C,YAAY,EAAE,CAAC,GACd,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAEnB"}
|