@vinicunca/perkakas 1.14.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-prop.cjs +1 -1
- package/dist/add-prop.cjs.map +1 -1
- package/dist/add-prop.js.map +1 -1
- package/dist/add.cjs +1 -1
- package/dist/add.cjs.map +1 -1
- package/dist/add.js.map +1 -1
- package/dist/all-pass.cjs +1 -1
- package/dist/all-pass.cjs.map +1 -1
- package/dist/all-pass.js.map +1 -1
- package/dist/any-pass.cjs +1 -1
- package/dist/any-pass.cjs.map +1 -1
- package/dist/any-pass.js.map +1 -1
- package/dist/{binary-search-cutoff-index-TJlnoie4.js → binary-search-cutoff-index-CRPy-dOJ.js} +1 -1
- package/dist/{binary-search-cutoff-index-TJlnoie4.js.map → binary-search-cutoff-index-CRPy-dOJ.js.map} +1 -1
- package/dist/binary-search-cutoff-index-CdUUMUB1.cjs +2 -0
- package/dist/{binary-search-cutoff-index-CLFtXYPc.cjs.map → binary-search-cutoff-index-CdUUMUB1.cjs.map} +1 -1
- package/dist/capitalize.cjs +1 -1
- package/dist/capitalize.cjs.map +1 -1
- package/dist/capitalize.js.map +1 -1
- package/dist/ceil.cjs +1 -1
- package/dist/ceil.cjs.map +1 -1
- package/dist/ceil.js +1 -1
- package/dist/ceil.js.map +1 -1
- package/dist/chunk.cjs +1 -1
- package/dist/chunk.cjs.map +1 -1
- package/dist/chunk.js.map +1 -1
- package/dist/clamp.cjs +1 -1
- package/dist/clamp.cjs.map +1 -1
- package/dist/clamp.js.map +1 -1
- package/dist/clone.cjs +1 -1
- package/dist/clone.cjs.map +1 -1
- package/dist/clone.js.map +1 -1
- package/dist/concat.cjs +1 -1
- package/dist/concat.cjs.map +1 -1
- package/dist/concat.js.map +1 -1
- package/dist/conditional.cjs +2 -1
- package/dist/conditional.cjs.map +1 -0
- package/dist/conditional.js +2 -1
- package/dist/conditional.js.map +1 -0
- package/dist/constant.cjs.map +1 -1
- package/dist/constant.js.map +1 -1
- package/dist/count-by.cjs +1 -1
- package/dist/count-by.cjs.map +1 -1
- package/dist/count-by.js.map +1 -1
- package/dist/{curry-from-lazy-CtH1dp14.js → curry-from-lazy-BoPMn2L_.js} +1 -1
- package/dist/{curry-from-lazy-CtH1dp14.js.map → curry-from-lazy-BoPMn2L_.js.map} +1 -1
- package/dist/{curry-from-lazy-BvN_VKlH.cjs → curry-from-lazy-mdjeRP1g.cjs} +2 -2
- package/dist/{curry-from-lazy-BvN_VKlH.cjs.map → curry-from-lazy-mdjeRP1g.cjs.map} +1 -1
- package/dist/curry-on-Et2NUOHd.js +2 -0
- package/dist/curry-on-Et2NUOHd.js.map +1 -0
- package/dist/curry-on-wBH_q-mO.cjs +2 -0
- package/dist/curry-on-wBH_q-mO.cjs.map +1 -0
- package/dist/{curry-order-rules-DsJSy3gX.cjs → curry-order-rules-CacOTzfW.cjs} +2 -2
- package/dist/{curry-order-rules-DsJSy3gX.cjs.map → curry-order-rules-CacOTzfW.cjs.map} +1 -1
- package/dist/{curry-order-rules-BLyCSMdZ.js → curry-order-rules-Dage-BeC.js} +1 -1
- package/dist/{curry-order-rules-BLyCSMdZ.js.map → curry-order-rules-Dage-BeC.js.map} +1 -1
- package/dist/curry.cjs +1 -1
- package/dist/curry.cjs.map +1 -1
- package/dist/curry.js +1 -1
- package/dist/curry.js.map +1 -1
- package/dist/debounce.cjs.map +1 -1
- package/dist/debounce.js.map +1 -1
- package/dist/default-to.cjs +1 -1
- package/dist/default-to.cjs.map +1 -1
- package/dist/default-to.js.map +1 -1
- package/dist/difference-with.cjs +1 -1
- package/dist/difference-with.cjs.map +1 -1
- package/dist/difference-with.js +1 -1
- package/dist/difference-with.js.map +1 -1
- package/dist/difference.cjs +1 -1
- package/dist/difference.cjs.map +1 -1
- package/dist/difference.js +1 -1
- package/dist/difference.js.map +1 -1
- package/dist/divide.cjs +1 -1
- package/dist/divide.cjs.map +1 -1
- package/dist/divide.js.map +1 -1
- package/dist/do-nothing.cjs.map +1 -1
- package/dist/do-nothing.js.map +1 -1
- package/dist/drop-first-by.cjs +1 -1
- package/dist/drop-first-by.cjs.map +1 -1
- package/dist/drop-first-by.js +1 -1
- package/dist/drop-first-by.js.map +1 -1
- package/dist/drop-last-while.cjs +1 -1
- package/dist/drop-last-while.cjs.map +1 -1
- package/dist/drop-last-while.js.map +1 -1
- package/dist/drop-last.cjs +1 -1
- package/dist/drop-last.cjs.map +1 -1
- package/dist/drop-last.js.map +1 -1
- package/dist/drop-while.cjs +1 -1
- package/dist/drop-while.cjs.map +1 -1
- package/dist/drop-while.js.map +1 -1
- package/dist/drop.cjs +1 -1
- package/dist/drop.cjs.map +1 -1
- package/dist/drop.js +1 -1
- package/dist/drop.js.map +1 -1
- package/dist/ends-with.cjs +1 -1
- package/dist/ends-with.cjs.map +1 -1
- package/dist/ends-with.js.map +1 -1
- package/dist/entries.cjs +1 -1
- package/dist/entries.cjs.map +1 -1
- package/dist/entries.js.map +1 -1
- package/dist/evolve.cjs +1 -1
- package/dist/evolve.cjs.map +1 -1
- package/dist/evolve.js.map +1 -1
- package/dist/filter.cjs +1 -1
- package/dist/filter.cjs.map +1 -1
- package/dist/filter.js +1 -1
- package/dist/filter.js.map +1 -1
- package/dist/find-index.cjs +1 -1
- package/dist/find-index.cjs.map +1 -1
- package/dist/find-index.js.map +1 -1
- package/dist/find-last-index.cjs +1 -1
- package/dist/find-last-index.cjs.map +1 -1
- package/dist/find-last-index.js.map +1 -1
- package/dist/find-last.cjs +1 -1
- package/dist/find-last.cjs.map +1 -1
- package/dist/find-last.js.map +1 -1
- package/dist/find.cjs +1 -1
- package/dist/find.cjs.map +1 -1
- package/dist/find.js +1 -1
- package/dist/find.js.map +1 -1
- package/dist/first-by.cjs +1 -1
- package/dist/first-by.cjs.map +1 -1
- package/dist/first-by.js +1 -1
- package/dist/first-by.js.map +1 -1
- package/dist/first.cjs +1 -1
- package/dist/first.cjs.map +1 -1
- package/dist/first.js +1 -1
- package/dist/first.js.map +1 -1
- package/dist/flat-map.cjs +1 -1
- package/dist/flat-map.cjs.map +1 -1
- package/dist/flat-map.js.map +1 -1
- package/dist/flat.cjs +1 -1
- package/dist/flat.cjs.map +1 -1
- package/dist/flat.js +1 -1
- package/dist/flat.js.map +1 -1
- package/dist/floor.cjs +1 -1
- package/dist/floor.cjs.map +1 -1
- package/dist/floor.js +1 -1
- package/dist/floor.js.map +1 -1
- package/dist/for-each-obj.cjs +1 -1
- package/dist/for-each-obj.cjs.map +1 -1
- package/dist/for-each-obj.js.map +1 -1
- package/dist/for-each.cjs +1 -1
- package/dist/for-each.cjs.map +1 -1
- package/dist/for-each.js.map +1 -1
- package/dist/from-entries.cjs +1 -1
- package/dist/from-entries.cjs.map +1 -1
- package/dist/from-entries.js.map +1 -1
- package/dist/from-keys.cjs +1 -1
- package/dist/from-keys.cjs.map +1 -1
- package/dist/from-keys.js.map +1 -1
- package/dist/funnel.cjs.map +1 -1
- package/dist/funnel.js.map +1 -1
- package/dist/group-by-prop.cjs +1 -1
- package/dist/group-by-prop.cjs.map +1 -1
- package/dist/group-by-prop.js.map +1 -1
- package/dist/group-by.cjs +1 -1
- package/dist/group-by.cjs.map +1 -1
- package/dist/group-by.js.map +1 -1
- package/dist/has-at-least.cjs +1 -1
- package/dist/has-at-least.cjs.map +1 -1
- package/dist/has-at-least.js.map +1 -1
- package/dist/has-prop.cjs +2 -0
- package/dist/has-prop.cjs.map +1 -0
- package/dist/has-prop.js +2 -0
- package/dist/has-prop.js.map +1 -0
- package/dist/has-sub-object.cjs +1 -1
- package/dist/has-sub-object.cjs.map +1 -1
- package/dist/has-sub-object.js.map +1 -1
- package/dist/heap-BK0Y5t1Y.cjs +2 -0
- package/dist/{heap-C0zPQGC0.cjs.map → heap-BK0Y5t1Y.cjs.map} +1 -1
- package/dist/{heap-M6D40vkc.js → heap-CL5ahv5n.js} +2 -2
- package/dist/{heap-M6D40vkc.js.map → heap-CL5ahv5n.js.map} +1 -1
- package/dist/human-readable-file-size.cjs.map +1 -1
- package/dist/human-readable-file-size.js.map +1 -1
- package/dist/identity.cjs.map +1 -1
- package/dist/identity.js.map +1 -1
- package/dist/index-by.cjs +1 -1
- package/dist/index-by.cjs.map +1 -1
- package/dist/index-by.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +174 -202
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +174 -202
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/intersection-with.cjs +1 -1
- package/dist/intersection-with.cjs.map +1 -1
- package/dist/intersection-with.js +1 -1
- package/dist/intersection-with.js.map +1 -1
- package/dist/intersection.cjs +1 -1
- package/dist/intersection.cjs.map +1 -1
- package/dist/intersection.js +1 -1
- package/dist/intersection.js.map +1 -1
- package/dist/invert.cjs +1 -1
- package/dist/invert.cjs.map +1 -1
- package/dist/invert.js.map +1 -1
- package/dist/is-array.cjs.map +1 -1
- package/dist/is-array.js.map +1 -1
- package/dist/is-big-int.cjs.map +1 -1
- package/dist/is-big-int.js.map +1 -1
- package/dist/is-boolean.cjs.map +1 -1
- package/dist/is-boolean.js.map +1 -1
- package/dist/is-date.cjs.map +1 -1
- package/dist/is-date.js.map +1 -1
- package/dist/is-deep-equal.cjs +1 -1
- package/dist/is-deep-equal.cjs.map +1 -1
- package/dist/is-deep-equal.js +1 -1
- package/dist/is-deep-equal.js.map +1 -1
- package/dist/is-defined.cjs.map +1 -1
- package/dist/is-defined.js.map +1 -1
- package/dist/is-empty.cjs.map +1 -1
- package/dist/is-empty.js.map +1 -1
- package/dist/is-emptyish.cjs.map +1 -1
- package/dist/is-emptyish.js.map +1 -1
- package/dist/is-error.cjs.map +1 -1
- package/dist/is-error.js.map +1 -1
- package/dist/is-function.cjs.map +1 -1
- package/dist/is-function.js.map +1 -1
- package/dist/is-included-in.cjs.map +1 -1
- package/dist/is-included-in.js.map +1 -1
- package/dist/is-non-null.cjs.map +1 -1
- package/dist/is-non-null.js.map +1 -1
- package/dist/is-non-nullish.cjs.map +1 -1
- package/dist/is-non-nullish.js.map +1 -1
- package/dist/is-not.cjs.map +1 -1
- package/dist/is-not.js.map +1 -1
- package/dist/is-nullish.cjs.map +1 -1
- package/dist/is-nullish.js.map +1 -1
- package/dist/is-number.cjs.map +1 -1
- package/dist/is-number.js.map +1 -1
- package/dist/is-object-type.cjs.map +1 -1
- package/dist/is-object-type.js.map +1 -1
- package/dist/is-plain-object.cjs.map +1 -1
- package/dist/is-plain-object.js.map +1 -1
- package/dist/is-promise.cjs.map +1 -1
- package/dist/is-promise.js.map +1 -1
- package/dist/is-shallow-equal.cjs +1 -1
- package/dist/is-shallow-equal.cjs.map +1 -1
- package/dist/is-shallow-equal.js.map +1 -1
- package/dist/is-strict-equal.cjs +1 -1
- package/dist/is-strict-equal.cjs.map +1 -1
- package/dist/is-strict-equal.js.map +1 -1
- package/dist/is-string.cjs.map +1 -1
- package/dist/is-string.js.map +1 -1
- package/dist/is-symbol.cjs.map +1 -1
- package/dist/is-symbol.js.map +1 -1
- package/dist/is-truthy.cjs.map +1 -1
- package/dist/is-truthy.js.map +1 -1
- package/dist/join.cjs +1 -1
- package/dist/join.cjs.map +1 -1
- package/dist/join.js.map +1 -1
- package/dist/key-codes.cjs.map +1 -1
- package/dist/key-codes.js.map +1 -1
- package/dist/keys.cjs +1 -1
- package/dist/keys.cjs.map +1 -1
- package/dist/keys.js.map +1 -1
- package/dist/last.cjs +1 -1
- package/dist/last.cjs.map +1 -1
- package/dist/last.js.map +1 -1
- package/dist/{lazy-data-last-impl-Vt_M0l7X.js → lazy-data-last-impl--3B10z3s.js} +1 -1
- package/dist/{lazy-data-last-impl-Vt_M0l7X.js.map → lazy-data-last-impl--3B10z3s.js.map} +1 -1
- package/dist/lazy-data-last-impl-Dd5zjCfU.cjs +2 -0
- package/dist/{lazy-data-last-impl-B05ZpguF.cjs.map → lazy-data-last-impl-Dd5zjCfU.cjs.map} +1 -1
- package/dist/length.cjs +1 -1
- package/dist/length.cjs.map +1 -1
- package/dist/length.js.map +1 -1
- package/dist/map-keys.cjs +1 -1
- package/dist/map-keys.cjs.map +1 -1
- package/dist/map-keys.js.map +1 -1
- package/dist/map-to-obj.cjs +1 -1
- package/dist/map-to-obj.cjs.map +1 -1
- package/dist/map-to-obj.js.map +1 -1
- package/dist/map-values.cjs +1 -1
- package/dist/map-values.cjs.map +1 -1
- package/dist/map-values.js.map +1 -1
- package/dist/map-with-feedback.cjs +1 -1
- package/dist/map-with-feedback.cjs.map +1 -1
- package/dist/map-with-feedback.js +1 -1
- package/dist/map-with-feedback.js.map +1 -1
- package/dist/map.cjs +1 -1
- package/dist/map.cjs.map +1 -1
- package/dist/map.js.map +1 -1
- package/dist/mean-by.cjs +1 -1
- package/dist/mean-by.cjs.map +1 -1
- package/dist/mean-by.js.map +1 -1
- package/dist/mean.cjs +1 -1
- package/dist/mean.cjs.map +1 -1
- package/dist/mean.js.map +1 -1
- package/dist/median.cjs +1 -1
- package/dist/median.cjs.map +1 -1
- package/dist/median.js.map +1 -1
- package/dist/merge-all.cjs.map +1 -1
- package/dist/merge-all.js.map +1 -1
- package/dist/merge-deep.cjs +1 -1
- package/dist/merge-deep.cjs.map +1 -1
- package/dist/merge-deep.js.map +1 -1
- package/dist/merge.cjs +1 -1
- package/dist/merge.cjs.map +1 -1
- package/dist/merge.js.map +1 -1
- package/dist/multiply.cjs +1 -1
- package/dist/multiply.cjs.map +1 -1
- package/dist/multiply.js.map +1 -1
- package/dist/{nth-by-zZ3RM-mR.cjs → nth-by-BrkoqeV2.cjs} +2 -2
- package/dist/{nth-by-zZ3RM-mR.cjs.map → nth-by-BrkoqeV2.cjs.map} +1 -1
- package/dist/{nth-by-DhfNV5xd.js → nth-by-DGcGGvJX.js} +2 -2
- package/dist/{nth-by-DhfNV5xd.js.map → nth-by-DGcGGvJX.js.map} +1 -1
- package/dist/nth-by.cjs +1 -1
- package/dist/nth-by.js +1 -1
- package/dist/obj-of.cjs +1 -1
- package/dist/obj-of.cjs.map +1 -1
- package/dist/obj-of.js.map +1 -1
- package/dist/omit-by.cjs +1 -1
- package/dist/omit-by.cjs.map +1 -1
- package/dist/omit-by.js.map +1 -1
- package/dist/omit.cjs +1 -1
- package/dist/omit.cjs.map +1 -1
- package/dist/omit.js.map +1 -1
- package/dist/once.cjs.map +1 -1
- package/dist/once.js.map +1 -1
- package/dist/only.cjs +1 -1
- package/dist/only.cjs.map +1 -1
- package/dist/only.js.map +1 -1
- package/dist/partial-bind.cjs.map +1 -1
- package/dist/partial-bind.js.map +1 -1
- package/dist/partial-last-bind.cjs.map +1 -1
- package/dist/partial-last-bind.js.map +1 -1
- package/dist/partition.cjs +1 -1
- package/dist/partition.cjs.map +1 -1
- package/dist/partition.js.map +1 -1
- package/dist/path-or.cjs +1 -1
- package/dist/path-or.cjs.map +1 -1
- package/dist/path-or.js.map +1 -1
- package/dist/pick-by.cjs +1 -1
- package/dist/pick-by.cjs.map +1 -1
- package/dist/pick-by.js.map +1 -1
- package/dist/pick.cjs +1 -1
- package/dist/pick.cjs.map +1 -1
- package/dist/pick.js.map +1 -1
- package/dist/pipe.cjs +1 -1
- package/dist/pipe.cjs.map +1 -1
- package/dist/pipe.js +1 -1
- package/dist/pipe.js.map +1 -1
- package/dist/piped.cjs +1 -1
- package/dist/piped.cjs.map +1 -1
- package/dist/piped.js.map +1 -1
- package/dist/product.cjs +1 -1
- package/dist/product.cjs.map +1 -1
- package/dist/product.js.map +1 -1
- package/dist/prop.cjs.map +1 -1
- package/dist/prop.js.map +1 -1
- package/dist/pull-object.cjs +1 -1
- package/dist/pull-object.cjs.map +1 -1
- package/dist/pull-object.js.map +1 -1
- package/dist/random-big-int.cjs.map +1 -1
- package/dist/random-big-int.js.map +1 -1
- package/dist/random-integer.cjs.map +1 -1
- package/dist/random-integer.js.map +1 -1
- package/dist/random-string.cjs +1 -1
- package/dist/random-string.cjs.map +1 -1
- package/dist/random-string.js.map +1 -1
- package/dist/range.cjs +1 -1
- package/dist/range.cjs.map +1 -1
- package/dist/range.js.map +1 -1
- package/dist/rank-by.cjs +1 -1
- package/dist/rank-by.cjs.map +1 -1
- package/dist/rank-by.js +1 -1
- package/dist/rank-by.js.map +1 -1
- package/dist/reduce.cjs +1 -1
- package/dist/reduce.cjs.map +1 -1
- package/dist/reduce.js.map +1 -1
- package/dist/reverse.cjs +1 -1
- package/dist/reverse.cjs.map +1 -1
- package/dist/reverse.js.map +1 -1
- package/dist/round.cjs +1 -1
- package/dist/round.cjs.map +1 -1
- package/dist/round.js +1 -1
- package/dist/round.js.map +1 -1
- package/dist/sample.cjs +1 -1
- package/dist/sample.cjs.map +1 -1
- package/dist/sample.js.map +1 -1
- package/dist/set-path.cjs +1 -1
- package/dist/set-path.cjs.map +1 -1
- package/dist/set-path.js.map +1 -1
- package/dist/set.cjs +1 -1
- package/dist/set.cjs.map +1 -1
- package/dist/set.js.map +1 -1
- package/dist/shuffle.cjs +1 -1
- package/dist/shuffle.cjs.map +1 -1
- package/dist/shuffle.js.map +1 -1
- package/dist/sleep.cjs.map +1 -1
- package/dist/sleep.js.map +1 -1
- package/dist/slice-string.cjs.map +1 -1
- package/dist/slice-string.js.map +1 -1
- package/dist/slugify.cjs.map +1 -1
- package/dist/slugify.js.map +1 -1
- package/dist/sort-by.cjs +1 -1
- package/dist/sort-by.cjs.map +1 -1
- package/dist/sort-by.js +1 -1
- package/dist/sort-by.js.map +1 -1
- package/dist/sort.cjs +1 -1
- package/dist/sort.cjs.map +1 -1
- package/dist/sort.js.map +1 -1
- package/dist/sorted-index-by.cjs +1 -1
- package/dist/sorted-index-by.cjs.map +1 -1
- package/dist/sorted-index-by.js +1 -1
- package/dist/sorted-index-by.js.map +1 -1
- package/dist/sorted-index-with.cjs +1 -1
- package/dist/sorted-index-with.cjs.map +1 -1
- package/dist/sorted-index-with.js +1 -1
- package/dist/sorted-index-with.js.map +1 -1
- package/dist/sorted-index.cjs +1 -1
- package/dist/sorted-index.cjs.map +1 -1
- package/dist/sorted-index.js +1 -1
- package/dist/sorted-index.js.map +1 -1
- package/dist/sorted-last-index-by.cjs +1 -1
- package/dist/sorted-last-index-by.cjs.map +1 -1
- package/dist/sorted-last-index-by.js +1 -1
- package/dist/sorted-last-index-by.js.map +1 -1
- package/dist/sorted-last-index.cjs +1 -1
- package/dist/sorted-last-index.cjs.map +1 -1
- package/dist/sorted-last-index.js +1 -1
- package/dist/sorted-last-index.js.map +1 -1
- package/dist/splice.cjs +1 -1
- package/dist/splice.cjs.map +1 -1
- package/dist/splice.js +1 -1
- package/dist/splice.js.map +1 -1
- package/dist/split-at.cjs +1 -1
- package/dist/split-at.cjs.map +1 -1
- package/dist/split-at.js.map +1 -1
- package/dist/split-when.cjs +1 -1
- package/dist/split-when.cjs.map +1 -1
- package/dist/split-when.js.map +1 -1
- package/dist/split.cjs.map +1 -1
- package/dist/split.js.map +1 -1
- package/dist/starts-with.cjs +1 -1
- package/dist/starts-with.cjs.map +1 -1
- package/dist/starts-with.js.map +1 -1
- package/dist/string-to-path.cjs.map +1 -1
- package/dist/string-to-path.js.map +1 -1
- package/dist/subtract.cjs +1 -1
- package/dist/subtract.cjs.map +1 -1
- package/dist/subtract.js.map +1 -1
- package/dist/sum-by.cjs +1 -1
- package/dist/sum-by.cjs.map +1 -1
- package/dist/sum-by.js.map +1 -1
- package/dist/sum.cjs +1 -1
- package/dist/sum.cjs.map +1 -1
- package/dist/sum.js.map +1 -1
- package/dist/swap-in-place-CllcD0HG.cjs +2 -0
- package/dist/{swap-in-place-D1vasegg.cjs.map → swap-in-place-CllcD0HG.cjs.map} +1 -1
- package/dist/{swap-in-place-BzNaxwB3.js → swap-in-place-ubtnp8en.js} +1 -1
- package/dist/{swap-in-place-BzNaxwB3.js.map → swap-in-place-ubtnp8en.js.map} +1 -1
- package/dist/swap-indices.cjs +1 -1
- package/dist/swap-indices.cjs.map +1 -1
- package/dist/swap-indices.js.map +1 -1
- package/dist/swap-props.cjs +1 -1
- package/dist/swap-props.cjs.map +1 -1
- package/dist/swap-props.js.map +1 -1
- package/dist/take-first-by.cjs +1 -1
- package/dist/take-first-by.cjs.map +1 -1
- package/dist/take-first-by.js +1 -1
- package/dist/take-first-by.js.map +1 -1
- package/dist/take-last-while.cjs +1 -1
- package/dist/take-last-while.cjs.map +1 -1
- package/dist/take-last-while.js.map +1 -1
- package/dist/take-last.cjs +1 -1
- package/dist/take-last.cjs.map +1 -1
- package/dist/take-last.js.map +1 -1
- package/dist/take-while.cjs +1 -1
- package/dist/take-while.cjs.map +1 -1
- package/dist/take-while.js.map +1 -1
- package/dist/take.cjs +1 -1
- package/dist/take.cjs.map +1 -1
- package/dist/take.js +1 -1
- package/dist/take.js.map +1 -1
- package/dist/tap.cjs +1 -1
- package/dist/tap.cjs.map +1 -1
- package/dist/tap.js.map +1 -1
- package/dist/times.cjs +1 -1
- package/dist/times.cjs.map +1 -1
- package/dist/times.js.map +1 -1
- package/dist/to-camel-case.cjs +1 -1
- package/dist/to-camel-case.cjs.map +1 -1
- package/dist/to-camel-case.js +1 -1
- package/dist/to-camel-case.js.map +1 -1
- package/dist/to-kebab-case.cjs +1 -1
- package/dist/to-kebab-case.cjs.map +1 -1
- package/dist/to-kebab-case.js +1 -1
- package/dist/to-kebab-case.js.map +1 -1
- package/dist/to-lower-case.cjs +1 -1
- package/dist/to-lower-case.cjs.map +1 -1
- package/dist/to-lower-case.js.map +1 -1
- package/dist/to-single-BOkjnmkm.cjs +2 -0
- package/dist/{to-single-BunGuk7o.cjs.map → to-single-BOkjnmkm.cjs.map} +1 -1
- package/dist/{to-single-XEXXW73e.js → to-single-D6t2BxVq.js} +1 -1
- package/dist/{to-single-XEXXW73e.js.map → to-single-D6t2BxVq.js.map} +1 -1
- package/dist/to-snake-case.cjs +1 -1
- package/dist/to-snake-case.cjs.map +1 -1
- package/dist/to-snake-case.js +1 -1
- package/dist/to-snake-case.js.map +1 -1
- package/dist/to-title-case.cjs +1 -1
- package/dist/to-title-case.cjs.map +1 -1
- package/dist/to-title-case.js +1 -1
- package/dist/to-title-case.js.map +1 -1
- package/dist/to-upper-case.cjs +1 -1
- package/dist/to-upper-case.cjs.map +1 -1
- package/dist/to-upper-case.js.map +1 -1
- package/dist/truncate.cjs.map +1 -1
- package/dist/truncate.js.map +1 -1
- package/dist/uncapitalize.cjs +1 -1
- package/dist/uncapitalize.cjs.map +1 -1
- package/dist/uncapitalize.js.map +1 -1
- package/dist/unique-by.cjs +1 -1
- package/dist/unique-by.cjs.map +1 -1
- package/dist/unique-by.js +1 -1
- package/dist/unique-by.js.map +1 -1
- package/dist/unique-with.cjs +1 -1
- package/dist/unique-with.cjs.map +1 -1
- package/dist/unique-with.js +1 -1
- package/dist/unique-with.js.map +1 -1
- package/dist/unique.cjs +1 -1
- package/dist/unique.cjs.map +1 -1
- package/dist/unique.js +1 -1
- package/dist/unique.js.map +1 -1
- package/dist/utility-evaluators-BGM19SpK.cjs +2 -0
- package/dist/{utility-evaluators-C8koSp9T.cjs.map → utility-evaluators-BGM19SpK.cjs.map} +1 -1
- package/dist/{utility-evaluators-ZAaUtL2Z.js → utility-evaluators-DDW55xeL.js} +1 -1
- package/dist/{utility-evaluators-ZAaUtL2Z.js.map → utility-evaluators-DDW55xeL.js.map} +1 -1
- package/dist/values.cjs +1 -1
- package/dist/values.cjs.map +1 -1
- package/dist/values.js.map +1 -1
- package/dist/when.cjs.map +1 -1
- package/dist/when.js.map +1 -1
- package/dist/{with-precision-CgRuf7Wl.js → with-precision-D-84B_By.js} +1 -1
- package/dist/{with-precision-CgRuf7Wl.js.map → with-precision-D-84B_By.js.map} +1 -1
- package/dist/{with-precision-DVi9325n.cjs → with-precision-Dy5W6bdk.cjs} +2 -2
- package/dist/{with-precision-DVi9325n.cjs.map → with-precision-Dy5W6bdk.cjs.map} +1 -1
- package/dist/{words-C8Rd_80F.cjs → words-B-9EXtsW.cjs} +2 -2
- package/dist/{words-C8Rd_80F.cjs.map → words-B-9EXtsW.cjs.map} +1 -1
- package/dist/{words-CYZ0Lyko.js → words-CN1Qil5U.js} +2 -2
- package/dist/{words-CYZ0Lyko.js.map → words-CN1Qil5U.js.map} +1 -1
- package/dist/zip-with.cjs +1 -1
- package/dist/zip-with.cjs.map +1 -1
- package/dist/zip-with.js +1 -1
- package/dist/zip-with.js.map +1 -1
- package/dist/zip.cjs +1 -1
- package/dist/zip.cjs.map +1 -1
- package/dist/zip.js.map +1 -1
- package/package.json +11 -11
- package/dist/binary-search-cutoff-index-CLFtXYPc.cjs +0 -2
- package/dist/conditional-3wcaMG9k.cjs +0 -2
- package/dist/conditional-3wcaMG9k.cjs.map +0 -1
- package/dist/conditional-CTEJD5TX.js +0 -2
- package/dist/conditional-CTEJD5TX.js.map +0 -1
- package/dist/heap-C0zPQGC0.cjs +0 -2
- package/dist/lazy-data-last-impl-B05ZpguF.cjs +0 -2
- package/dist/swap-in-place-D1vasegg.cjs +0 -2
- package/dist/to-single-BunGuk7o.cjs +0 -2
- package/dist/utility-evaluators-C8koSp9T.cjs +0 -2
package/dist/keys.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.cjs","names":["curry"],"sources":["../src/keys.ts"],"sourcesContent":["import type { EnumerableStringKeyOf } from './internal/types/enumerable-string-key-of';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Keys<T> = T extends IterableContainer ? ArrayKeys<T> : ObjectKeys<T>;\n\n// The keys output can mirror the input when it is an array/tuple. We do this by\n// \"mapping\" each item \"key\" (which is actually an index) as its own value. This\n// would maintain the shape, even including labels.\ntype ArrayKeys<T extends IterableContainer> = {\n -readonly [Index in keyof T]: Index extends number | string\n ? // Notice that we coalesce the values as strings, this is because in JS,\n // Object.keys always returns strings, even for arrays.\n ToString<IsIndexAfterSpread<T, Index> extends true ? number : Index>\n : // Index is typed as a symbol, this can't happen, but we need to guard\n // against it for typescript.\n never;\n};\n\ntype IsIndexAfterSpread<\n T extends IterableContainer,\n Index extends number | string,\n>\n = IndicesAfterSpread<T
|
|
1
|
+
{"version":3,"file":"keys.cjs","names":["curry"],"sources":["../src/keys.ts"],"sourcesContent":["import type { IsNever } from 'type-fest';\nimport type { EnumerableStringKeyOf } from './internal/types/enumerable-string-key-of';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Keys<T> = T extends IterableContainer ? ArrayKeys<T> : ObjectKeys<T>;\n\n// The keys output can mirror the input when it is an array/tuple. We do this by\n// \"mapping\" each item \"key\" (which is actually an index) as its own value. This\n// would maintain the shape, even including labels.\ntype ArrayKeys<T extends IterableContainer> = {\n -readonly [Index in keyof T]: Index extends number | string\n ? // Notice that we coalesce the values as strings, this is because in JS,\n // Object.keys always returns strings, even for arrays.\n ToString<IsIndexAfterSpread<T, Index> extends true ? number : Index>\n : // Index is typed as a symbol, this can't happen, but we need to guard\n // against it for typescript.\n never;\n};\n\ntype IsIndexAfterSpread<\n T extends IterableContainer,\n Index extends number | string,\n>\n = IsNever<IndicesAfterSpread<T>> extends true\n ? false\n : Index extends `${IndicesAfterSpread<T>}`\n ? true\n : false;\n\n// Find the index of the tuple where a spread item is located, and return all\n// indices in the tuple which are located after it. The tuple could be prefixed\n// by any number of literal items. If the input is a simple array it would\n// return 0 (as expected), and if the tuple doesn't contain a spread element it\n// would return never.\ntype IndicesAfterSpread<\n T extends ReadonlyArray<unknown> | [],\n // We use this type to count how many items we consumed, it's just a pseudo-\n // element that is used for its length.\n Iterations extends ReadonlyArray<unknown> = [],\n>\n = IsNever<T[number]> extends true\n ? never\n : T extends readonly [unknown, ...infer Tail]\n ? IndicesAfterSpread<Tail, [unknown, ...Iterations]>\n : T extends readonly [...infer Head, unknown]\n ?\n | IndicesAfterSpread<Head, [unknown, ...Iterations]>\n | Iterations['length']\n : Iterations['length'];\n\ntype ObjectKeys<T>\n = T extends Record<PropertyKey, never> ? [] : Array<EnumerableStringKeyOf<T>>;\n\n/**\n * Returns a new array containing the keys of the array or object.\n *\n * @param data - Either an array or an object.\n * @signature\n * keys(source)\n * @example\n * keys(['x', 'y', 'z']); // => ['0', '1', '2']\n * keys({ a: 'x', b: 'y', 5: 'z' }); // => ['a', 'b', '5']\n * @dataFirst\n * @category Object\n */\nexport function keys<T extends object>(data: T): Keys<T>;\n\n/**\n * Returns a new array containing the keys of the array or object.\n *\n * @signature\n * keys()(source)\n * @example\n * pipe(['x', 'y', 'z'], keys()); // => ['0', '1', '2']\n * pipe({ a: 'x', b: 'y', 5: 'z' } as const, keys()) // => ['a', 'b', '5']\n * @dataLast\n * @category Object\n */\nexport function keys(): <T extends object>(data: T) => Keys<T>;\n\nexport function keys(...args: ReadonlyArray<unknown>): unknown {\n return curry(Object.keys, args);\n}\n"],"mappings":"kGAkFA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAOA,EAAAA,MAAM,OAAO,KAAM,CAAI,CAChC"}
|
package/dist/keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","names":[],"sources":["../src/keys.ts"],"sourcesContent":["import type { EnumerableStringKeyOf } from './internal/types/enumerable-string-key-of';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Keys<T> = T extends IterableContainer ? ArrayKeys<T> : ObjectKeys<T>;\n\n// The keys output can mirror the input when it is an array/tuple. We do this by\n// \"mapping\" each item \"key\" (which is actually an index) as its own value. This\n// would maintain the shape, even including labels.\ntype ArrayKeys<T extends IterableContainer> = {\n -readonly [Index in keyof T]: Index extends number | string\n ? // Notice that we coalesce the values as strings, this is because in JS,\n // Object.keys always returns strings, even for arrays.\n ToString<IsIndexAfterSpread<T, Index> extends true ? number : Index>\n : // Index is typed as a symbol, this can't happen, but we need to guard\n // against it for typescript.\n never;\n};\n\ntype IsIndexAfterSpread<\n T extends IterableContainer,\n Index extends number | string,\n>\n = IndicesAfterSpread<T
|
|
1
|
+
{"version":3,"file":"keys.js","names":[],"sources":["../src/keys.ts"],"sourcesContent":["import type { IsNever } from 'type-fest';\nimport type { EnumerableStringKeyOf } from './internal/types/enumerable-string-key-of';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Keys<T> = T extends IterableContainer ? ArrayKeys<T> : ObjectKeys<T>;\n\n// The keys output can mirror the input when it is an array/tuple. We do this by\n// \"mapping\" each item \"key\" (which is actually an index) as its own value. This\n// would maintain the shape, even including labels.\ntype ArrayKeys<T extends IterableContainer> = {\n -readonly [Index in keyof T]: Index extends number | string\n ? // Notice that we coalesce the values as strings, this is because in JS,\n // Object.keys always returns strings, even for arrays.\n ToString<IsIndexAfterSpread<T, Index> extends true ? number : Index>\n : // Index is typed as a symbol, this can't happen, but we need to guard\n // against it for typescript.\n never;\n};\n\ntype IsIndexAfterSpread<\n T extends IterableContainer,\n Index extends number | string,\n>\n = IsNever<IndicesAfterSpread<T>> extends true\n ? false\n : Index extends `${IndicesAfterSpread<T>}`\n ? true\n : false;\n\n// Find the index of the tuple where a spread item is located, and return all\n// indices in the tuple which are located after it. The tuple could be prefixed\n// by any number of literal items. If the input is a simple array it would\n// return 0 (as expected), and if the tuple doesn't contain a spread element it\n// would return never.\ntype IndicesAfterSpread<\n T extends ReadonlyArray<unknown> | [],\n // We use this type to count how many items we consumed, it's just a pseudo-\n // element that is used for its length.\n Iterations extends ReadonlyArray<unknown> = [],\n>\n = IsNever<T[number]> extends true\n ? never\n : T extends readonly [unknown, ...infer Tail]\n ? IndicesAfterSpread<Tail, [unknown, ...Iterations]>\n : T extends readonly [...infer Head, unknown]\n ?\n | IndicesAfterSpread<Head, [unknown, ...Iterations]>\n | Iterations['length']\n : Iterations['length'];\n\ntype ObjectKeys<T>\n = T extends Record<PropertyKey, never> ? [] : Array<EnumerableStringKeyOf<T>>;\n\n/**\n * Returns a new array containing the keys of the array or object.\n *\n * @param data - Either an array or an object.\n * @signature\n * keys(source)\n * @example\n * keys(['x', 'y', 'z']); // => ['0', '1', '2']\n * keys({ a: 'x', b: 'y', 5: 'z' }); // => ['a', 'b', '5']\n * @dataFirst\n * @category Object\n */\nexport function keys<T extends object>(data: T): Keys<T>;\n\n/**\n * Returns a new array containing the keys of the array or object.\n *\n * @signature\n * keys()(source)\n * @example\n * pipe(['x', 'y', 'z'], keys()); // => ['0', '1', '2']\n * pipe({ a: 'x', b: 'y', 5: 'z' } as const, keys()) // => ['a', 'b', '5']\n * @dataLast\n * @category Object\n */\nexport function keys(): <T extends object>(data: T) => Keys<T>;\n\nexport function keys(...args: ReadonlyArray<unknown>): unknown {\n return curry(Object.keys, args);\n}\n"],"mappings":"mCAkFA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAO,EAAM,OAAO,KAAM,CAAI,CAChC"}
|
package/dist/last.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(n,t)}function n(e){return e.at(-1)}exports.last=t;
|
|
2
2
|
//# sourceMappingURL=last.cjs.map
|
package/dist/last.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"last.cjs","names":["curry"],"sources":["../src/last.ts"],"sourcesContent":["import type { LastArrayElement } from 'type-fest';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Last<T extends IterableContainer> = LastArrayElement<\n T,\n // Type-fest's LastArrayElement assumes a looser typescript configuration\n // where `noUncheckedIndexedAccess` is disabled. To support the stricter\n // configuration we assume we need to assign the \"LastArrayElement\" param to\n // `undefined`, but only if the array isn't empty.\n T extends readonly [] ? never : undefined\n>;\n\n/**\n * Gets the last element of `array`.\n *\n * @param data - The array.\n * @signature\n * last(array)\n * @example\n * last([1, 2, 3]) // => 3\n * last([]) // => undefined\n * @dataFirst\n * @category Array\n */\nexport function last<T extends IterableContainer>(data: T): Last<T>;\n\n/**\n * Gets the last element of `array`.\n *\n * @signature\n * last()(array)\n * @example\n * pipe(\n * [1, 2, 4, 8, 16],\n * filter(x => x > 3),\n * last(),\n * x => x + 1\n * ); // => 17\n * @dataLast\n * @category Array\n */\nexport function last(): <T extends IterableContainer>(data: T) => Last<T>;\n\nexport function last(...args: ReadonlyArray<unknown>): unknown {\n return curry(lastImplementation, args);\n}\n\nfunction lastImplementation<T>(array: ReadonlyArray<T>): T | undefined {\n return array.at(-1);\n}\n"],"mappings":"kGA4CA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAOA,EAAAA,MAAM,EAAoB,
|
|
1
|
+
{"version":3,"file":"last.cjs","names":["curry"],"sources":["../src/last.ts"],"sourcesContent":["import type { LastArrayElement } from 'type-fest';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Last<T extends IterableContainer> = LastArrayElement<\n T,\n // Type-fest's LastArrayElement assumes a looser typescript configuration\n // where `noUncheckedIndexedAccess` is disabled. To support the stricter\n // configuration we assume we need to assign the \"LastArrayElement\" param to\n // `undefined`, but only if the array isn't empty.\n T extends readonly [] ? never : undefined\n>;\n\n/**\n * Gets the last element of `array`.\n *\n * @param data - The array.\n * @signature\n * last(array)\n * @example\n * last([1, 2, 3]) // => 3\n * last([]) // => undefined\n * @dataFirst\n * @category Array\n */\nexport function last<T extends IterableContainer>(data: T): Last<T>;\n\n/**\n * Gets the last element of `array`.\n *\n * @signature\n * last()(array)\n * @example\n * pipe(\n * [1, 2, 4, 8, 16],\n * filter(x => x > 3),\n * last(),\n * x => x + 1\n * ); // => 17\n * @dataLast\n * @category Array\n */\nexport function last(): <T extends IterableContainer>(data: T) => Last<T>;\n\nexport function last(...args: ReadonlyArray<unknown>): unknown {\n return curry(lastImplementation, args);\n}\n\nfunction lastImplementation<T>(array: ReadonlyArray<T>): T | undefined {\n return array.at(-1);\n}\n"],"mappings":"kGA4CA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAOA,EAAAA,MAAM,EAAoB,CAAI,CACvC,CAEA,SAAS,EAAsB,EAAwC,CACrE,OAAO,EAAM,GAAG,EAAE,CACpB"}
|
package/dist/last.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"last.js","names":[],"sources":["../src/last.ts"],"sourcesContent":["import type { LastArrayElement } from 'type-fest';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Last<T extends IterableContainer> = LastArrayElement<\n T,\n // Type-fest's LastArrayElement assumes a looser typescript configuration\n // where `noUncheckedIndexedAccess` is disabled. To support the stricter\n // configuration we assume we need to assign the \"LastArrayElement\" param to\n // `undefined`, but only if the array isn't empty.\n T extends readonly [] ? never : undefined\n>;\n\n/**\n * Gets the last element of `array`.\n *\n * @param data - The array.\n * @signature\n * last(array)\n * @example\n * last([1, 2, 3]) // => 3\n * last([]) // => undefined\n * @dataFirst\n * @category Array\n */\nexport function last<T extends IterableContainer>(data: T): Last<T>;\n\n/**\n * Gets the last element of `array`.\n *\n * @signature\n * last()(array)\n * @example\n * pipe(\n * [1, 2, 4, 8, 16],\n * filter(x => x > 3),\n * last(),\n * x => x + 1\n * ); // => 17\n * @dataLast\n * @category Array\n */\nexport function last(): <T extends IterableContainer>(data: T) => Last<T>;\n\nexport function last(...args: ReadonlyArray<unknown>): unknown {\n return curry(lastImplementation, args);\n}\n\nfunction lastImplementation<T>(array: ReadonlyArray<T>): T | undefined {\n return array.at(-1);\n}\n"],"mappings":"mCA4CA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAO,EAAM,EAAoB,
|
|
1
|
+
{"version":3,"file":"last.js","names":[],"sources":["../src/last.ts"],"sourcesContent":["import type { LastArrayElement } from 'type-fest';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Last<T extends IterableContainer> = LastArrayElement<\n T,\n // Type-fest's LastArrayElement assumes a looser typescript configuration\n // where `noUncheckedIndexedAccess` is disabled. To support the stricter\n // configuration we assume we need to assign the \"LastArrayElement\" param to\n // `undefined`, but only if the array isn't empty.\n T extends readonly [] ? never : undefined\n>;\n\n/**\n * Gets the last element of `array`.\n *\n * @param data - The array.\n * @signature\n * last(array)\n * @example\n * last([1, 2, 3]) // => 3\n * last([]) // => undefined\n * @dataFirst\n * @category Array\n */\nexport function last<T extends IterableContainer>(data: T): Last<T>;\n\n/**\n * Gets the last element of `array`.\n *\n * @signature\n * last()(array)\n * @example\n * pipe(\n * [1, 2, 4, 8, 16],\n * filter(x => x > 3),\n * last(),\n * x => x + 1\n * ); // => 17\n * @dataLast\n * @category Array\n */\nexport function last(): <T extends IterableContainer>(data: T) => Last<T>;\n\nexport function last(...args: ReadonlyArray<unknown>): unknown {\n return curry(lastImplementation, args);\n}\n\nfunction lastImplementation<T>(array: ReadonlyArray<T>): T | undefined {\n return array.at(-1);\n}\n"],"mappings":"mCA4CA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAO,EAAM,EAAoB,CAAI,CACvC,CAEA,SAAS,EAAsB,EAAwC,CACrE,OAAO,EAAM,GAAG,EAAE,CACpB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function e(e,t,n){let r=n=>e(n,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}export{e as t};
|
|
2
|
-
//# sourceMappingURL=lazy-data-last-impl
|
|
2
|
+
//# sourceMappingURL=lazy-data-last-impl--3B10z3s.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-data-last-impl
|
|
1
|
+
{"version":3,"file":"lazy-data-last-impl--3B10z3s.js","names":[],"sources":["../src/internal/lazy-data-last-impl.ts"],"sourcesContent":["/* eslint-disable ts/no-explicit-any */\n\nimport type { LazyEvaluator } from './types/lazy-evaluator';\nimport type { StrictFunction } from './types/strict-function';\n\n/**\n * Use this helper function to build the data last implementation together with\n * a lazy implementation. Use this when you need to build your own currying\n * logic when you want to decide between dataFirst and dataLast on something\n * that isn't the number of arguments provided. This is useful for implementing\n * functions with optional or variadic arguments.\n */\nexport function lazyDataLastImpl(\n fn: StrictFunction,\n args: ReadonlyArray<unknown>,\n lazy?: (...args: any) => LazyEvaluator,\n // TODO: We can probably provide better typing to the return type...\n): unknown {\n // @ts-expect-error [ts2345] -- This error is accurate because we don't know\n // anything about `fn` so can't ensure that we are passing the correct\n // arguments to it, we just have to trust that the caller knows what they are\n // doing.\n const dataLast = (data: unknown): unknown => fn(data, ...args);\n\n return lazy === undefined\n ? dataLast\n : Object.assign(dataLast, { lazy, lazyArgs: args });\n}\n"],"mappings":"AAYA,SAAgB,EACd,EACA,EACA,EAES,CAKT,IAAM,EAAY,GAA2B,EAAG,EAAM,GAAG,CAAI,EAE7D,OAAO,IAAS,IAAA,GACZ,EACA,OAAO,OAAO,EAAU,CAAE,OAAM,SAAU,CAAK,CAAC,CACtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-data-last-impl-
|
|
1
|
+
{"version":3,"file":"lazy-data-last-impl-Dd5zjCfU.cjs","names":[],"sources":["../src/internal/lazy-data-last-impl.ts"],"sourcesContent":["/* eslint-disable ts/no-explicit-any */\n\nimport type { LazyEvaluator } from './types/lazy-evaluator';\nimport type { StrictFunction } from './types/strict-function';\n\n/**\n * Use this helper function to build the data last implementation together with\n * a lazy implementation. Use this when you need to build your own currying\n * logic when you want to decide between dataFirst and dataLast on something\n * that isn't the number of arguments provided. This is useful for implementing\n * functions with optional or variadic arguments.\n */\nexport function lazyDataLastImpl(\n fn: StrictFunction,\n args: ReadonlyArray<unknown>,\n lazy?: (...args: any) => LazyEvaluator,\n // TODO: We can probably provide better typing to the return type...\n): unknown {\n // @ts-expect-error [ts2345] -- This error is accurate because we don't know\n // anything about `fn` so can't ensure that we are passing the correct\n // arguments to it, we just have to trust that the caller knows what they are\n // doing.\n const dataLast = (data: unknown): unknown => fn(data, ...args);\n\n return lazy === undefined\n ? dataLast\n : Object.assign(dataLast, { lazy, lazyArgs: args });\n}\n"],"mappings":"AAYA,SAAgB,EACd,EACA,EACA,EAES,CAKT,IAAM,EAAY,GAA2B,EAAG,EAAM,GAAG,CAAI,EAE7D,OAAO,IAAS,IAAA,GACZ,EACA,OAAO,OAAO,EAAU,CAAE,OAAM,SAAU,CAAK,CAAC,CACtD"}
|
package/dist/length.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(n,t)}function n(e){return`length`in e?e.length:[...e].length}exports.length=t;
|
|
2
2
|
//# sourceMappingURL=length.cjs.map
|
package/dist/length.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"length.cjs","names":["curry"],"sources":["../src/length.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype Enumerable<T> = ArrayLike<T> | Iterable<T>;\n\n/**\n * Counts values of the collection or iterable.\n *\n * @param items - The input data.\n * @signature\n * length(array)\n * @example\n * length([1, 2, 3]) // => 3\n * @dataFirst\n * @category Array\n */\nexport function length<T>(items: Enumerable<T>): number;\n\n/**\n * Counts values of the collection or iterable.\n *\n * @signature\n * length()(array)\n * @example\n * pipe([1, 2, 3], length()) // => 3\n * @dataLast\n * @category Array\n */\nexport function length<T>(): (items: Enumerable<T>) => number;\n\nexport function length(...args: ReadonlyArray<unknown>): unknown {\n return curry(lengthImplementation, args);\n}\n\nfunction lengthImplementation<T>(items: Enumerable<T>): number {\n return 'length' in items ? items.length : [...items].length;\n}\n"],"mappings":"kGA6BA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"length.cjs","names":["curry"],"sources":["../src/length.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype Enumerable<T> = ArrayLike<T> | Iterable<T>;\n\n/**\n * Counts values of the collection or iterable.\n *\n * @param items - The input data.\n * @signature\n * length(array)\n * @example\n * length([1, 2, 3]) // => 3\n * @dataFirst\n * @category Array\n */\nexport function length<T>(items: Enumerable<T>): number;\n\n/**\n * Counts values of the collection or iterable.\n *\n * @signature\n * length()(array)\n * @example\n * pipe([1, 2, 3], length()) // => 3\n * @dataLast\n * @category Array\n */\nexport function length<T>(): (items: Enumerable<T>) => number;\n\nexport function length(...args: ReadonlyArray<unknown>): unknown {\n return curry(lengthImplementation, args);\n}\n\nfunction lengthImplementation<T>(items: Enumerable<T>): number {\n return 'length' in items ? items.length : [...items].length;\n}\n"],"mappings":"kGA6BA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,CAAI,CACzC,CAEA,SAAS,EAAwB,EAA8B,CAC7D,MAAO,WAAY,EAAQ,EAAM,OAAS,CAAC,GAAG,CAAK,CAAC,CAAC,MACvD"}
|
package/dist/length.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"length.js","names":[],"sources":["../src/length.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype Enumerable<T> = ArrayLike<T> | Iterable<T>;\n\n/**\n * Counts values of the collection or iterable.\n *\n * @param items - The input data.\n * @signature\n * length(array)\n * @example\n * length([1, 2, 3]) // => 3\n * @dataFirst\n * @category Array\n */\nexport function length<T>(items: Enumerable<T>): number;\n\n/**\n * Counts values of the collection or iterable.\n *\n * @signature\n * length()(array)\n * @example\n * pipe([1, 2, 3], length()) // => 3\n * @dataLast\n * @category Array\n */\nexport function length<T>(): (items: Enumerable<T>) => number;\n\nexport function length(...args: ReadonlyArray<unknown>): unknown {\n return curry(lengthImplementation, args);\n}\n\nfunction lengthImplementation<T>(items: Enumerable<T>): number {\n return 'length' in items ? items.length : [...items].length;\n}\n"],"mappings":"mCA6BA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"length.js","names":[],"sources":["../src/length.ts"],"sourcesContent":["import { curry } from './curry';\n\ntype Enumerable<T> = ArrayLike<T> | Iterable<T>;\n\n/**\n * Counts values of the collection or iterable.\n *\n * @param items - The input data.\n * @signature\n * length(array)\n * @example\n * length([1, 2, 3]) // => 3\n * @dataFirst\n * @category Array\n */\nexport function length<T>(items: Enumerable<T>): number;\n\n/**\n * Counts values of the collection or iterable.\n *\n * @signature\n * length()(array)\n * @example\n * pipe([1, 2, 3], length()) // => 3\n * @dataLast\n * @category Array\n */\nexport function length<T>(): (items: Enumerable<T>) => number;\n\nexport function length(...args: ReadonlyArray<unknown>): unknown {\n return curry(lengthImplementation, args);\n}\n\nfunction lengthImplementation<T>(items: Enumerable<T>): number {\n return 'length' in items ? items.length : [...items].length;\n}\n"],"mappings":"mCA6BA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,CAAI,CACzC,CAEA,SAAS,EAAwB,EAA8B,CAC7D,MAAO,WAAY,EAAQ,EAAM,OAAS,CAAC,GAAG,CAAK,CAAC,CAAC,MACvD"}
|
package/dist/map-keys.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(n,t)}function n(e,t){let n={};for(let[r,i]of Object.entries(e)){let a=t(r,i,e);n[a]=i}return n}exports.mapKeys=t;
|
|
2
2
|
//# sourceMappingURL=map-keys.cjs.map
|
package/dist/map-keys.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-keys.cjs","names":["curry"],"sources":["../src/map-keys.ts"],"sourcesContent":["/* eslint-disable ts/no-empty-object-type --\n * We want to match the typing of the built-in Object.entries as much as\n * possible!\n */\n\nimport type {
|
|
1
|
+
{"version":3,"file":"map-keys.cjs","names":["curry"],"sources":["../src/map-keys.ts"],"sourcesContent":["/* eslint-disable ts/no-empty-object-type --\n * We want to match the typing of the built-in Object.entries as much as\n * possible!\n */\n\nimport type { IsUnion } from 'type-fest';\nimport type { EnumerableStringKeyOf } from './internal/types/enumerable-string-key-of';\nimport type { EnumerableStringKeyedValueOf } from './internal/types/enumerable-string-keyed-value-of';\nimport type { IsBounded } from './internal/types/is-bounded';\nimport { curry } from './curry';\n\ntype MappedKeys<T, Key extends PropertyKey> = MaybePartial<\n T,\n Key,\n // We re-key `T` using `Key`, but because we can't infer at the type level\n // how the mapper would map each specific input key we assign all props the\n // same value, made of all possible values of `T`.\n Record<Key, EnumerableStringKeyedValueOf<T>>\n>;\n\n/**\n * This type is very similar to `BoundedPartial` simplified to the case where\n * we reconstruct the Record using a known `Key` type.\n *\n * @see BoundedPartial\n */\ntype MaybePartial<T, Key extends PropertyKey, Output>\n = IsBounded<Key> extends true\n ? // When keys are bounded we need to consider what assurances we can make\n // about the presence of keys in the output; mainly if there is more than\n // one possible result from the mapper (so we can't know what it would\n // return for a specific input, at the type level), or if object itself\n // might be empty and thus also the output object.\n IsUnion<Key> extends true\n ? Partial<Output>\n : CouldBeEmpty<T> extends true\n ? Partial<Output>\n : Output\n : // If keys are not bounded TypeScript treats the Record as implicitly\n // Partial so we don't need to do that here.\n Output;\n\n/**\n * Types that are extendable by `{}` are also satisfied by an empty object and\n * thus _could be empty_.\n */\ntype CouldBeEmpty<T> = {} extends T ? true : false;\n\n/**\n * Maps keys of `object` and keeps the same values.\n *\n * @param data - The object to map.\n * @param keyMapper - The mapping function.\n * @signature\n * mapKeys(object, fn)\n * @example\n * mapKeys({a: 1, b: 2}, (key, value) => key + value) // => { a1: 1, b2: 2 }\n * @dataFirst\n * @category Object\n */\nexport function mapKeys<T extends {}, Key extends PropertyKey>(\n data: T,\n keyMapper: (\n key: EnumerableStringKeyOf<T>,\n value: EnumerableStringKeyedValueOf<T>,\n data: T,\n ) => Key,\n): MappedKeys<T, Key>;\n\n/**\n * Maps keys of `object` and keeps the same values.\n *\n * @param keyMapper - The mapping function.\n * @signature\n * mapKeys(fn)(object)\n * @example\n * pipe({a: 1, b: 2}, mapKeys((key, value) => key + value)) // => { a1: 1, b2: 2 }\n * @dataLast\n * @category Object\n */\nexport function mapKeys<T extends {}, Key extends PropertyKey>(\n keyMapper: (\n key: EnumerableStringKeyOf<T>,\n value: EnumerableStringKeyedValueOf<T>,\n data: T,\n ) => Key,\n): (data: T) => MappedKeys<T, Key>;\n\nexport function mapKeys(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapKeysImplementation, args);\n}\n\nfunction mapKeysImplementation<T extends {}, Key extends PropertyKey>(\n data: T,\n keyMapper: (key: string, value: unknown, data: T) => Key,\n): Partial<Record<Key, unknown>> {\n const out: Partial<Record<Key, unknown>> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const mappedKey = keyMapper(key, value, data);\n out[mappedKey] = value;\n }\n\n return out;\n}\n"],"mappings":"kGAwFA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAOA,EAAAA,MAAM,EAAuB,CAAI,CAC1C,CAEA,SAAS,EACP,EACA,EAC+B,CAC/B,IAAM,EAAqC,CAAC,EAE5C,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAI,EAAG,CAC/C,IAAM,EAAY,EAAU,EAAK,EAAO,CAAI,EAC5C,EAAI,GAAa,CACnB,CAEA,OAAO,CACT"}
|
package/dist/map-keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-keys.js","names":[],"sources":["../src/map-keys.ts"],"sourcesContent":["/* eslint-disable ts/no-empty-object-type --\n * We want to match the typing of the built-in Object.entries as much as\n * possible!\n */\n\nimport type {
|
|
1
|
+
{"version":3,"file":"map-keys.js","names":[],"sources":["../src/map-keys.ts"],"sourcesContent":["/* eslint-disable ts/no-empty-object-type --\n * We want to match the typing of the built-in Object.entries as much as\n * possible!\n */\n\nimport type { IsUnion } from 'type-fest';\nimport type { EnumerableStringKeyOf } from './internal/types/enumerable-string-key-of';\nimport type { EnumerableStringKeyedValueOf } from './internal/types/enumerable-string-keyed-value-of';\nimport type { IsBounded } from './internal/types/is-bounded';\nimport { curry } from './curry';\n\ntype MappedKeys<T, Key extends PropertyKey> = MaybePartial<\n T,\n Key,\n // We re-key `T` using `Key`, but because we can't infer at the type level\n // how the mapper would map each specific input key we assign all props the\n // same value, made of all possible values of `T`.\n Record<Key, EnumerableStringKeyedValueOf<T>>\n>;\n\n/**\n * This type is very similar to `BoundedPartial` simplified to the case where\n * we reconstruct the Record using a known `Key` type.\n *\n * @see BoundedPartial\n */\ntype MaybePartial<T, Key extends PropertyKey, Output>\n = IsBounded<Key> extends true\n ? // When keys are bounded we need to consider what assurances we can make\n // about the presence of keys in the output; mainly if there is more than\n // one possible result from the mapper (so we can't know what it would\n // return for a specific input, at the type level), or if object itself\n // might be empty and thus also the output object.\n IsUnion<Key> extends true\n ? Partial<Output>\n : CouldBeEmpty<T> extends true\n ? Partial<Output>\n : Output\n : // If keys are not bounded TypeScript treats the Record as implicitly\n // Partial so we don't need to do that here.\n Output;\n\n/**\n * Types that are extendable by `{}` are also satisfied by an empty object and\n * thus _could be empty_.\n */\ntype CouldBeEmpty<T> = {} extends T ? true : false;\n\n/**\n * Maps keys of `object` and keeps the same values.\n *\n * @param data - The object to map.\n * @param keyMapper - The mapping function.\n * @signature\n * mapKeys(object, fn)\n * @example\n * mapKeys({a: 1, b: 2}, (key, value) => key + value) // => { a1: 1, b2: 2 }\n * @dataFirst\n * @category Object\n */\nexport function mapKeys<T extends {}, Key extends PropertyKey>(\n data: T,\n keyMapper: (\n key: EnumerableStringKeyOf<T>,\n value: EnumerableStringKeyedValueOf<T>,\n data: T,\n ) => Key,\n): MappedKeys<T, Key>;\n\n/**\n * Maps keys of `object` and keeps the same values.\n *\n * @param keyMapper - The mapping function.\n * @signature\n * mapKeys(fn)(object)\n * @example\n * pipe({a: 1, b: 2}, mapKeys((key, value) => key + value)) // => { a1: 1, b2: 2 }\n * @dataLast\n * @category Object\n */\nexport function mapKeys<T extends {}, Key extends PropertyKey>(\n keyMapper: (\n key: EnumerableStringKeyOf<T>,\n value: EnumerableStringKeyedValueOf<T>,\n data: T,\n ) => Key,\n): (data: T) => MappedKeys<T, Key>;\n\nexport function mapKeys(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapKeysImplementation, args);\n}\n\nfunction mapKeysImplementation<T extends {}, Key extends PropertyKey>(\n data: T,\n keyMapper: (key: string, value: unknown, data: T) => Key,\n): Partial<Record<Key, unknown>> {\n const out: Partial<Record<Key, unknown>> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const mappedKey = keyMapper(key, value, data);\n out[mappedKey] = value;\n }\n\n return out;\n}\n"],"mappings":"mCAwFA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAO,EAAM,EAAuB,CAAI,CAC1C,CAEA,SAAS,EACP,EACA,EAC+B,CAC/B,IAAM,EAAqC,CAAC,EAE5C,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAI,EAAG,CAC/C,IAAM,EAAY,EAAU,EAAK,EAAO,CAAI,EAC5C,EAAI,GAAa,CACnB,CAEA,OAAO,CACT"}
|
package/dist/map-to-obj.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(n,t)}function n(e,t){let n={};for(let[r,i]of e.entries()){let[a,o]=t(i,r,e);n[a]=o}return n}exports.mapToObj=t;
|
|
2
2
|
//# sourceMappingURL=map-to-obj.cjs.map
|
package/dist/map-to-obj.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-to-obj.cjs","names":["curry"],"sources":["../src/map-to-obj.ts"],"sourcesContent":["import { curry } from './curry';\n\n// TODO [>2]: Once we allow fromEntries to run lazily on iterables we need to remove this utility as it's completely replaceable by `fromEntries(map(...))`.\n/**\n * Map each element of an array into an object using a defined mapper that\n * converts each item into an object entry (a tuple of `[<key>, <value>]`).\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * - `fromKeys` - Builds an object from an array of *keys* and a mapper for\n * values.\n * - `indexBy` - Builds an object from an array of *values* and a mapper for\n * keys.\n * - `pullObject` - Builds an object from an array of items with a mapper for\n * values and another mapper for keys.\n * - `fromEntries` - Builds an object from an array of key-value pairs.\n *\n * **Warning**: We strongly advise against using this function unless it is\n * used with a huge input array and your app has stringent memory/gc\n * constraints. We recommend that in most cases you should use `pullObject`,\n * or the composition `fromEntries(map(array, fn))`. This function will be\n * deprecated and **removed** in future versions of the library!\n *\n * @param array - The array to map.\n * @param fn - The mapping function, which should return a tuple of [key, value], similar to Object.fromEntries.\n * @returns The new mapped object.\n * @signature\n * mapToObj(array, fn)\n * @example\n * mapToObj([1, 2, 3], x => [String(x), x * 2]) // => {1: 2, 2: 4, 3: 6}\n * @dataFirst\n * @category Array\n */\nexport function mapToObj<T, K extends PropertyKey, V>(\n array: ReadonlyArray<T>,\n fn: (value: T, index: number, data: ReadonlyArray<T>) => [K, V],\n): Record<K, V>;\n\n// TODO [>2]: Once we allow fromEntries to run lazily on iterables we need to remove this utility as it's completely replaceable by `fromEntries(map(...))`.\n/**\n * Map each element of an array into an object using a defined mapper that\n * converts each item into an object entry (a tuple of `[<key>, <value>]`).\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * - `fromKeys` - Builds an object from an array of *keys* and a mapper for\n * values.\n * - `indexBy` - Builds an object from an array of *values* and a mapper for\n * keys.\n * - `pullObject` - Builds an object from an array of items with a mapper for\n * values and another mapper for keys.\n * - `fromEntries` - Builds an object from an array of key-value pairs.\n *\n * **Warning**: We strongly advise against using this function unless it is\n * used with a huge input array and your app has stringent memory/gc\n * constraints. We recommend that in most cases you should use `pullObject`,\n * or the composition `fromEntries(map(array, fn))`. This function will be\n * deprecated and **removed** in future versions of the library!\n *\n * @param fn - The mapping function, which should return a tuple of [key, value], similar to Object.fromEntries.\n * @returns The new mapped object.\n * @signature\n * mapToObj(fn)(array)\n * @example\n * pipe(\n * [1, 2, 3],\n * mapToObj(x => [String(x), x * 2])\n * ) // => {1: 2, 2: 4, 3: 6}\n * @dataLast\n * @category Array\n */\nexport function mapToObj<T, K extends PropertyKey, V>(\n fn: (value: T, index: number, data: ReadonlyArray<T>) => [K, V],\n): (array: ReadonlyArray<T>) => Record<K, V>;\n\nexport function mapToObj(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapToObjImplementation, args);\n}\n\nfunction mapToObjImplementation(\n array: ReadonlyArray<unknown>,\n fn: (\n value: unknown,\n index: number,\n data: ReadonlyArray<unknown>,\n ) => [PropertyKey, unknown],\n): Record<PropertyKey, unknown> {\n const out: Record<PropertyKey, unknown> = {};\n\n for (const [index, element] of array.entries()) {\n const [key, value] = fn(element, index, array);\n out[key] = value;\n }\n\n return out;\n}\n"],"mappings":"kGA2EA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAOA,EAAAA,MAAM,EAAwB,
|
|
1
|
+
{"version":3,"file":"map-to-obj.cjs","names":["curry"],"sources":["../src/map-to-obj.ts"],"sourcesContent":["import { curry } from './curry';\n\n// TODO [>2]: Once we allow fromEntries to run lazily on iterables we need to remove this utility as it's completely replaceable by `fromEntries(map(...))`.\n/**\n * Map each element of an array into an object using a defined mapper that\n * converts each item into an object entry (a tuple of `[<key>, <value>]`).\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * - `fromKeys` - Builds an object from an array of *keys* and a mapper for\n * values.\n * - `indexBy` - Builds an object from an array of *values* and a mapper for\n * keys.\n * - `pullObject` - Builds an object from an array of items with a mapper for\n * values and another mapper for keys.\n * - `fromEntries` - Builds an object from an array of key-value pairs.\n *\n * **Warning**: We strongly advise against using this function unless it is\n * used with a huge input array and your app has stringent memory/gc\n * constraints. We recommend that in most cases you should use `pullObject`,\n * or the composition `fromEntries(map(array, fn))`. This function will be\n * deprecated and **removed** in future versions of the library!\n *\n * @param array - The array to map.\n * @param fn - The mapping function, which should return a tuple of [key, value], similar to Object.fromEntries.\n * @returns The new mapped object.\n * @signature\n * mapToObj(array, fn)\n * @example\n * mapToObj([1, 2, 3], x => [String(x), x * 2]) // => {1: 2, 2: 4, 3: 6}\n * @dataFirst\n * @category Array\n */\nexport function mapToObj<T, K extends PropertyKey, V>(\n array: ReadonlyArray<T>,\n fn: (value: T, index: number, data: ReadonlyArray<T>) => [K, V],\n): Record<K, V>;\n\n// TODO [>2]: Once we allow fromEntries to run lazily on iterables we need to remove this utility as it's completely replaceable by `fromEntries(map(...))`.\n/**\n * Map each element of an array into an object using a defined mapper that\n * converts each item into an object entry (a tuple of `[<key>, <value>]`).\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * - `fromKeys` - Builds an object from an array of *keys* and a mapper for\n * values.\n * - `indexBy` - Builds an object from an array of *values* and a mapper for\n * keys.\n * - `pullObject` - Builds an object from an array of items with a mapper for\n * values and another mapper for keys.\n * - `fromEntries` - Builds an object from an array of key-value pairs.\n *\n * **Warning**: We strongly advise against using this function unless it is\n * used with a huge input array and your app has stringent memory/gc\n * constraints. We recommend that in most cases you should use `pullObject`,\n * or the composition `fromEntries(map(array, fn))`. This function will be\n * deprecated and **removed** in future versions of the library!\n *\n * @param fn - The mapping function, which should return a tuple of [key, value], similar to Object.fromEntries.\n * @returns The new mapped object.\n * @signature\n * mapToObj(fn)(array)\n * @example\n * pipe(\n * [1, 2, 3],\n * mapToObj(x => [String(x), x * 2])\n * ) // => {1: 2, 2: 4, 3: 6}\n * @dataLast\n * @category Array\n */\nexport function mapToObj<T, K extends PropertyKey, V>(\n fn: (value: T, index: number, data: ReadonlyArray<T>) => [K, V],\n): (array: ReadonlyArray<T>) => Record<K, V>;\n\nexport function mapToObj(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapToObjImplementation, args);\n}\n\nfunction mapToObjImplementation(\n array: ReadonlyArray<unknown>,\n fn: (\n value: unknown,\n index: number,\n data: ReadonlyArray<unknown>,\n ) => [PropertyKey, unknown],\n): Record<PropertyKey, unknown> {\n const out: Record<PropertyKey, unknown> = {};\n\n for (const [index, element] of array.entries()) {\n const [key, value] = fn(element, index, array);\n out[key] = value;\n }\n\n return out;\n}\n"],"mappings":"kGA2EA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAOA,EAAAA,MAAM,EAAwB,CAAI,CAC3C,CAEA,SAAS,EACP,EACA,EAK8B,CAC9B,IAAM,EAAoC,CAAC,EAE3C,IAAK,GAAM,CAAC,EAAO,KAAY,EAAM,QAAQ,EAAG,CAC9C,GAAM,CAAC,EAAK,GAAS,EAAG,EAAS,EAAO,CAAK,EAC7C,EAAI,GAAO,CACb,CAEA,OAAO,CACT"}
|
package/dist/map-to-obj.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-to-obj.js","names":[],"sources":["../src/map-to-obj.ts"],"sourcesContent":["import { curry } from './curry';\n\n// TODO [>2]: Once we allow fromEntries to run lazily on iterables we need to remove this utility as it's completely replaceable by `fromEntries(map(...))`.\n/**\n * Map each element of an array into an object using a defined mapper that\n * converts each item into an object entry (a tuple of `[<key>, <value>]`).\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * - `fromKeys` - Builds an object from an array of *keys* and a mapper for\n * values.\n * - `indexBy` - Builds an object from an array of *values* and a mapper for\n * keys.\n * - `pullObject` - Builds an object from an array of items with a mapper for\n * values and another mapper for keys.\n * - `fromEntries` - Builds an object from an array of key-value pairs.\n *\n * **Warning**: We strongly advise against using this function unless it is\n * used with a huge input array and your app has stringent memory/gc\n * constraints. We recommend that in most cases you should use `pullObject`,\n * or the composition `fromEntries(map(array, fn))`. This function will be\n * deprecated and **removed** in future versions of the library!\n *\n * @param array - The array to map.\n * @param fn - The mapping function, which should return a tuple of [key, value], similar to Object.fromEntries.\n * @returns The new mapped object.\n * @signature\n * mapToObj(array, fn)\n * @example\n * mapToObj([1, 2, 3], x => [String(x), x * 2]) // => {1: 2, 2: 4, 3: 6}\n * @dataFirst\n * @category Array\n */\nexport function mapToObj<T, K extends PropertyKey, V>(\n array: ReadonlyArray<T>,\n fn: (value: T, index: number, data: ReadonlyArray<T>) => [K, V],\n): Record<K, V>;\n\n// TODO [>2]: Once we allow fromEntries to run lazily on iterables we need to remove this utility as it's completely replaceable by `fromEntries(map(...))`.\n/**\n * Map each element of an array into an object using a defined mapper that\n * converts each item into an object entry (a tuple of `[<key>, <value>]`).\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * - `fromKeys` - Builds an object from an array of *keys* and a mapper for\n * values.\n * - `indexBy` - Builds an object from an array of *values* and a mapper for\n * keys.\n * - `pullObject` - Builds an object from an array of items with a mapper for\n * values and another mapper for keys.\n * - `fromEntries` - Builds an object from an array of key-value pairs.\n *\n * **Warning**: We strongly advise against using this function unless it is\n * used with a huge input array and your app has stringent memory/gc\n * constraints. We recommend that in most cases you should use `pullObject`,\n * or the composition `fromEntries(map(array, fn))`. This function will be\n * deprecated and **removed** in future versions of the library!\n *\n * @param fn - The mapping function, which should return a tuple of [key, value], similar to Object.fromEntries.\n * @returns The new mapped object.\n * @signature\n * mapToObj(fn)(array)\n * @example\n * pipe(\n * [1, 2, 3],\n * mapToObj(x => [String(x), x * 2])\n * ) // => {1: 2, 2: 4, 3: 6}\n * @dataLast\n * @category Array\n */\nexport function mapToObj<T, K extends PropertyKey, V>(\n fn: (value: T, index: number, data: ReadonlyArray<T>) => [K, V],\n): (array: ReadonlyArray<T>) => Record<K, V>;\n\nexport function mapToObj(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapToObjImplementation, args);\n}\n\nfunction mapToObjImplementation(\n array: ReadonlyArray<unknown>,\n fn: (\n value: unknown,\n index: number,\n data: ReadonlyArray<unknown>,\n ) => [PropertyKey, unknown],\n): Record<PropertyKey, unknown> {\n const out: Record<PropertyKey, unknown> = {};\n\n for (const [index, element] of array.entries()) {\n const [key, value] = fn(element, index, array);\n out[key] = value;\n }\n\n return out;\n}\n"],"mappings":"mCA2EA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAO,EAAM,EAAwB,
|
|
1
|
+
{"version":3,"file":"map-to-obj.js","names":[],"sources":["../src/map-to-obj.ts"],"sourcesContent":["import { curry } from './curry';\n\n// TODO [>2]: Once we allow fromEntries to run lazily on iterables we need to remove this utility as it's completely replaceable by `fromEntries(map(...))`.\n/**\n * Map each element of an array into an object using a defined mapper that\n * converts each item into an object entry (a tuple of `[<key>, <value>]`).\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * - `fromKeys` - Builds an object from an array of *keys* and a mapper for\n * values.\n * - `indexBy` - Builds an object from an array of *values* and a mapper for\n * keys.\n * - `pullObject` - Builds an object from an array of items with a mapper for\n * values and another mapper for keys.\n * - `fromEntries` - Builds an object from an array of key-value pairs.\n *\n * **Warning**: We strongly advise against using this function unless it is\n * used with a huge input array and your app has stringent memory/gc\n * constraints. We recommend that in most cases you should use `pullObject`,\n * or the composition `fromEntries(map(array, fn))`. This function will be\n * deprecated and **removed** in future versions of the library!\n *\n * @param array - The array to map.\n * @param fn - The mapping function, which should return a tuple of [key, value], similar to Object.fromEntries.\n * @returns The new mapped object.\n * @signature\n * mapToObj(array, fn)\n * @example\n * mapToObj([1, 2, 3], x => [String(x), x * 2]) // => {1: 2, 2: 4, 3: 6}\n * @dataFirst\n * @category Array\n */\nexport function mapToObj<T, K extends PropertyKey, V>(\n array: ReadonlyArray<T>,\n fn: (value: T, index: number, data: ReadonlyArray<T>) => [K, V],\n): Record<K, V>;\n\n// TODO [>2]: Once we allow fromEntries to run lazily on iterables we need to remove this utility as it's completely replaceable by `fromEntries(map(...))`.\n/**\n * Map each element of an array into an object using a defined mapper that\n * converts each item into an object entry (a tuple of `[<key>, <value>]`).\n *\n * There are several other functions that could be used to build an object from\n * an array:\n * - `fromKeys` - Builds an object from an array of *keys* and a mapper for\n * values.\n * - `indexBy` - Builds an object from an array of *values* and a mapper for\n * keys.\n * - `pullObject` - Builds an object from an array of items with a mapper for\n * values and another mapper for keys.\n * - `fromEntries` - Builds an object from an array of key-value pairs.\n *\n * **Warning**: We strongly advise against using this function unless it is\n * used with a huge input array and your app has stringent memory/gc\n * constraints. We recommend that in most cases you should use `pullObject`,\n * or the composition `fromEntries(map(array, fn))`. This function will be\n * deprecated and **removed** in future versions of the library!\n *\n * @param fn - The mapping function, which should return a tuple of [key, value], similar to Object.fromEntries.\n * @returns The new mapped object.\n * @signature\n * mapToObj(fn)(array)\n * @example\n * pipe(\n * [1, 2, 3],\n * mapToObj(x => [String(x), x * 2])\n * ) // => {1: 2, 2: 4, 3: 6}\n * @dataLast\n * @category Array\n */\nexport function mapToObj<T, K extends PropertyKey, V>(\n fn: (value: T, index: number, data: ReadonlyArray<T>) => [K, V],\n): (array: ReadonlyArray<T>) => Record<K, V>;\n\nexport function mapToObj(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapToObjImplementation, args);\n}\n\nfunction mapToObjImplementation(\n array: ReadonlyArray<unknown>,\n fn: (\n value: unknown,\n index: number,\n data: ReadonlyArray<unknown>,\n ) => [PropertyKey, unknown],\n): Record<PropertyKey, unknown> {\n const out: Record<PropertyKey, unknown> = {};\n\n for (const [index, element] of array.entries()) {\n const [key, value] = fn(element, index, array);\n out[key] = value;\n }\n\n return out;\n}\n"],"mappings":"mCA2EA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAO,EAAM,EAAwB,CAAI,CAC3C,CAEA,SAAS,EACP,EACA,EAK8B,CAC9B,IAAM,EAAoC,CAAC,EAE3C,IAAK,GAAM,CAAC,EAAO,KAAY,EAAM,QAAQ,EAAG,CAC9C,GAAM,CAAC,EAAK,GAAS,EAAG,EAAS,EAAO,CAAK,EAC7C,EAAI,GAAO,CACb,CAEA,OAAO,CACT"}
|
package/dist/map-values.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(n,t)}function n(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]=t(i,r,e);return n}exports.mapValues=t;
|
|
2
2
|
//# sourceMappingURL=map-values.cjs.map
|
package/dist/map-values.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-values.cjs","names":["curry"],"sources":["../src/map-values.ts"],"sourcesContent":["import type { Simplify } from 'type-fest';\nimport type { EnumerableStringKeyOf } from './internal/types/enumerable-string-key-of';\nimport type { EnumerableStringKeyedValueOf } from './internal/types/enumerable-string-keyed-value-of';\nimport { curry } from './curry';\n\ntype MappedValues<T extends object, Value> = Simplify<{\n -readonly [P in keyof T as P extends number | string ? P : never]: Value;\n}>;\n\n/**\n * Maps values of `object` and keeps the same keys. Symbol keys are not passed\n * to the mapper and will be removed from the output object.\n *\n * To also copy the symbol keys to the output use merge:\n * `merge(data, mapValues(data, mapper))`).\n *\n * @param data - The object to map.\n * @param valueMapper - The mapping function.\n * @signature\n * mapValues(data, mapper)\n * @example\n * mapValues({a: 1, b: 2}, (value, key) => value + key) // => {a: '1a', b: '2b'}\n * @dataFirst\n * @category Object\n */\nexport function mapValues<T extends object, Value>(\n data: T,\n valueMapper: (\n value: EnumerableStringKeyedValueOf<T>,\n key: EnumerableStringKeyOf<T>,\n data: T,\n ) => Value,\n): MappedValues<T, Value>;\n\n/**\n * Maps values of `object` and keeps the same keys. Symbol keys are not passed\n * to the mapper and will be removed from the output object.\n *\n * To also copy the symbol keys to the output use merge:\n * `merge(data, mapValues(data, mapper))`).\n *\n * @param valueMapper - The mapping function.\n * @signature\n * mapValues(mapper)(data)\n * @example\n * pipe({a: 1, b: 2}, mapValues((value, key) => value + key)) // => {a: '1a', b: '2b'}\n * @dataLast\n * @category Object\n */\nexport function mapValues<T extends object, Value>(\n valueMapper: (\n value: EnumerableStringKeyedValueOf<T>,\n key: EnumerableStringKeyOf<T>,\n data: T,\n ) => Value,\n): (data: T) => MappedValues<T, Value>;\n\nexport function mapValues(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapValuesImplementation, args);\n}\n\nfunction mapValuesImplementation<T extends object, Value>(\n data: T,\n valueMapper: (value: unknown, key: string, data: T) => Value,\n): Record<string, Value> {\n const out: Record<string, Value> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const mappedValue = valueMapper(value, key, data);\n out[key] = mappedValue;\n }\n\n return out;\n}\n"],"mappings":"kGAyDA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAOA,EAAAA,MAAM,EAAyB,
|
|
1
|
+
{"version":3,"file":"map-values.cjs","names":["curry"],"sources":["../src/map-values.ts"],"sourcesContent":["import type { Simplify } from 'type-fest';\nimport type { EnumerableStringKeyOf } from './internal/types/enumerable-string-key-of';\nimport type { EnumerableStringKeyedValueOf } from './internal/types/enumerable-string-keyed-value-of';\nimport { curry } from './curry';\n\ntype MappedValues<T extends object, Value> = Simplify<{\n -readonly [P in keyof T as P extends number | string ? P : never]: Value;\n}>;\n\n/**\n * Maps values of `object` and keeps the same keys. Symbol keys are not passed\n * to the mapper and will be removed from the output object.\n *\n * To also copy the symbol keys to the output use merge:\n * `merge(data, mapValues(data, mapper))`).\n *\n * @param data - The object to map.\n * @param valueMapper - The mapping function.\n * @signature\n * mapValues(data, mapper)\n * @example\n * mapValues({a: 1, b: 2}, (value, key) => value + key) // => {a: '1a', b: '2b'}\n * @dataFirst\n * @category Object\n */\nexport function mapValues<T extends object, Value>(\n data: T,\n valueMapper: (\n value: EnumerableStringKeyedValueOf<T>,\n key: EnumerableStringKeyOf<T>,\n data: T,\n ) => Value,\n): MappedValues<T, Value>;\n\n/**\n * Maps values of `object` and keeps the same keys. Symbol keys are not passed\n * to the mapper and will be removed from the output object.\n *\n * To also copy the symbol keys to the output use merge:\n * `merge(data, mapValues(data, mapper))`).\n *\n * @param valueMapper - The mapping function.\n * @signature\n * mapValues(mapper)(data)\n * @example\n * pipe({a: 1, b: 2}, mapValues((value, key) => value + key)) // => {a: '1a', b: '2b'}\n * @dataLast\n * @category Object\n */\nexport function mapValues<T extends object, Value>(\n valueMapper: (\n value: EnumerableStringKeyedValueOf<T>,\n key: EnumerableStringKeyOf<T>,\n data: T,\n ) => Value,\n): (data: T) => MappedValues<T, Value>;\n\nexport function mapValues(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapValuesImplementation, args);\n}\n\nfunction mapValuesImplementation<T extends object, Value>(\n data: T,\n valueMapper: (value: unknown, key: string, data: T) => Value,\n): Record<string, Value> {\n const out: Record<string, Value> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const mappedValue = valueMapper(value, key, data);\n out[key] = mappedValue;\n }\n\n return out;\n}\n"],"mappings":"kGAyDA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAOA,EAAAA,MAAM,EAAyB,CAAI,CAC5C,CAEA,SAAS,EACP,EACA,EACuB,CACvB,IAAM,EAA6B,CAAC,EAEpC,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAI,EAE5C,EAAI,GADgB,EAAY,EAAO,EAAK,CACvB,EAGvB,OAAO,CACT"}
|
package/dist/map-values.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-values.js","names":[],"sources":["../src/map-values.ts"],"sourcesContent":["import type { Simplify } from 'type-fest';\nimport type { EnumerableStringKeyOf } from './internal/types/enumerable-string-key-of';\nimport type { EnumerableStringKeyedValueOf } from './internal/types/enumerable-string-keyed-value-of';\nimport { curry } from './curry';\n\ntype MappedValues<T extends object, Value> = Simplify<{\n -readonly [P in keyof T as P extends number | string ? P : never]: Value;\n}>;\n\n/**\n * Maps values of `object` and keeps the same keys. Symbol keys are not passed\n * to the mapper and will be removed from the output object.\n *\n * To also copy the symbol keys to the output use merge:\n * `merge(data, mapValues(data, mapper))`).\n *\n * @param data - The object to map.\n * @param valueMapper - The mapping function.\n * @signature\n * mapValues(data, mapper)\n * @example\n * mapValues({a: 1, b: 2}, (value, key) => value + key) // => {a: '1a', b: '2b'}\n * @dataFirst\n * @category Object\n */\nexport function mapValues<T extends object, Value>(\n data: T,\n valueMapper: (\n value: EnumerableStringKeyedValueOf<T>,\n key: EnumerableStringKeyOf<T>,\n data: T,\n ) => Value,\n): MappedValues<T, Value>;\n\n/**\n * Maps values of `object` and keeps the same keys. Symbol keys are not passed\n * to the mapper and will be removed from the output object.\n *\n * To also copy the symbol keys to the output use merge:\n * `merge(data, mapValues(data, mapper))`).\n *\n * @param valueMapper - The mapping function.\n * @signature\n * mapValues(mapper)(data)\n * @example\n * pipe({a: 1, b: 2}, mapValues((value, key) => value + key)) // => {a: '1a', b: '2b'}\n * @dataLast\n * @category Object\n */\nexport function mapValues<T extends object, Value>(\n valueMapper: (\n value: EnumerableStringKeyedValueOf<T>,\n key: EnumerableStringKeyOf<T>,\n data: T,\n ) => Value,\n): (data: T) => MappedValues<T, Value>;\n\nexport function mapValues(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapValuesImplementation, args);\n}\n\nfunction mapValuesImplementation<T extends object, Value>(\n data: T,\n valueMapper: (value: unknown, key: string, data: T) => Value,\n): Record<string, Value> {\n const out: Record<string, Value> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const mappedValue = valueMapper(value, key, data);\n out[key] = mappedValue;\n }\n\n return out;\n}\n"],"mappings":"mCAyDA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAO,EAAM,EAAyB,
|
|
1
|
+
{"version":3,"file":"map-values.js","names":[],"sources":["../src/map-values.ts"],"sourcesContent":["import type { Simplify } from 'type-fest';\nimport type { EnumerableStringKeyOf } from './internal/types/enumerable-string-key-of';\nimport type { EnumerableStringKeyedValueOf } from './internal/types/enumerable-string-keyed-value-of';\nimport { curry } from './curry';\n\ntype MappedValues<T extends object, Value> = Simplify<{\n -readonly [P in keyof T as P extends number | string ? P : never]: Value;\n}>;\n\n/**\n * Maps values of `object` and keeps the same keys. Symbol keys are not passed\n * to the mapper and will be removed from the output object.\n *\n * To also copy the symbol keys to the output use merge:\n * `merge(data, mapValues(data, mapper))`).\n *\n * @param data - The object to map.\n * @param valueMapper - The mapping function.\n * @signature\n * mapValues(data, mapper)\n * @example\n * mapValues({a: 1, b: 2}, (value, key) => value + key) // => {a: '1a', b: '2b'}\n * @dataFirst\n * @category Object\n */\nexport function mapValues<T extends object, Value>(\n data: T,\n valueMapper: (\n value: EnumerableStringKeyedValueOf<T>,\n key: EnumerableStringKeyOf<T>,\n data: T,\n ) => Value,\n): MappedValues<T, Value>;\n\n/**\n * Maps values of `object` and keeps the same keys. Symbol keys are not passed\n * to the mapper and will be removed from the output object.\n *\n * To also copy the symbol keys to the output use merge:\n * `merge(data, mapValues(data, mapper))`).\n *\n * @param valueMapper - The mapping function.\n * @signature\n * mapValues(mapper)(data)\n * @example\n * pipe({a: 1, b: 2}, mapValues((value, key) => value + key)) // => {a: '1a', b: '2b'}\n * @dataLast\n * @category Object\n */\nexport function mapValues<T extends object, Value>(\n valueMapper: (\n value: EnumerableStringKeyedValueOf<T>,\n key: EnumerableStringKeyOf<T>,\n data: T,\n ) => Value,\n): (data: T) => MappedValues<T, Value>;\n\nexport function mapValues(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapValuesImplementation, args);\n}\n\nfunction mapValuesImplementation<T extends object, Value>(\n data: T,\n valueMapper: (value: unknown, key: string, data: T) => Value,\n): Record<string, Value> {\n const out: Record<string, Value> = {};\n\n for (const [key, value] of Object.entries(data)) {\n const mappedValue = valueMapper(value, key, data);\n out[key] = mappedValue;\n }\n\n return out;\n}\n"],"mappings":"mCAyDA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAO,EAAM,EAAyB,CAAI,CAC5C,CAEA,SAAS,EACP,EACA,EACuB,CACvB,IAAM,EAA6B,CAAC,EAEpC,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAI,EAE5C,EAAI,GADgB,EAAY,EAAO,EAAK,CACvB,EAGvB,OAAO,CACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry-from-lazy-mdjeRP1g.cjs");function t(...t){return e.t(n,t)}function n(e,t){let n=t;return(t,r,i)=>(n=e(n,t,r,i),{done:!1,hasNext:!0,next:n})}exports.mapWithFeedback=t;
|
|
2
2
|
//# sourceMappingURL=map-with-feedback.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-with-feedback.cjs","names":["curryFromLazy"],"sources":["../src/map-with-feedback.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { Mapped } from './internal/types/mapped';\nimport { curryFromLazy } from './internal/curry-from-lazy';\n\n/**\n * Applies a function on each element of the array, using the result of the\n * previous application, and returns an array of the successively computed\n * values.\n *\n * @param data - The array to map over.\n * @param callbackfn - The callback function that receives the previous value,\n * the current element.\n * @param initialValue - The initial value to start the computation with.\n * @returns An array of successively computed values from the left side of the\n * array.\n * @signature\n * mapWithFeedback(data, callbackfn, initialValue);\n * @example\n * mapWithFeedback(\n * [1, 2, 3, 4, 5],\n * (prev, x) => prev + x,\n * 100,\n * ); // => [101, 103, 106, 110, 115]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function mapWithFeedback<T extends IterableContainer, U>(\n data: T,\n callbackfn: (\n previousValue: U,\n currentValue: T[number],\n currentIndex: number,\n data: T,\n ) => U,\n initialValue: U,\n): Mapped<T, U>;\n\n/**\n * Applies a function on each element of the array, using the result of the\n * previous application, and returns an array of the successively computed\n * values.\n *\n * @param callbackfn - The callback function that receives the previous value,\n * the current element.\n * @param initialValue - The initial value to start the computation with.\n * @returns An array of successively computed values from the left side of the\n * array.\n * @signature\n * mapWithFeedback(callbackfn, initialValue)(data);\n * @example\n * pipe(\n * [1, 2, 3, 4, 5],\n * mapWithFeedback((prev, x) => prev + x, 100),\n * ); // => [101, 103, 106, 110, 115]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function mapWithFeedback<T extends IterableContainer, U>(\n callbackfn: (\n previousValue: U,\n currentValue: T[number],\n currentIndex: number,\n data: T,\n ) => U,\n initialValue: U,\n): (data: T) => Mapped<T, U>;\n\nexport function mapWithFeedback(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, U>(reducer: (\n previousValue: U,\n currentValue: T,\n index: number,\n data: ReadonlyArray<T>,\n) => U, initialValue: U): LazyEvaluator<T, U> {\n let previousValue = initialValue;\n return (currentValue, index, data) => {\n previousValue = reducer(previousValue, currentValue, index, data);\n return { done: false, hasNext: true, next: previousValue };\n };\n}\n"],"mappings":"qHAsEA,SAAgB,EAAgB,GAAG,EAAuC,CACxE,OAAOA,EAAAA,EAAc,EAAoB,
|
|
1
|
+
{"version":3,"file":"map-with-feedback.cjs","names":["curryFromLazy"],"sources":["../src/map-with-feedback.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { Mapped } from './internal/types/mapped';\nimport { curryFromLazy } from './internal/curry-from-lazy';\n\n/**\n * Applies a function on each element of the array, using the result of the\n * previous application, and returns an array of the successively computed\n * values.\n *\n * @param data - The array to map over.\n * @param callbackfn - The callback function that receives the previous value,\n * the current element.\n * @param initialValue - The initial value to start the computation with.\n * @returns An array of successively computed values from the left side of the\n * array.\n * @signature\n * mapWithFeedback(data, callbackfn, initialValue);\n * @example\n * mapWithFeedback(\n * [1, 2, 3, 4, 5],\n * (prev, x) => prev + x,\n * 100,\n * ); // => [101, 103, 106, 110, 115]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function mapWithFeedback<T extends IterableContainer, U>(\n data: T,\n callbackfn: (\n previousValue: U,\n currentValue: T[number],\n currentIndex: number,\n data: T,\n ) => U,\n initialValue: U,\n): Mapped<T, U>;\n\n/**\n * Applies a function on each element of the array, using the result of the\n * previous application, and returns an array of the successively computed\n * values.\n *\n * @param callbackfn - The callback function that receives the previous value,\n * the current element.\n * @param initialValue - The initial value to start the computation with.\n * @returns An array of successively computed values from the left side of the\n * array.\n * @signature\n * mapWithFeedback(callbackfn, initialValue)(data);\n * @example\n * pipe(\n * [1, 2, 3, 4, 5],\n * mapWithFeedback((prev, x) => prev + x, 100),\n * ); // => [101, 103, 106, 110, 115]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function mapWithFeedback<T extends IterableContainer, U>(\n callbackfn: (\n previousValue: U,\n currentValue: T[number],\n currentIndex: number,\n data: T,\n ) => U,\n initialValue: U,\n): (data: T) => Mapped<T, U>;\n\nexport function mapWithFeedback(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, U>(reducer: (\n previousValue: U,\n currentValue: T,\n index: number,\n data: ReadonlyArray<T>,\n) => U, initialValue: U): LazyEvaluator<T, U> {\n let previousValue = initialValue;\n return (currentValue, index, data) => {\n previousValue = reducer(previousValue, currentValue, index, data);\n return { done: false, hasNext: true, next: previousValue };\n };\n}\n"],"mappings":"qHAsEA,SAAgB,EAAgB,GAAG,EAAuC,CACxE,OAAOA,EAAAA,EAAc,EAAoB,CAAI,CAC/C,CAEA,SAAS,EAAyB,EAK1B,EAAsC,CAC5C,IAAI,EAAgB,EACpB,OAAQ,EAAc,EAAO,KAC3B,EAAgB,EAAQ,EAAe,EAAc,EAAO,CAAI,EACzD,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,CAAc,EAE7D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./curry-from-lazy-
|
|
1
|
+
import{t as e}from"./curry-from-lazy-BoPMn2L_.js";function t(...t){return e(n,t)}function n(e,t){let n=t;return(t,r,i)=>(n=e(n,t,r,i),{done:!1,hasNext:!0,next:n})}export{t as mapWithFeedback};
|
|
2
2
|
//# sourceMappingURL=map-with-feedback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-with-feedback.js","names":[],"sources":["../src/map-with-feedback.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { Mapped } from './internal/types/mapped';\nimport { curryFromLazy } from './internal/curry-from-lazy';\n\n/**\n * Applies a function on each element of the array, using the result of the\n * previous application, and returns an array of the successively computed\n * values.\n *\n * @param data - The array to map over.\n * @param callbackfn - The callback function that receives the previous value,\n * the current element.\n * @param initialValue - The initial value to start the computation with.\n * @returns An array of successively computed values from the left side of the\n * array.\n * @signature\n * mapWithFeedback(data, callbackfn, initialValue);\n * @example\n * mapWithFeedback(\n * [1, 2, 3, 4, 5],\n * (prev, x) => prev + x,\n * 100,\n * ); // => [101, 103, 106, 110, 115]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function mapWithFeedback<T extends IterableContainer, U>(\n data: T,\n callbackfn: (\n previousValue: U,\n currentValue: T[number],\n currentIndex: number,\n data: T,\n ) => U,\n initialValue: U,\n): Mapped<T, U>;\n\n/**\n * Applies a function on each element of the array, using the result of the\n * previous application, and returns an array of the successively computed\n * values.\n *\n * @param callbackfn - The callback function that receives the previous value,\n * the current element.\n * @param initialValue - The initial value to start the computation with.\n * @returns An array of successively computed values from the left side of the\n * array.\n * @signature\n * mapWithFeedback(callbackfn, initialValue)(data);\n * @example\n * pipe(\n * [1, 2, 3, 4, 5],\n * mapWithFeedback((prev, x) => prev + x, 100),\n * ); // => [101, 103, 106, 110, 115]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function mapWithFeedback<T extends IterableContainer, U>(\n callbackfn: (\n previousValue: U,\n currentValue: T[number],\n currentIndex: number,\n data: T,\n ) => U,\n initialValue: U,\n): (data: T) => Mapped<T, U>;\n\nexport function mapWithFeedback(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, U>(reducer: (\n previousValue: U,\n currentValue: T,\n index: number,\n data: ReadonlyArray<T>,\n) => U, initialValue: U): LazyEvaluator<T, U> {\n let previousValue = initialValue;\n return (currentValue, index, data) => {\n previousValue = reducer(previousValue, currentValue, index, data);\n return { done: false, hasNext: true, next: previousValue };\n };\n}\n"],"mappings":"kDAsEA,SAAgB,EAAgB,GAAG,EAAuC,CACxE,OAAO,EAAc,EAAoB,
|
|
1
|
+
{"version":3,"file":"map-with-feedback.js","names":[],"sources":["../src/map-with-feedback.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { Mapped } from './internal/types/mapped';\nimport { curryFromLazy } from './internal/curry-from-lazy';\n\n/**\n * Applies a function on each element of the array, using the result of the\n * previous application, and returns an array of the successively computed\n * values.\n *\n * @param data - The array to map over.\n * @param callbackfn - The callback function that receives the previous value,\n * the current element.\n * @param initialValue - The initial value to start the computation with.\n * @returns An array of successively computed values from the left side of the\n * array.\n * @signature\n * mapWithFeedback(data, callbackfn, initialValue);\n * @example\n * mapWithFeedback(\n * [1, 2, 3, 4, 5],\n * (prev, x) => prev + x,\n * 100,\n * ); // => [101, 103, 106, 110, 115]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function mapWithFeedback<T extends IterableContainer, U>(\n data: T,\n callbackfn: (\n previousValue: U,\n currentValue: T[number],\n currentIndex: number,\n data: T,\n ) => U,\n initialValue: U,\n): Mapped<T, U>;\n\n/**\n * Applies a function on each element of the array, using the result of the\n * previous application, and returns an array of the successively computed\n * values.\n *\n * @param callbackfn - The callback function that receives the previous value,\n * the current element.\n * @param initialValue - The initial value to start the computation with.\n * @returns An array of successively computed values from the left side of the\n * array.\n * @signature\n * mapWithFeedback(callbackfn, initialValue)(data);\n * @example\n * pipe(\n * [1, 2, 3, 4, 5],\n * mapWithFeedback((prev, x) => prev + x, 100),\n * ); // => [101, 103, 106, 110, 115]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function mapWithFeedback<T extends IterableContainer, U>(\n callbackfn: (\n previousValue: U,\n currentValue: T[number],\n currentIndex: number,\n data: T,\n ) => U,\n initialValue: U,\n): (data: T) => Mapped<T, U>;\n\nexport function mapWithFeedback(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, U>(reducer: (\n previousValue: U,\n currentValue: T,\n index: number,\n data: ReadonlyArray<T>,\n) => U, initialValue: U): LazyEvaluator<T, U> {\n let previousValue = initialValue;\n return (currentValue, index, data) => {\n previousValue = reducer(previousValue, currentValue, index, data);\n return { done: false, hasNext: true, next: previousValue };\n };\n}\n"],"mappings":"kDAsEA,SAAgB,EAAgB,GAAG,EAAuC,CACxE,OAAO,EAAc,EAAoB,CAAI,CAC/C,CAEA,SAAS,EAAyB,EAK1B,EAAsC,CAC5C,IAAI,EAAgB,EACpB,OAAQ,EAAc,EAAO,KAC3B,EAAgB,EAAQ,EAAe,EAAc,EAAO,CAAI,EACzD,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,CAAc,EAE7D"}
|
package/dist/map.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(n,t,r)}function n(e,t){return e.map(t)}function r(e){return(t,n,r)=>({done:!1,hasNext:!0,next:e(t,n,r)})}exports.map=t;
|
|
2
2
|
//# sourceMappingURL=map.cjs.map
|
package/dist/map.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.cjs","names":["curry"],"sources":["../src/map.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { Mapped } from './internal/types/mapped';\nimport { curry } from './curry';\n\n/**\n * Creates a new array populated with the results of calling a provided function\n * on every element in the calling array. Equivalent to `Array.prototype.map`.\n *\n * @param data - The array to map.\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value is added as a single element in the new array.\n * @returns A new array with each element being the result of the callback\n * function.\n * @signature\n * map(data, callbackfn)\n * @example\n * map([1, 2, 3], multiply(2)); // => [2, 4, 6]\n * map([0, 0], add(1)); // => [1, 1]\n * map([0, 0], (value, index) => value + index); // => [0, 1]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function map<T extends IterableContainer, U>(\n data: T,\n callbackfn: (value: T[number], index: number, data: T) => U,\n): Mapped<T, U>;\n\n/**\n * Creates a new array populated with the results of calling a provided function\n * on every element in the calling array. Equivalent to `Array.prototype.map`.\n *\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value is added as a single element in the new array.\n * @returns A new array with each element being the result of the callback\n * function.\n * @signature\n * map(callbackfn)(data)\n * @example\n * pipe([1, 2, 3], map(multiply(2))); // => [2, 4, 6]\n * pipe([0, 0], map(add(1))); // => [1, 1]\n * pipe([0, 0], map((value, index) => value + index)); // => [0, 1]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function map<T extends IterableContainer, U>(\n callbackfn: (value: T[number], index: number, data: T) => U,\n): (data: T) => Mapped<T, U>;\n\nexport function map(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapImplementation, args, lazyImplementation);\n}\n\nfunction mapImplementation<T, U>(data: ReadonlyArray<T>, callbackfn: (value: T, index: number, data: ReadonlyArray<T>) => U): Array<U> {\n return data.map(callbackfn);\n}\n\nfunction lazyImplementation<T, U>(callbackfn: (value: T, index: number, data: ReadonlyArray<T>) => U): LazyEvaluator<T, U> {\n return (value, index, data) => ({\n done: false,\n hasNext: true,\n next: callbackfn(value, index, data),\n });\n}\n"],"mappings":"kGAmDA,SAAgB,EAAI,GAAG,EAAuC,CAC5D,OAAOA,EAAAA,MAAM,EAAmB,EAAM,
|
|
1
|
+
{"version":3,"file":"map.cjs","names":["curry"],"sources":["../src/map.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { Mapped } from './internal/types/mapped';\nimport { curry } from './curry';\n\n/**\n * Creates a new array populated with the results of calling a provided function\n * on every element in the calling array. Equivalent to `Array.prototype.map`.\n *\n * @param data - The array to map.\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value is added as a single element in the new array.\n * @returns A new array with each element being the result of the callback\n * function.\n * @signature\n * map(data, callbackfn)\n * @example\n * map([1, 2, 3], multiply(2)); // => [2, 4, 6]\n * map([0, 0], add(1)); // => [1, 1]\n * map([0, 0], (value, index) => value + index); // => [0, 1]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function map<T extends IterableContainer, U>(\n data: T,\n callbackfn: (value: T[number], index: number, data: T) => U,\n): Mapped<T, U>;\n\n/**\n * Creates a new array populated with the results of calling a provided function\n * on every element in the calling array. Equivalent to `Array.prototype.map`.\n *\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value is added as a single element in the new array.\n * @returns A new array with each element being the result of the callback\n * function.\n * @signature\n * map(callbackfn)(data)\n * @example\n * pipe([1, 2, 3], map(multiply(2))); // => [2, 4, 6]\n * pipe([0, 0], map(add(1))); // => [1, 1]\n * pipe([0, 0], map((value, index) => value + index)); // => [0, 1]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function map<T extends IterableContainer, U>(\n callbackfn: (value: T[number], index: number, data: T) => U,\n): (data: T) => Mapped<T, U>;\n\nexport function map(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapImplementation, args, lazyImplementation);\n}\n\nfunction mapImplementation<T, U>(data: ReadonlyArray<T>, callbackfn: (value: T, index: number, data: ReadonlyArray<T>) => U): Array<U> {\n return data.map(callbackfn);\n}\n\nfunction lazyImplementation<T, U>(callbackfn: (value: T, index: number, data: ReadonlyArray<T>) => U): LazyEvaluator<T, U> {\n return (value, index, data) => ({\n done: false,\n hasNext: true,\n next: callbackfn(value, index, data),\n });\n}\n"],"mappings":"kGAmDA,SAAgB,EAAI,GAAG,EAAuC,CAC5D,OAAOA,EAAAA,MAAM,EAAmB,EAAM,CAAkB,CAC1D,CAEA,SAAS,EAAwB,EAAwB,EAA8E,CACrI,OAAO,EAAK,IAAI,CAAU,CAC5B,CAEA,SAAS,EAAyB,EAAyF,CACzH,OAAQ,EAAO,EAAO,KAAU,CAC9B,KAAM,GACN,QAAS,GACT,KAAM,EAAW,EAAO,EAAO,CAAI,CACrC,EACF"}
|
package/dist/map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","names":[],"sources":["../src/map.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { Mapped } from './internal/types/mapped';\nimport { curry } from './curry';\n\n/**\n * Creates a new array populated with the results of calling a provided function\n * on every element in the calling array. Equivalent to `Array.prototype.map`.\n *\n * @param data - The array to map.\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value is added as a single element in the new array.\n * @returns A new array with each element being the result of the callback\n * function.\n * @signature\n * map(data, callbackfn)\n * @example\n * map([1, 2, 3], multiply(2)); // => [2, 4, 6]\n * map([0, 0], add(1)); // => [1, 1]\n * map([0, 0], (value, index) => value + index); // => [0, 1]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function map<T extends IterableContainer, U>(\n data: T,\n callbackfn: (value: T[number], index: number, data: T) => U,\n): Mapped<T, U>;\n\n/**\n * Creates a new array populated with the results of calling a provided function\n * on every element in the calling array. Equivalent to `Array.prototype.map`.\n *\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value is added as a single element in the new array.\n * @returns A new array with each element being the result of the callback\n * function.\n * @signature\n * map(callbackfn)(data)\n * @example\n * pipe([1, 2, 3], map(multiply(2))); // => [2, 4, 6]\n * pipe([0, 0], map(add(1))); // => [1, 1]\n * pipe([0, 0], map((value, index) => value + index)); // => [0, 1]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function map<T extends IterableContainer, U>(\n callbackfn: (value: T[number], index: number, data: T) => U,\n): (data: T) => Mapped<T, U>;\n\nexport function map(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapImplementation, args, lazyImplementation);\n}\n\nfunction mapImplementation<T, U>(data: ReadonlyArray<T>, callbackfn: (value: T, index: number, data: ReadonlyArray<T>) => U): Array<U> {\n return data.map(callbackfn);\n}\n\nfunction lazyImplementation<T, U>(callbackfn: (value: T, index: number, data: ReadonlyArray<T>) => U): LazyEvaluator<T, U> {\n return (value, index, data) => ({\n done: false,\n hasNext: true,\n next: callbackfn(value, index, data),\n });\n}\n"],"mappings":"mCAmDA,SAAgB,EAAI,GAAG,EAAuC,CAC5D,OAAO,EAAM,EAAmB,EAAM,
|
|
1
|
+
{"version":3,"file":"map.js","names":[],"sources":["../src/map.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { Mapped } from './internal/types/mapped';\nimport { curry } from './curry';\n\n/**\n * Creates a new array populated with the results of calling a provided function\n * on every element in the calling array. Equivalent to `Array.prototype.map`.\n *\n * @param data - The array to map.\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value is added as a single element in the new array.\n * @returns A new array with each element being the result of the callback\n * function.\n * @signature\n * map(data, callbackfn)\n * @example\n * map([1, 2, 3], multiply(2)); // => [2, 4, 6]\n * map([0, 0], add(1)); // => [1, 1]\n * map([0, 0], (value, index) => value + index); // => [0, 1]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function map<T extends IterableContainer, U>(\n data: T,\n callbackfn: (value: T[number], index: number, data: T) => U,\n): Mapped<T, U>;\n\n/**\n * Creates a new array populated with the results of calling a provided function\n * on every element in the calling array. Equivalent to `Array.prototype.map`.\n *\n * @param callbackfn - A function to execute for each element in the array. Its\n * return value is added as a single element in the new array.\n * @returns A new array with each element being the result of the callback\n * function.\n * @signature\n * map(callbackfn)(data)\n * @example\n * pipe([1, 2, 3], map(multiply(2))); // => [2, 4, 6]\n * pipe([0, 0], map(add(1))); // => [1, 1]\n * pipe([0, 0], map((value, index) => value + index)); // => [0, 1]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function map<T extends IterableContainer, U>(\n callbackfn: (value: T[number], index: number, data: T) => U,\n): (data: T) => Mapped<T, U>;\n\nexport function map(...args: ReadonlyArray<unknown>): unknown {\n return curry(mapImplementation, args, lazyImplementation);\n}\n\nfunction mapImplementation<T, U>(data: ReadonlyArray<T>, callbackfn: (value: T, index: number, data: ReadonlyArray<T>) => U): Array<U> {\n return data.map(callbackfn);\n}\n\nfunction lazyImplementation<T, U>(callbackfn: (value: T, index: number, data: ReadonlyArray<T>) => U): LazyEvaluator<T, U> {\n return (value, index, data) => ({\n done: false,\n hasNext: true,\n next: callbackfn(value, index, data),\n });\n}\n"],"mappings":"mCAmDA,SAAgB,EAAI,GAAG,EAAuC,CAC5D,OAAO,EAAM,EAAmB,EAAM,CAAkB,CAC1D,CAEA,SAAS,EAAwB,EAAwB,EAA8E,CACrI,OAAO,EAAK,IAAI,CAAU,CAC5B,CAEA,SAAS,EAAyB,EAAyF,CACzH,OAAQ,EAAO,EAAO,KAAU,CAC9B,KAAM,GACN,QAAS,GACT,KAAM,EAAW,EAAO,EAAO,CAAI,CACrC,EACF"}
|
package/dist/mean-by.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(n,t)}function n(e,t){if(e.length===0)return NaN;let n=0;for(let[r,i]of e.entries())n+=t(i,r,e);return n/e.length}exports.meanBy=t;
|
|
2
2
|
//# sourceMappingURL=mean-by.cjs.map
|
package/dist/mean-by.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mean-by.cjs","names":["curry"],"sources":["../src/mean-by.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Returns the mean of the elements of an array using the provided predicate.\n *\n * @param fn - Predicate function.\n * @signature\n * meanBy(fn)(array)\n * @example\n * pipe(\n * [{a: 5}, {a: 1}, {a: 3}],\n * meanBy(x => x.a)\n * ) // 3\n * @dataLast\n * @category Array\n */\n\nexport function meanBy<T>(\n fn: (value: T, index: number, data: ReadonlyArray<T>) => number,\n): (items: ReadonlyArray<T>) => number;\n\n/**\n * Returns the mean of the elements of an array using the provided predicate.\n *\n * @param items - The array.\n * @param fn - Predicate function.\n * @signature\n * meanBy(array, fn)\n * @example\n * meanBy(\n * [{a: 5}, {a: 1}, {a: 3}],\n * x => x.a\n * ) // 3\n * @dataFirst\n * @category Array\n */\n\nexport function meanBy<T>(\n items: ReadonlyArray<T>,\n fn: (value: T, index: number, data: ReadonlyArray<T>) => number,\n): number;\n\nexport function meanBy(...args: ReadonlyArray<unknown>): unknown {\n return curry(meanByImplementation, args);\n}\n\nfunction meanByImplementation<T>(array: ReadonlyArray<T>, fn: (value: T, index: number, data: ReadonlyArray<T>) => number): number {\n if (array.length === 0) {\n return Number.NaN;\n }\n\n let sum = 0;\n\n for (const [index, item] of array.entries()) {\n sum += fn(item, index, array);\n }\n\n return sum / array.length;\n}\n"],"mappings":"kGA0CA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"mean-by.cjs","names":["curry"],"sources":["../src/mean-by.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Returns the mean of the elements of an array using the provided predicate.\n *\n * @param fn - Predicate function.\n * @signature\n * meanBy(fn)(array)\n * @example\n * pipe(\n * [{a: 5}, {a: 1}, {a: 3}],\n * meanBy(x => x.a)\n * ) // 3\n * @dataLast\n * @category Array\n */\n\nexport function meanBy<T>(\n fn: (value: T, index: number, data: ReadonlyArray<T>) => number,\n): (items: ReadonlyArray<T>) => number;\n\n/**\n * Returns the mean of the elements of an array using the provided predicate.\n *\n * @param items - The array.\n * @param fn - Predicate function.\n * @signature\n * meanBy(array, fn)\n * @example\n * meanBy(\n * [{a: 5}, {a: 1}, {a: 3}],\n * x => x.a\n * ) // 3\n * @dataFirst\n * @category Array\n */\n\nexport function meanBy<T>(\n items: ReadonlyArray<T>,\n fn: (value: T, index: number, data: ReadonlyArray<T>) => number,\n): number;\n\nexport function meanBy(...args: ReadonlyArray<unknown>): unknown {\n return curry(meanByImplementation, args);\n}\n\nfunction meanByImplementation<T>(array: ReadonlyArray<T>, fn: (value: T, index: number, data: ReadonlyArray<T>) => number): number {\n if (array.length === 0) {\n return Number.NaN;\n }\n\n let sum = 0;\n\n for (const [index, item] of array.entries()) {\n sum += fn(item, index, array);\n }\n\n return sum / array.length;\n}\n"],"mappings":"kGA0CA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,CAAI,CACzC,CAEA,SAAS,EAAwB,EAAyB,EAAyE,CACjI,GAAI,EAAM,SAAW,EACnB,MAAO,KAGT,IAAI,EAAM,EAEV,IAAK,GAAM,CAAC,EAAO,KAAS,EAAM,QAAQ,EACxC,GAAO,EAAG,EAAM,EAAO,CAAK,EAG9B,OAAO,EAAM,EAAM,MACrB"}
|
package/dist/mean-by.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mean-by.js","names":[],"sources":["../src/mean-by.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Returns the mean of the elements of an array using the provided predicate.\n *\n * @param fn - Predicate function.\n * @signature\n * meanBy(fn)(array)\n * @example\n * pipe(\n * [{a: 5}, {a: 1}, {a: 3}],\n * meanBy(x => x.a)\n * ) // 3\n * @dataLast\n * @category Array\n */\n\nexport function meanBy<T>(\n fn: (value: T, index: number, data: ReadonlyArray<T>) => number,\n): (items: ReadonlyArray<T>) => number;\n\n/**\n * Returns the mean of the elements of an array using the provided predicate.\n *\n * @param items - The array.\n * @param fn - Predicate function.\n * @signature\n * meanBy(array, fn)\n * @example\n * meanBy(\n * [{a: 5}, {a: 1}, {a: 3}],\n * x => x.a\n * ) // 3\n * @dataFirst\n * @category Array\n */\n\nexport function meanBy<T>(\n items: ReadonlyArray<T>,\n fn: (value: T, index: number, data: ReadonlyArray<T>) => number,\n): number;\n\nexport function meanBy(...args: ReadonlyArray<unknown>): unknown {\n return curry(meanByImplementation, args);\n}\n\nfunction meanByImplementation<T>(array: ReadonlyArray<T>, fn: (value: T, index: number, data: ReadonlyArray<T>) => number): number {\n if (array.length === 0) {\n return Number.NaN;\n }\n\n let sum = 0;\n\n for (const [index, item] of array.entries()) {\n sum += fn(item, index, array);\n }\n\n return sum / array.length;\n}\n"],"mappings":"mCA0CA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"mean-by.js","names":[],"sources":["../src/mean-by.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Returns the mean of the elements of an array using the provided predicate.\n *\n * @param fn - Predicate function.\n * @signature\n * meanBy(fn)(array)\n * @example\n * pipe(\n * [{a: 5}, {a: 1}, {a: 3}],\n * meanBy(x => x.a)\n * ) // 3\n * @dataLast\n * @category Array\n */\n\nexport function meanBy<T>(\n fn: (value: T, index: number, data: ReadonlyArray<T>) => number,\n): (items: ReadonlyArray<T>) => number;\n\n/**\n * Returns the mean of the elements of an array using the provided predicate.\n *\n * @param items - The array.\n * @param fn - Predicate function.\n * @signature\n * meanBy(array, fn)\n * @example\n * meanBy(\n * [{a: 5}, {a: 1}, {a: 3}],\n * x => x.a\n * ) // 3\n * @dataFirst\n * @category Array\n */\n\nexport function meanBy<T>(\n items: ReadonlyArray<T>,\n fn: (value: T, index: number, data: ReadonlyArray<T>) => number,\n): number;\n\nexport function meanBy(...args: ReadonlyArray<unknown>): unknown {\n return curry(meanByImplementation, args);\n}\n\nfunction meanByImplementation<T>(array: ReadonlyArray<T>, fn: (value: T, index: number, data: ReadonlyArray<T>) => number): number {\n if (array.length === 0) {\n return Number.NaN;\n }\n\n let sum = 0;\n\n for (const [index, item] of array.entries()) {\n sum += fn(item, index, array);\n }\n\n return sum / array.length;\n}\n"],"mappings":"mCA0CA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,CAAI,CACzC,CAEA,SAAS,EAAwB,EAAyB,EAAyE,CACjI,GAAI,EAAM,SAAW,EACnB,MAAO,KAGT,IAAI,EAAM,EAEV,IAAK,GAAM,CAAC,EAAO,KAAS,EAAM,QAAQ,EACxC,GAAO,EAAG,EAAM,EAAO,CAAK,EAG9B,OAAO,EAAM,EAAM,MACrB"}
|
package/dist/mean.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs"),t=require("./sum.cjs");function n(...t){return e.curry(r,t)}function r(e){if(e.length!==0)return t.sum(e)/e.length}exports.mean=n;
|
|
2
2
|
//# sourceMappingURL=mean.cjs.map
|
package/dist/mean.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mean.cjs","names":["curry","sum"],"sources":["../src/mean.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\nimport { sum } from './sum';\n\ntype Mean<T extends IterableContainer<number>>\n = | (T extends readonly [] ? never : number)\n | (T extends readonly [unknown, ...Array<unknown>] ? never : undefined);\n\n/**\n * Returns the mean of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * mean(data);\n * @example\n * mean([1, 2, 3]); // => 2\n * mean([]); // => undefined\n * @dataFirst\n * @category Number\n */\nexport function mean<T extends IterableContainer<number>>(data: T): Mean<T>;\n\n/**\n * Returns the mean of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @signature\n * mean()(data);\n * @example\n * pipe([1, 2, 3], mean()); // => 2\n * pipe([], mean()); // => undefined\n * @dataLast\n * @category Number\n */\nexport function mean(): <T extends IterableContainer<number>>(\n data: T,\n) => Mean<T>;\n\nexport function mean(...args: ReadonlyArray<unknown>): unknown {\n return curry(meanImplementation, args);\n}\n\nfunction meanImplementation<T extends IterableContainer<number>>(\n data: T,\n): T[number] | undefined {\n if (data.length === 0) {\n return undefined;\n }\n\n return sum(data) / data.length;\n}\n"],"mappings":"yHAqDA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAOA,EAAAA,MAAM,EAAoB,
|
|
1
|
+
{"version":3,"file":"mean.cjs","names":["curry","sum"],"sources":["../src/mean.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\nimport { sum } from './sum';\n\ntype Mean<T extends IterableContainer<number>>\n = | (T extends readonly [] ? never : number)\n | (T extends readonly [unknown, ...Array<unknown>] ? never : undefined);\n\n/**\n * Returns the mean of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * mean(data);\n * @example\n * mean([1, 2, 3]); // => 2\n * mean([]); // => undefined\n * @dataFirst\n * @category Number\n */\nexport function mean<T extends IterableContainer<number>>(data: T): Mean<T>;\n\n/**\n * Returns the mean of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @signature\n * mean()(data);\n * @example\n * pipe([1, 2, 3], mean()); // => 2\n * pipe([], mean()); // => undefined\n * @dataLast\n * @category Number\n */\nexport function mean(): <T extends IterableContainer<number>>(\n data: T,\n) => Mean<T>;\n\nexport function mean(...args: ReadonlyArray<unknown>): unknown {\n return curry(meanImplementation, args);\n}\n\nfunction meanImplementation<T extends IterableContainer<number>>(\n data: T,\n): T[number] | undefined {\n if (data.length === 0) {\n return undefined;\n }\n\n return sum(data) / data.length;\n}\n"],"mappings":"yHAqDA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAOA,EAAAA,MAAM,EAAoB,CAAI,CACvC,CAEA,SAAS,EACP,EACuB,CACnB,KAAK,SAAW,EAIpB,OAAOC,EAAAA,IAAI,CAAI,EAAI,EAAK,MAC1B"}
|
package/dist/mean.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mean.js","names":[],"sources":["../src/mean.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\nimport { sum } from './sum';\n\ntype Mean<T extends IterableContainer<number>>\n = | (T extends readonly [] ? never : number)\n | (T extends readonly [unknown, ...Array<unknown>] ? never : undefined);\n\n/**\n * Returns the mean of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * mean(data);\n * @example\n * mean([1, 2, 3]); // => 2\n * mean([]); // => undefined\n * @dataFirst\n * @category Number\n */\nexport function mean<T extends IterableContainer<number>>(data: T): Mean<T>;\n\n/**\n * Returns the mean of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @signature\n * mean()(data);\n * @example\n * pipe([1, 2, 3], mean()); // => 2\n * pipe([], mean()); // => undefined\n * @dataLast\n * @category Number\n */\nexport function mean(): <T extends IterableContainer<number>>(\n data: T,\n) => Mean<T>;\n\nexport function mean(...args: ReadonlyArray<unknown>): unknown {\n return curry(meanImplementation, args);\n}\n\nfunction meanImplementation<T extends IterableContainer<number>>(\n data: T,\n): T[number] | undefined {\n if (data.length === 0) {\n return undefined;\n }\n\n return sum(data) / data.length;\n}\n"],"mappings":"kEAqDA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAO,EAAM,EAAoB,
|
|
1
|
+
{"version":3,"file":"mean.js","names":[],"sources":["../src/mean.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\nimport { sum } from './sum';\n\ntype Mean<T extends IterableContainer<number>>\n = | (T extends readonly [] ? never : number)\n | (T extends readonly [unknown, ...Array<unknown>] ? never : undefined);\n\n/**\n * Returns the mean of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * mean(data);\n * @example\n * mean([1, 2, 3]); // => 2\n * mean([]); // => undefined\n * @dataFirst\n * @category Number\n */\nexport function mean<T extends IterableContainer<number>>(data: T): Mean<T>;\n\n/**\n * Returns the mean of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @signature\n * mean()(data);\n * @example\n * pipe([1, 2, 3], mean()); // => 2\n * pipe([], mean()); // => undefined\n * @dataLast\n * @category Number\n */\nexport function mean(): <T extends IterableContainer<number>>(\n data: T,\n) => Mean<T>;\n\nexport function mean(...args: ReadonlyArray<unknown>): unknown {\n return curry(meanImplementation, args);\n}\n\nfunction meanImplementation<T extends IterableContainer<number>>(\n data: T,\n): T[number] | undefined {\n if (data.length === 0) {\n return undefined;\n }\n\n return sum(data) / data.length;\n}\n"],"mappings":"kEAqDA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAO,EAAM,EAAoB,CAAI,CACvC,CAEA,SAAS,EACP,EACuB,CACnB,KAAK,SAAW,EAIpB,OAAO,EAAI,CAAI,EAAI,EAAK,MAC1B"}
|
package/dist/median.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(r,t)}const n=(e,t)=>e-t;function r(e){if(e.length===0)return;let t=[...e].sort(n);if(t.length%2!=0)return t[(t.length-1)/2];let r=t.length/2;return(t[r]+t[r-1])/2}exports.median=t;
|
|
2
2
|
//# sourceMappingURL=median.cjs.map
|
package/dist/median.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"median.cjs","names":["curry"],"sources":["../src/median.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Median<T extends IterableContainer<number>>\n = | (T extends readonly [] ? never : number)\n | (T extends readonly [unknown, ...Array<unknown>] ? never : undefined);\n\n/**\n * Returns the median of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * median(data);\n * @example\n * pipe([6, 10, 11], median()); // => 10\n * median([]); // => undefined\n * @dataFirst\n * @category Number\n */\nexport function median<T extends IterableContainer<number>>(data: T): Median<T>;\n\n/**\n * Returns the median of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @signature\n * median()(data);\n * @example\n * pipe([6, 10, 11], median()); // => 10\n * pipe([], median()); // => undefined\n * @dataLast\n * @category Number\n */\nexport function median(): <T extends IterableContainer<number>>(\n data: T,\n) => Median<T>;\n\nexport function median(...args: ReadonlyArray<unknown>): unknown {\n return curry(medianImplementation, args);\n}\n\nconst numberComparator = (a: number, b: number): number => a - b;\n\nfunction medianImplementation<T extends IterableContainer<number>>(\n data: T,\n): T[number] | undefined {\n if (data.length === 0) {\n return undefined;\n }\n\n // TODO [>2]: When node 18 reaches end-of-life bump target lib to ES2023+ and use `Array.prototype.toSorted` here.\n const sortedData = [...data].sort(numberComparator);\n\n // For odd length, return the middle element\n if (sortedData.length % 2 !== 0) {\n return sortedData[(sortedData.length - 1) / 2];\n }\n\n // For even length, return the mean of the two middle elements\n const middleIndex = sortedData.length / 2;\n\n return (sortedData[middleIndex]! + sortedData[middleIndex - 1]!) / 2;\n}\n"],"mappings":"kGAoDA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"median.cjs","names":["curry"],"sources":["../src/median.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Median<T extends IterableContainer<number>>\n = | (T extends readonly [] ? never : number)\n | (T extends readonly [unknown, ...Array<unknown>] ? never : undefined);\n\n/**\n * Returns the median of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * median(data);\n * @example\n * pipe([6, 10, 11], median()); // => 10\n * median([]); // => undefined\n * @dataFirst\n * @category Number\n */\nexport function median<T extends IterableContainer<number>>(data: T): Median<T>;\n\n/**\n * Returns the median of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @signature\n * median()(data);\n * @example\n * pipe([6, 10, 11], median()); // => 10\n * pipe([], median()); // => undefined\n * @dataLast\n * @category Number\n */\nexport function median(): <T extends IterableContainer<number>>(\n data: T,\n) => Median<T>;\n\nexport function median(...args: ReadonlyArray<unknown>): unknown {\n return curry(medianImplementation, args);\n}\n\nconst numberComparator = (a: number, b: number): number => a - b;\n\nfunction medianImplementation<T extends IterableContainer<number>>(\n data: T,\n): T[number] | undefined {\n if (data.length === 0) {\n return undefined;\n }\n\n // TODO [>2]: When node 18 reaches end-of-life bump target lib to ES2023+ and use `Array.prototype.toSorted` here.\n const sortedData = [...data].sort(numberComparator);\n\n // For odd length, return the middle element\n if (sortedData.length % 2 !== 0) {\n return sortedData[(sortedData.length - 1) / 2];\n }\n\n // For even length, return the mean of the two middle elements\n const middleIndex = sortedData.length / 2;\n\n return (sortedData[middleIndex]! + sortedData[middleIndex - 1]!) / 2;\n}\n"],"mappings":"kGAoDA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,CAAI,CACzC,CAEA,MAAM,GAAoB,EAAW,IAAsB,EAAI,EAE/D,SAAS,EACP,EACuB,CACvB,GAAI,EAAK,SAAW,EAClB,OAIF,IAAM,EAAa,CAAC,GAAG,CAAI,CAAC,CAAC,KAAK,CAAgB,EAGlD,GAAI,EAAW,OAAS,GAAM,EAC5B,OAAO,GAAY,EAAW,OAAS,GAAK,GAI9C,IAAM,EAAc,EAAW,OAAS,EAExC,OAAQ,EAAW,GAAgB,EAAW,EAAc,IAAO,CACrE"}
|
package/dist/median.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"median.js","names":[],"sources":["../src/median.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Median<T extends IterableContainer<number>>\n = | (T extends readonly [] ? never : number)\n | (T extends readonly [unknown, ...Array<unknown>] ? never : undefined);\n\n/**\n * Returns the median of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * median(data);\n * @example\n * pipe([6, 10, 11], median()); // => 10\n * median([]); // => undefined\n * @dataFirst\n * @category Number\n */\nexport function median<T extends IterableContainer<number>>(data: T): Median<T>;\n\n/**\n * Returns the median of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @signature\n * median()(data);\n * @example\n * pipe([6, 10, 11], median()); // => 10\n * pipe([], median()); // => undefined\n * @dataLast\n * @category Number\n */\nexport function median(): <T extends IterableContainer<number>>(\n data: T,\n) => Median<T>;\n\nexport function median(...args: ReadonlyArray<unknown>): unknown {\n return curry(medianImplementation, args);\n}\n\nconst numberComparator = (a: number, b: number): number => a - b;\n\nfunction medianImplementation<T extends IterableContainer<number>>(\n data: T,\n): T[number] | undefined {\n if (data.length === 0) {\n return undefined;\n }\n\n // TODO [>2]: When node 18 reaches end-of-life bump target lib to ES2023+ and use `Array.prototype.toSorted` here.\n const sortedData = [...data].sort(numberComparator);\n\n // For odd length, return the middle element\n if (sortedData.length % 2 !== 0) {\n return sortedData[(sortedData.length - 1) / 2];\n }\n\n // For even length, return the mean of the two middle elements\n const middleIndex = sortedData.length / 2;\n\n return (sortedData[middleIndex]! + sortedData[middleIndex - 1]!) / 2;\n}\n"],"mappings":"mCAoDA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"median.js","names":[],"sources":["../src/median.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\ntype Median<T extends IterableContainer<number>>\n = | (T extends readonly [] ? never : number)\n | (T extends readonly [unknown, ...Array<unknown>] ? never : undefined);\n\n/**\n * Returns the median of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @param data - The array of numbers.\n * @signature\n * median(data);\n * @example\n * pipe([6, 10, 11], median()); // => 10\n * median([]); // => undefined\n * @dataFirst\n * @category Number\n */\nexport function median<T extends IterableContainer<number>>(data: T): Median<T>;\n\n/**\n * Returns the median of the elements of an array.\n *\n * Only `number` arrays are supported, as `bigint` is unable to represent fractional values.\n *\n * IMPORTANT: The result for empty arrays would be `undefined`, regardless of\n * the type of the array. This approach improves type-checking and ensures that\n * cases where `NaN` might occur are handled properly. To avoid adding this to\n * the return type for cases where the array is known to be non-empty you can use\n * `hasAtLeast` or `isEmpty` to guard against this case.\n *\n * @signature\n * median()(data);\n * @example\n * pipe([6, 10, 11], median()); // => 10\n * pipe([], median()); // => undefined\n * @dataLast\n * @category Number\n */\nexport function median(): <T extends IterableContainer<number>>(\n data: T,\n) => Median<T>;\n\nexport function median(...args: ReadonlyArray<unknown>): unknown {\n return curry(medianImplementation, args);\n}\n\nconst numberComparator = (a: number, b: number): number => a - b;\n\nfunction medianImplementation<T extends IterableContainer<number>>(\n data: T,\n): T[number] | undefined {\n if (data.length === 0) {\n return undefined;\n }\n\n // TODO [>2]: When node 18 reaches end-of-life bump target lib to ES2023+ and use `Array.prototype.toSorted` here.\n const sortedData = [...data].sort(numberComparator);\n\n // For odd length, return the middle element\n if (sortedData.length % 2 !== 0) {\n return sortedData[(sortedData.length - 1) / 2];\n }\n\n // For even length, return the mean of the two middle elements\n const middleIndex = sortedData.length / 2;\n\n return (sortedData[middleIndex]! + sortedData[middleIndex - 1]!) / 2;\n}\n"],"mappings":"mCAoDA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,CAAI,CACzC,CAEA,MAAM,GAAoB,EAAW,IAAsB,EAAI,EAE/D,SAAS,EACP,EACuB,CACvB,GAAI,EAAK,SAAW,EAClB,OAIF,IAAM,EAAa,CAAC,GAAG,CAAI,CAAC,CAAC,KAAK,CAAgB,EAGlD,GAAI,EAAW,OAAS,GAAM,EAC5B,OAAO,GAAY,EAAW,OAAS,GAAK,GAI9C,IAAM,EAAc,EAAW,OAAS,EAExC,OAAQ,EAAW,GAAgB,EAAW,EAAc,IAAO,CACrE"}
|
package/dist/merge-all.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-all.cjs","names":[],"sources":["../src/merge-all.ts"],"sourcesContent":["import type {\n EmptyObject,\n Merge,\n SharedUnionFields,\n Simplify,\n} from 'type-fest';\nimport type { DisjointUnionFields } from './internal/types/disjoint-union-fields';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport type { TupleParts } from './internal/types/tuple-parts';\n\n/**\n * Merge a tuple of object types, where props from later objects override earlier props.\n */\ntype MergeTuple<\n T extends IterableContainer,\n Result = object, // no-op for the first iteration in the successive merges, also infers object as type by default if an empty tuple is used\n> = T extends readonly [infer Head, ...infer Rest]\n ? MergeTuple<Rest, Merge<Result, Head>>\n : Result;\n\n// In the context of a heterogeneous array, the array may not have objects from every type of the union.\n// This means some fields may be missing in the final object, so we make them optional.\n// If there is a non-optional field shared among all members of the union, then we know that if the array is not empty, the field must be present and avoid becoming optional.\n// If the field is already optional, this doesn't really matter.\n// If the array is empty, we know that the loop won't run so we'll just get the empty object.\n// Since we don't know the order of the items in the array, when we merge common fields, we don't know what the final type for the field will be, but we do know that it is one of the many possible types that are available across the members of the union for that field.\n// We represent these possibilities by combining the field's different types across the union members into a union.\ntype MergeUnion<T extends object> = Simplify<\n SharedUnionFields<T> & Partial<DisjointUnionFields<T>>\n>;\n\ntype MergeAll<T extends IterableContainer<object>>\n // determine if it's a tuple or array\n = TupleParts<T> extends { item: never }\n ? T extends readonly []\n ? EmptyObject\n : MergeTuple<T>\n : MergeUnion<T[number]> | EmptyObject;\n\n/**\n * Merges a list of objects into a single object.\n *\n * @param objects - The array of objects.\n * @returns A new object merged with all of the objects in the list. If the list is empty, an empty object is returned.\n * @signature\n * mergeAll(objects)\n * @example\n * mergeAll([{ a: 1, b: 1 }, { b: 2, c: 3 }, { d: 10 }]) // => { a: 1, b: 2, c: 3, d: 10 }\n * mergeAll([]) // => {}\n * @dataFirst\n * @category Array\n */\nexport function mergeAll<T extends object>(\n objects: Readonly<NonEmptyArray<T>>,\n): MergeUnion<T>;\nexport function mergeAll<T extends IterableContainer<object>>(\n objects: T,\n): MergeAll<T>;\nexport function mergeAll(objects: ReadonlyArray<object>): object {\n let out = {};\n\n for (const item of objects) {\n out = { ...out, ...item };\n }\n\n return out;\n}\n"],"mappings":"mEA2DA,SAAgB,EAAS,EAAwC,CAC/D,IAAI,EAAM,
|
|
1
|
+
{"version":3,"file":"merge-all.cjs","names":[],"sources":["../src/merge-all.ts"],"sourcesContent":["import type {\n EmptyObject,\n Merge,\n SharedUnionFields,\n Simplify,\n} from 'type-fest';\nimport type { DisjointUnionFields } from './internal/types/disjoint-union-fields';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport type { TupleParts } from './internal/types/tuple-parts';\n\n/**\n * Merge a tuple of object types, where props from later objects override earlier props.\n */\ntype MergeTuple<\n T extends IterableContainer,\n Result = object, // no-op for the first iteration in the successive merges, also infers object as type by default if an empty tuple is used\n> = T extends readonly [infer Head, ...infer Rest]\n ? MergeTuple<Rest, Merge<Result, Head>>\n : Result;\n\n// In the context of a heterogeneous array, the array may not have objects from every type of the union.\n// This means some fields may be missing in the final object, so we make them optional.\n// If there is a non-optional field shared among all members of the union, then we know that if the array is not empty, the field must be present and avoid becoming optional.\n// If the field is already optional, this doesn't really matter.\n// If the array is empty, we know that the loop won't run so we'll just get the empty object.\n// Since we don't know the order of the items in the array, when we merge common fields, we don't know what the final type for the field will be, but we do know that it is one of the many possible types that are available across the members of the union for that field.\n// We represent these possibilities by combining the field's different types across the union members into a union.\ntype MergeUnion<T extends object> = Simplify<\n SharedUnionFields<T> & Partial<DisjointUnionFields<T>>\n>;\n\ntype MergeAll<T extends IterableContainer<object>>\n // determine if it's a tuple or array\n = TupleParts<T> extends { item: never }\n ? T extends readonly []\n ? EmptyObject\n : MergeTuple<T>\n : MergeUnion<T[number]> | EmptyObject;\n\n/**\n * Merges a list of objects into a single object.\n *\n * @param objects - The array of objects.\n * @returns A new object merged with all of the objects in the list. If the list is empty, an empty object is returned.\n * @signature\n * mergeAll(objects)\n * @example\n * mergeAll([{ a: 1, b: 1 }, { b: 2, c: 3 }, { d: 10 }]) // => { a: 1, b: 2, c: 3, d: 10 }\n * mergeAll([]) // => {}\n * @dataFirst\n * @category Array\n */\nexport function mergeAll<T extends object>(\n objects: Readonly<NonEmptyArray<T>>,\n): MergeUnion<T>;\nexport function mergeAll<T extends IterableContainer<object>>(\n objects: T,\n): MergeAll<T>;\nexport function mergeAll(objects: ReadonlyArray<object>): object {\n let out = {};\n\n for (const item of objects) {\n out = { ...out, ...item };\n }\n\n return out;\n}\n"],"mappings":"mEA2DA,SAAgB,EAAS,EAAwC,CAC/D,IAAI,EAAM,CAAC,EAEX,IAAK,IAAM,KAAQ,EACjB,EAAM,CAAE,GAAG,EAAK,GAAG,CAAK,EAG1B,OAAO,CACT"}
|
package/dist/merge-all.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge-all.js","names":[],"sources":["../src/merge-all.ts"],"sourcesContent":["import type {\n EmptyObject,\n Merge,\n SharedUnionFields,\n Simplify,\n} from 'type-fest';\nimport type { DisjointUnionFields } from './internal/types/disjoint-union-fields';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport type { TupleParts } from './internal/types/tuple-parts';\n\n/**\n * Merge a tuple of object types, where props from later objects override earlier props.\n */\ntype MergeTuple<\n T extends IterableContainer,\n Result = object, // no-op for the first iteration in the successive merges, also infers object as type by default if an empty tuple is used\n> = T extends readonly [infer Head, ...infer Rest]\n ? MergeTuple<Rest, Merge<Result, Head>>\n : Result;\n\n// In the context of a heterogeneous array, the array may not have objects from every type of the union.\n// This means some fields may be missing in the final object, so we make them optional.\n// If there is a non-optional field shared among all members of the union, then we know that if the array is not empty, the field must be present and avoid becoming optional.\n// If the field is already optional, this doesn't really matter.\n// If the array is empty, we know that the loop won't run so we'll just get the empty object.\n// Since we don't know the order of the items in the array, when we merge common fields, we don't know what the final type for the field will be, but we do know that it is one of the many possible types that are available across the members of the union for that field.\n// We represent these possibilities by combining the field's different types across the union members into a union.\ntype MergeUnion<T extends object> = Simplify<\n SharedUnionFields<T> & Partial<DisjointUnionFields<T>>\n>;\n\ntype MergeAll<T extends IterableContainer<object>>\n // determine if it's a tuple or array\n = TupleParts<T> extends { item: never }\n ? T extends readonly []\n ? EmptyObject\n : MergeTuple<T>\n : MergeUnion<T[number]> | EmptyObject;\n\n/**\n * Merges a list of objects into a single object.\n *\n * @param objects - The array of objects.\n * @returns A new object merged with all of the objects in the list. If the list is empty, an empty object is returned.\n * @signature\n * mergeAll(objects)\n * @example\n * mergeAll([{ a: 1, b: 1 }, { b: 2, c: 3 }, { d: 10 }]) // => { a: 1, b: 2, c: 3, d: 10 }\n * mergeAll([]) // => {}\n * @dataFirst\n * @category Array\n */\nexport function mergeAll<T extends object>(\n objects: Readonly<NonEmptyArray<T>>,\n): MergeUnion<T>;\nexport function mergeAll<T extends IterableContainer<object>>(\n objects: T,\n): MergeAll<T>;\nexport function mergeAll(objects: ReadonlyArray<object>): object {\n let out = {};\n\n for (const item of objects) {\n out = { ...out, ...item };\n }\n\n return out;\n}\n"],"mappings":"AA2DA,SAAgB,EAAS,EAAwC,CAC/D,IAAI,EAAM,
|
|
1
|
+
{"version":3,"file":"merge-all.js","names":[],"sources":["../src/merge-all.ts"],"sourcesContent":["import type {\n EmptyObject,\n Merge,\n SharedUnionFields,\n Simplify,\n} from 'type-fest';\nimport type { DisjointUnionFields } from './internal/types/disjoint-union-fields';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport type { TupleParts } from './internal/types/tuple-parts';\n\n/**\n * Merge a tuple of object types, where props from later objects override earlier props.\n */\ntype MergeTuple<\n T extends IterableContainer,\n Result = object, // no-op for the first iteration in the successive merges, also infers object as type by default if an empty tuple is used\n> = T extends readonly [infer Head, ...infer Rest]\n ? MergeTuple<Rest, Merge<Result, Head>>\n : Result;\n\n// In the context of a heterogeneous array, the array may not have objects from every type of the union.\n// This means some fields may be missing in the final object, so we make them optional.\n// If there is a non-optional field shared among all members of the union, then we know that if the array is not empty, the field must be present and avoid becoming optional.\n// If the field is already optional, this doesn't really matter.\n// If the array is empty, we know that the loop won't run so we'll just get the empty object.\n// Since we don't know the order of the items in the array, when we merge common fields, we don't know what the final type for the field will be, but we do know that it is one of the many possible types that are available across the members of the union for that field.\n// We represent these possibilities by combining the field's different types across the union members into a union.\ntype MergeUnion<T extends object> = Simplify<\n SharedUnionFields<T> & Partial<DisjointUnionFields<T>>\n>;\n\ntype MergeAll<T extends IterableContainer<object>>\n // determine if it's a tuple or array\n = TupleParts<T> extends { item: never }\n ? T extends readonly []\n ? EmptyObject\n : MergeTuple<T>\n : MergeUnion<T[number]> | EmptyObject;\n\n/**\n * Merges a list of objects into a single object.\n *\n * @param objects - The array of objects.\n * @returns A new object merged with all of the objects in the list. If the list is empty, an empty object is returned.\n * @signature\n * mergeAll(objects)\n * @example\n * mergeAll([{ a: 1, b: 1 }, { b: 2, c: 3 }, { d: 10 }]) // => { a: 1, b: 2, c: 3, d: 10 }\n * mergeAll([]) // => {}\n * @dataFirst\n * @category Array\n */\nexport function mergeAll<T extends object>(\n objects: Readonly<NonEmptyArray<T>>,\n): MergeUnion<T>;\nexport function mergeAll<T extends IterableContainer<object>>(\n objects: T,\n): MergeAll<T>;\nexport function mergeAll(objects: ReadonlyArray<object>): object {\n let out = {};\n\n for (const item of objects) {\n out = { ...out, ...item };\n }\n\n return out;\n}\n"],"mappings":"AA2DA,SAAgB,EAAS,EAAwC,CAC/D,IAAI,EAAM,CAAC,EAEX,IAAK,IAAM,KAAQ,EACjB,EAAM,CAAE,GAAG,EAAK,GAAG,CAAK,EAG1B,OAAO,CACT"}
|
package/dist/merge-deep.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs"),t=require("./is-plain-object.cjs");function n(...t){return e.curry(r,t)}function r(e,n){let i={...e,...n};for(let a in n){if(!(a in e))continue;let{[a]:o}=e;if(!t.isPlainObject(o))continue;let{[a]:s}=n;t.isPlainObject(s)&&(i[a]=r(o,s))}return i}exports.mergeDeep=n;
|
|
2
2
|
//# sourceMappingURL=merge-deep.cjs.map
|