@vinicunca/perkakas 1.15.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-_h74qi45.cjs → words-B-9EXtsW.cjs} +2 -2
- package/dist/{words-_h74qi45.cjs.map → words-B-9EXtsW.cjs.map} +1 -1
- package/dist/{words-B9lX8euz.js → words-CN1Qil5U.js} +1 -1
- package/dist/{words-B9lX8euz.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"difference-with.js","names":[],"sources":["../src/difference-with.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { SKIP_ITEM } from './internal/utility-evaluators';\n\ntype IsEqual<T, Other> = (data: T, other: Other) => boolean;\n\n/**\n * Excludes the values from `other` array.\n * Elements are compared by custom comparator isEquals.\n *\n * @param data - The source array.\n * @param other - The values to exclude.\n * @param isEqual - The comparator.\n * @signature\n * differenceWith(data, other, isEqual)\n * @example\n * differenceWith(\n * [{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }],\n * [2, 5, 3],\n * ({ a }, b) => a === b,\n * ); //=> [{ a: 1 }, { a: 4 }]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function differenceWith<T, Other>(\n data: ReadonlyArray<T>,\n other: ReadonlyArray<Other>,\n isEqual: IsEqual<T, Other>,\n): Array<T>;\n\n/**\n * Excludes the values from `other` array.\n * Elements are compared by custom comparator isEquals.\n *\n * @param other - The values to exclude.\n * @param isEqual - The comparator.\n * @signature\n * differenceWith(other, isEqual)(data)\n * @example\n * pipe(\n * [{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }, { a: 5 }, { a: 6 }],\n * differenceWith([2, 3], ({ a }, b) => a === b),\n * ); //=> [{ a: 1 }, { a: 4 }, { a: 5 }, { a: 6 }]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function differenceWith<T, Other>(\n other: ReadonlyArray<Other>,\n isEqual: IsEqual<T, Other>,\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function differenceWith(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, Other>(other: ReadonlyArray<Other>, isEqual: IsEqual<T, Other>): LazyEvaluator<T> {\n return (value) =>\n other.every((otherValue) => !isEqual(value, otherValue))\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"kGAqDA,SAAgB,EAAe,GAAG,EAAuC,CACvE,OAAO,EAAc,EAAoB,
|
|
1
|
+
{"version":3,"file":"difference-with.js","names":[],"sources":["../src/difference-with.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { SKIP_ITEM } from './internal/utility-evaluators';\n\ntype IsEqual<T, Other> = (data: T, other: Other) => boolean;\n\n/**\n * Excludes the values from `other` array.\n * Elements are compared by custom comparator isEquals.\n *\n * @param data - The source array.\n * @param other - The values to exclude.\n * @param isEqual - The comparator.\n * @signature\n * differenceWith(data, other, isEqual)\n * @example\n * differenceWith(\n * [{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }],\n * [2, 5, 3],\n * ({ a }, b) => a === b,\n * ); //=> [{ a: 1 }, { a: 4 }]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function differenceWith<T, Other>(\n data: ReadonlyArray<T>,\n other: ReadonlyArray<Other>,\n isEqual: IsEqual<T, Other>,\n): Array<T>;\n\n/**\n * Excludes the values from `other` array.\n * Elements are compared by custom comparator isEquals.\n *\n * @param other - The values to exclude.\n * @param isEqual - The comparator.\n * @signature\n * differenceWith(other, isEqual)(data)\n * @example\n * pipe(\n * [{ a: 1 }, { a: 2 }, { a: 3 }, { a: 4 }, { a: 5 }, { a: 6 }],\n * differenceWith([2, 3], ({ a }, b) => a === b),\n * ); //=> [{ a: 1 }, { a: 4 }, { a: 5 }, { a: 6 }]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function differenceWith<T, Other>(\n other: ReadonlyArray<Other>,\n isEqual: IsEqual<T, Other>,\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function differenceWith(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, Other>(other: ReadonlyArray<Other>, isEqual: IsEqual<T, Other>): LazyEvaluator<T> {\n return (value) =>\n other.every((otherValue) => !isEqual(value, otherValue))\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"kGAqDA,SAAgB,EAAe,GAAG,EAAuC,CACvE,OAAO,EAAc,EAAoB,CAAI,CAC/C,CAEA,SAAS,EAA6B,EAA6B,EAA8C,CAC/G,MAAQ,IACN,EAAM,MAAO,GAAe,CAAC,EAAQ,EAAO,CAAU,CAAC,EACnD,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,CAAM,EAC1C,CACR"}
|
package/dist/difference.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("./utility-evaluators-BGM19SpK.cjs"),t=require("./curry-from-lazy-mdjeRP1g.cjs");function n(...e){return t.t(r,e)}function r(t){if(t.length===0)return e.r;let n=new Map;for(let e of t)n.set(e,(n.get(e)??0)+1);return t=>{let r=n.get(t);return r===void 0||r===0?{done:!1,hasNext:!0,next:t}:(n.set(t,r-1),e.t)}}exports.difference=n;
|
|
2
2
|
//# sourceMappingURL=difference.cjs.map
|
package/dist/difference.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"difference.cjs","names":["curryFromLazy","lazyIdentityEvaluator","SKIP_ITEM"],"sources":["../src/difference.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The values to exclude.\n * @signature\n * difference(data, other)\n * @example\n * difference([1, 2, 3, 4], [2, 5, 3]); // => [1, 4]\n * difference([1, 1, 2, 2], [1]); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(data: ReadonlyArray<T>, other: ReadonlyArray<T>): Array<T>;\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param other - The values to exclude.\n * @signature\n * difference(other)(data)\n * @example\n * pipe([1, 2, 3, 4], difference([2, 5, 3])); // => [1, 4]\n * pipe([1, 1, 2, 2], difference([1])); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(other: ReadonlyArray<T>): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function difference(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T>(other: ReadonlyArray<T>): LazyEvaluator<T> {\n if (other.length === 0) {\n return lazyIdentityEvaluator;\n }\n\n // We need to build a more efficient data structure that would allow us to\n // keep track of the number of times we've seen a value in the other array.\n const remaining = new Map<T, number>();\n for (const value of other) {\n remaining.set(value, (remaining.get(value) ?? 0) + 1);\n }\n\n return (value) => {\n const copies = remaining.get(value);\n\n if (copies === undefined || copies === 0) {\n // The item is either not part of the other array or we've dropped enough\n // copies of it so we return it.\n return { done: false, hasNext: true, next: value };\n }\n\n // The item is equal to an item in the other array and there are still\n // copies of it to \"account\" for so we skip this one and remove it from our\n // ongoing tally.\n remaining.set(value, copies - 1);\n return SKIP_ITEM;\n };\n}\n"],"mappings":"oKAuCA,SAAgB,EAAW,GAAG,EAAuC,CACnE,OAAOA,EAAAA,EAAc,EAAoB,
|
|
1
|
+
{"version":3,"file":"difference.cjs","names":["curryFromLazy","lazyIdentityEvaluator","SKIP_ITEM"],"sources":["../src/difference.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The values to exclude.\n * @signature\n * difference(data, other)\n * @example\n * difference([1, 2, 3, 4], [2, 5, 3]); // => [1, 4]\n * difference([1, 1, 2, 2], [1]); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(data: ReadonlyArray<T>, other: ReadonlyArray<T>): Array<T>;\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param other - The values to exclude.\n * @signature\n * difference(other)(data)\n * @example\n * pipe([1, 2, 3, 4], difference([2, 5, 3])); // => [1, 4]\n * pipe([1, 1, 2, 2], difference([1])); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(other: ReadonlyArray<T>): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function difference(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T>(other: ReadonlyArray<T>): LazyEvaluator<T> {\n if (other.length === 0) {\n return lazyIdentityEvaluator;\n }\n\n // We need to build a more efficient data structure that would allow us to\n // keep track of the number of times we've seen a value in the other array.\n const remaining = new Map<T, number>();\n for (const value of other) {\n remaining.set(value, (remaining.get(value) ?? 0) + 1);\n }\n\n return (value) => {\n const copies = remaining.get(value);\n\n if (copies === undefined || copies === 0) {\n // The item is either not part of the other array or we've dropped enough\n // copies of it so we return it.\n return { done: false, hasNext: true, next: value };\n }\n\n // The item is equal to an item in the other array and there are still\n // copies of it to \"account\" for so we skip this one and remove it from our\n // ongoing tally.\n remaining.set(value, copies - 1);\n return SKIP_ITEM;\n };\n}\n"],"mappings":"oKAuCA,SAAgB,EAAW,GAAG,EAAuC,CACnE,OAAOA,EAAAA,EAAc,EAAoB,CAAI,CAC/C,CAEA,SAAS,EAAsB,EAA2C,CACxE,GAAI,EAAM,SAAW,EACnB,OAAOC,EAAAA,EAKT,IAAM,EAAY,IAAI,IACtB,IAAK,IAAM,KAAS,EAClB,EAAU,IAAI,GAAQ,EAAU,IAAI,CAAK,GAAK,GAAK,CAAC,EAGtD,MAAQ,IAAU,CAChB,IAAM,EAAS,EAAU,IAAI,CAAK,EAYlC,OAVI,IAAW,IAAA,IAAa,IAAW,EAG9B,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,CAAM,GAMnD,EAAU,IAAI,EAAO,EAAS,CAAC,EACxBC,EAAAA,EACT,CACF"}
|
package/dist/difference.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,t}from"./utility-evaluators-
|
|
1
|
+
import{r as e,t}from"./utility-evaluators-DDW55xeL.js";import{t as n}from"./curry-from-lazy-BoPMn2L_.js";function r(...e){return n(i,e)}function i(n){if(n.length===0)return e;let r=new Map;for(let e of n)r.set(e,(r.get(e)??0)+1);return e=>{let n=r.get(e);return n===void 0||n===0?{done:!1,hasNext:!0,next:e}:(r.set(e,n-1),t)}}export{r as difference};
|
|
2
2
|
//# sourceMappingURL=difference.js.map
|
package/dist/difference.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"difference.js","names":[],"sources":["../src/difference.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The values to exclude.\n * @signature\n * difference(data, other)\n * @example\n * difference([1, 2, 3, 4], [2, 5, 3]); // => [1, 4]\n * difference([1, 1, 2, 2], [1]); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(data: ReadonlyArray<T>, other: ReadonlyArray<T>): Array<T>;\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param other - The values to exclude.\n * @signature\n * difference(other)(data)\n * @example\n * pipe([1, 2, 3, 4], difference([2, 5, 3])); // => [1, 4]\n * pipe([1, 1, 2, 2], difference([1])); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(other: ReadonlyArray<T>): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function difference(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T>(other: ReadonlyArray<T>): LazyEvaluator<T> {\n if (other.length === 0) {\n return lazyIdentityEvaluator;\n }\n\n // We need to build a more efficient data structure that would allow us to\n // keep track of the number of times we've seen a value in the other array.\n const remaining = new Map<T, number>();\n for (const value of other) {\n remaining.set(value, (remaining.get(value) ?? 0) + 1);\n }\n\n return (value) => {\n const copies = remaining.get(value);\n\n if (copies === undefined || copies === 0) {\n // The item is either not part of the other array or we've dropped enough\n // copies of it so we return it.\n return { done: false, hasNext: true, next: value };\n }\n\n // The item is equal to an item in the other array and there are still\n // copies of it to \"account\" for so we skip this one and remove it from our\n // ongoing tally.\n remaining.set(value, copies - 1);\n return SKIP_ITEM;\n };\n}\n"],"mappings":"yGAuCA,SAAgB,EAAW,GAAG,EAAuC,CACnE,OAAO,EAAc,EAAoB,
|
|
1
|
+
{"version":3,"file":"difference.js","names":[],"sources":["../src/difference.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The values to exclude.\n * @signature\n * difference(data, other)\n * @example\n * difference([1, 2, 3, 4], [2, 5, 3]); // => [1, 4]\n * difference([1, 1, 2, 2], [1]); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(data: ReadonlyArray<T>, other: ReadonlyArray<T>): Array<T>;\n\n/**\n * Excludes the values from `other` array. The output maintains the same order\n * as the input. The inputs are treated as multi-sets/bags (multiple copies of\n * items are treated as unique items).\n *\n * @param other - The values to exclude.\n * @signature\n * difference(other)(data)\n * @example\n * pipe([1, 2, 3, 4], difference([2, 5, 3])); // => [1, 4]\n * pipe([1, 1, 2, 2], difference([1])); // => [1, 2, 2]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function difference<T>(other: ReadonlyArray<T>): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function difference(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T>(other: ReadonlyArray<T>): LazyEvaluator<T> {\n if (other.length === 0) {\n return lazyIdentityEvaluator;\n }\n\n // We need to build a more efficient data structure that would allow us to\n // keep track of the number of times we've seen a value in the other array.\n const remaining = new Map<T, number>();\n for (const value of other) {\n remaining.set(value, (remaining.get(value) ?? 0) + 1);\n }\n\n return (value) => {\n const copies = remaining.get(value);\n\n if (copies === undefined || copies === 0) {\n // The item is either not part of the other array or we've dropped enough\n // copies of it so we return it.\n return { done: false, hasNext: true, next: value };\n }\n\n // The item is equal to an item in the other array and there are still\n // copies of it to \"account\" for so we skip this one and remove it from our\n // ongoing tally.\n remaining.set(value, copies - 1);\n return SKIP_ITEM;\n };\n}\n"],"mappings":"yGAuCA,SAAgB,EAAW,GAAG,EAAuC,CACnE,OAAO,EAAc,EAAoB,CAAI,CAC/C,CAEA,SAAS,EAAsB,EAA2C,CACxE,GAAI,EAAM,SAAW,EACnB,OAAO,EAKT,IAAM,EAAY,IAAI,IACtB,IAAK,IAAM,KAAS,EAClB,EAAU,IAAI,GAAQ,EAAU,IAAI,CAAK,GAAK,GAAK,CAAC,EAGtD,MAAQ,IAAU,CAChB,IAAM,EAAS,EAAU,IAAI,CAAK,EAYlC,OAVI,IAAW,IAAA,IAAa,IAAW,EAG9B,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,CAAM,GAMnD,EAAU,IAAI,EAAO,EAAS,CAAC,EACxB,EACT,CACF"}
|
package/dist/divide.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){return e/t}exports.divide=t;
|
|
2
2
|
//# sourceMappingURL=divide.cjs.map
|
package/dist/divide.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divide.cjs","names":["curry"],"sources":["../src/divide.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Divides two numbers.\n *\n * @param value - The number.\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(value, divisor);\n * @example\n * divide(12, 3) // => 4\n * reduce([1, 2, 3, 4], divide, 24) // => 1\n * @dataFirst\n * @category Number\n */\nexport function divide(value: bigint, divisor: bigint): bigint;\nexport function divide(value: number, divisor: number): number;\n\n/**\n * Divides two numbers.\n *\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(divisor)(value);\n * @example\n * divide(3)(12) // => 4\n * map([2, 4, 6, 8], divide(2)) // => [1, 2, 3, 4]\n * @dataLast\n * @category Number\n */\nexport function divide(divisor: bigint): (value: bigint) => bigint;\nexport function divide(divisor: number): (value: number) => number;\n\nexport function divide(...args: ReadonlyArray<unknown>): unknown {\n return curry(divideImplementation, args);\n}\n\n// The implementation only uses `number` types, but that's just because it's\n// hard to tell typescript that both value and divisor would be of the same\n// type.\nfunction divideImplementation(value: number, divisor: number): number {\n return value / divisor;\n}\n"],"mappings":"kGAiCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"divide.cjs","names":["curry"],"sources":["../src/divide.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Divides two numbers.\n *\n * @param value - The number.\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(value, divisor);\n * @example\n * divide(12, 3) // => 4\n * reduce([1, 2, 3, 4], divide, 24) // => 1\n * @dataFirst\n * @category Number\n */\nexport function divide(value: bigint, divisor: bigint): bigint;\nexport function divide(value: number, divisor: number): number;\n\n/**\n * Divides two numbers.\n *\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(divisor)(value);\n * @example\n * divide(3)(12) // => 4\n * map([2, 4, 6, 8], divide(2)) // => [1, 2, 3, 4]\n * @dataLast\n * @category Number\n */\nexport function divide(divisor: bigint): (value: bigint) => bigint;\nexport function divide(divisor: number): (value: number) => number;\n\nexport function divide(...args: ReadonlyArray<unknown>): unknown {\n return curry(divideImplementation, args);\n}\n\n// The implementation only uses `number` types, but that's just because it's\n// hard to tell typescript that both value and divisor would be of the same\n// type.\nfunction divideImplementation(value: number, divisor: number): number {\n return value / divisor;\n}\n"],"mappings":"kGAiCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,CAAI,CACzC,CAKA,SAAS,EAAqB,EAAe,EAAyB,CACpE,OAAO,EAAQ,CACjB"}
|
package/dist/divide.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divide.js","names":[],"sources":["../src/divide.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Divides two numbers.\n *\n * @param value - The number.\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(value, divisor);\n * @example\n * divide(12, 3) // => 4\n * reduce([1, 2, 3, 4], divide, 24) // => 1\n * @dataFirst\n * @category Number\n */\nexport function divide(value: bigint, divisor: bigint): bigint;\nexport function divide(value: number, divisor: number): number;\n\n/**\n * Divides two numbers.\n *\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(divisor)(value);\n * @example\n * divide(3)(12) // => 4\n * map([2, 4, 6, 8], divide(2)) // => [1, 2, 3, 4]\n * @dataLast\n * @category Number\n */\nexport function divide(divisor: bigint): (value: bigint) => bigint;\nexport function divide(divisor: number): (value: number) => number;\n\nexport function divide(...args: ReadonlyArray<unknown>): unknown {\n return curry(divideImplementation, args);\n}\n\n// The implementation only uses `number` types, but that's just because it's\n// hard to tell typescript that both value and divisor would be of the same\n// type.\nfunction divideImplementation(value: number, divisor: number): number {\n return value / divisor;\n}\n"],"mappings":"mCAiCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"divide.js","names":[],"sources":["../src/divide.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Divides two numbers.\n *\n * @param value - The number.\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(value, divisor);\n * @example\n * divide(12, 3) // => 4\n * reduce([1, 2, 3, 4], divide, 24) // => 1\n * @dataFirst\n * @category Number\n */\nexport function divide(value: bigint, divisor: bigint): bigint;\nexport function divide(value: number, divisor: number): number;\n\n/**\n * Divides two numbers.\n *\n * @param divisor - The number to divide the value by.\n * @signature\n * divide(divisor)(value);\n * @example\n * divide(3)(12) // => 4\n * map([2, 4, 6, 8], divide(2)) // => [1, 2, 3, 4]\n * @dataLast\n * @category Number\n */\nexport function divide(divisor: bigint): (value: bigint) => bigint;\nexport function divide(divisor: number): (value: number) => number;\n\nexport function divide(...args: ReadonlyArray<unknown>): unknown {\n return curry(divideImplementation, args);\n}\n\n// The implementation only uses `number` types, but that's just because it's\n// hard to tell typescript that both value and divisor would be of the same\n// type.\nfunction divideImplementation(value: number, divisor: number): number {\n return value / divisor;\n}\n"],"mappings":"mCAiCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,CAAI,CACzC,CAKA,SAAS,EAAqB,EAAe,EAAyB,CACpE,OAAO,EAAQ,CACjB"}
|
package/dist/do-nothing.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"do-nothing.cjs","names":[],"sources":["../src/do-nothing.ts"],"sourcesContent":["/**\n * A function that takes any arguments and does nothing with them. This is\n * useful as a placeholder for any function or API that requires a **void**\n * function (a function that doesn't return a value). This could also be used in\n * combination with a ternary or other conditional execution to allow disabling\n * a function call for a specific case.\n *\n * Notice that this is a dataLast impl where the function needs to be invoked\n * to get the \"do nothing\" function.\n *\n * See also:\n * `constant` - A function that ignores it's arguments and returns the same value on every invocation.\n * `identity` - A function that returns the first argument it receives.\n *\n * @signature\n * doNothing();\n * @example\n * myApi({ onSuccess: handleSuccess, onError: doNothing() });\n * myApi({ onSuccess: isDemoMode ? doNothing(): handleSuccess });\n * @dataLast\n * @category Function\n */\nexport function doNothing(): typeof doesNothing {\n // Notice that the exported identity function is just the \"factory\" for the\n // function. We do it this way so that all \"Function\" utilities have a similar\n // API where the function is called, and not just used \"headless\". e.g.\n // `doNothing()` and not `doNothing`, just like the API for `constant(1)`.\n return doesNothing;\n}\n\nfunction doesNothing<Args extends ReadonlyArray<unknown>>(..._args: Args): void {\n /* do nothing */\n}\n"],"mappings":"mEAsBA,SAAgB,GAAgC,CAK9C,OAAO,
|
|
1
|
+
{"version":3,"file":"do-nothing.cjs","names":[],"sources":["../src/do-nothing.ts"],"sourcesContent":["/**\n * A function that takes any arguments and does nothing with them. This is\n * useful as a placeholder for any function or API that requires a **void**\n * function (a function that doesn't return a value). This could also be used in\n * combination with a ternary or other conditional execution to allow disabling\n * a function call for a specific case.\n *\n * Notice that this is a dataLast impl where the function needs to be invoked\n * to get the \"do nothing\" function.\n *\n * See also:\n * `constant` - A function that ignores it's arguments and returns the same value on every invocation.\n * `identity` - A function that returns the first argument it receives.\n *\n * @signature\n * doNothing();\n * @example\n * myApi({ onSuccess: handleSuccess, onError: doNothing() });\n * myApi({ onSuccess: isDemoMode ? doNothing(): handleSuccess });\n * @dataLast\n * @category Function\n */\nexport function doNothing(): typeof doesNothing {\n // Notice that the exported identity function is just the \"factory\" for the\n // function. We do it this way so that all \"Function\" utilities have a similar\n // API where the function is called, and not just used \"headless\". e.g.\n // `doNothing()` and not `doNothing`, just like the API for `constant(1)`.\n return doesNothing;\n}\n\nfunction doesNothing<Args extends ReadonlyArray<unknown>>(..._args: Args): void {\n /* do nothing */\n}\n"],"mappings":"mEAsBA,SAAgB,GAAgC,CAK9C,OAAO,CACT,CAEA,SAAS,EAAiD,GAAG,EAAmB,CAEhF"}
|
package/dist/do-nothing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"do-nothing.js","names":[],"sources":["../src/do-nothing.ts"],"sourcesContent":["/**\n * A function that takes any arguments and does nothing with them. This is\n * useful as a placeholder for any function or API that requires a **void**\n * function (a function that doesn't return a value). This could also be used in\n * combination with a ternary or other conditional execution to allow disabling\n * a function call for a specific case.\n *\n * Notice that this is a dataLast impl where the function needs to be invoked\n * to get the \"do nothing\" function.\n *\n * See also:\n * `constant` - A function that ignores it's arguments and returns the same value on every invocation.\n * `identity` - A function that returns the first argument it receives.\n *\n * @signature\n * doNothing();\n * @example\n * myApi({ onSuccess: handleSuccess, onError: doNothing() });\n * myApi({ onSuccess: isDemoMode ? doNothing(): handleSuccess });\n * @dataLast\n * @category Function\n */\nexport function doNothing(): typeof doesNothing {\n // Notice that the exported identity function is just the \"factory\" for the\n // function. We do it this way so that all \"Function\" utilities have a similar\n // API where the function is called, and not just used \"headless\". e.g.\n // `doNothing()` and not `doNothing`, just like the API for `constant(1)`.\n return doesNothing;\n}\n\nfunction doesNothing<Args extends ReadonlyArray<unknown>>(..._args: Args): void {\n /* do nothing */\n}\n"],"mappings":"AAsBA,SAAgB,GAAgC,CAK9C,OAAO,
|
|
1
|
+
{"version":3,"file":"do-nothing.js","names":[],"sources":["../src/do-nothing.ts"],"sourcesContent":["/**\n * A function that takes any arguments and does nothing with them. This is\n * useful as a placeholder for any function or API that requires a **void**\n * function (a function that doesn't return a value). This could also be used in\n * combination with a ternary or other conditional execution to allow disabling\n * a function call for a specific case.\n *\n * Notice that this is a dataLast impl where the function needs to be invoked\n * to get the \"do nothing\" function.\n *\n * See also:\n * `constant` - A function that ignores it's arguments and returns the same value on every invocation.\n * `identity` - A function that returns the first argument it receives.\n *\n * @signature\n * doNothing();\n * @example\n * myApi({ onSuccess: handleSuccess, onError: doNothing() });\n * myApi({ onSuccess: isDemoMode ? doNothing(): handleSuccess });\n * @dataLast\n * @category Function\n */\nexport function doNothing(): typeof doesNothing {\n // Notice that the exported identity function is just the \"factory\" for the\n // function. We do it this way so that all \"Function\" utilities have a similar\n // API where the function is called, and not just used \"headless\". e.g.\n // `doNothing()` and not `doNothing`, just like the API for `constant(1)`.\n return doesNothing;\n}\n\nfunction doesNothing<Args extends ReadonlyArray<unknown>>(..._args: Args): void {\n /* do nothing */\n}\n"],"mappings":"AAsBA,SAAgB,GAAgC,CAK9C,OAAO,CACT,CAEA,SAAS,EAAiD,GAAG,EAAmB,CAEhF"}
|
package/dist/drop-first-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-order-rules-CacOTzfW.cjs"),t=require("./heap-BK0Y5t1Y.cjs");function n(...t){return e.n(r,t)}function r(e,n,r){if(r>=e.length)return[];if(r<=0)return[...e];let i=e.slice(0,r);t.n(i,n);let a=[],o=e.slice(r);for(let e of o){let r=t.t(i,n,e);a.push(r??e)}return a}exports.dropFirstBy=n;
|
|
2
2
|
//# sourceMappingURL=drop-first-by.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-first-by.cjs","names":["curryOrderRulesWithArgument","heapMaybeInsert"],"sources":["../src/drop-first-by.ts"],"sourcesContent":["import type { OrderRule } from './internal/curry-order-rules';\nimport type { CompareFunction } from './internal/types/compare-function';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport {\n curryOrderRulesWithArgument,\n\n} from './internal/curry-order-rules';\nimport { heapify, heapMaybeInsert } from './internal/heap';\n\n/**\n * Drop the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before dropping the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to keep `n` elements) see `takeFirstBy`.\n *\n * @param data - The input array.\n * @param n - The number of items to drop. If `n` is non-positive no items would be dropped and a *clone* of the input would be returned, if `n` is bigger then data.length no items would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * dropFirstBy(data, n, ...rules);\n * @example\n * dropFirstBy(['aa', 'aaaa', 'a', 'aaa'], 2, x => x.length); // => ['aaaa', 'aaa']\n * @dataFirst\n * @category Array\n */\nexport function dropFirstBy<T>(\n data: ReadonlyArray<T>,\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): Array<T>;\n\n/**\n * Drop the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before dropping the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to keep `n` elements) see `takeFirstBy`.\n *\n * @param n - The number of items to drop. If `n` is non-positive no items would be dropped and a *clone* of the input would be returned, if `n` is bigger then data.length no items would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * dropFirstBy(n, ...rules)(data);\n * @example\n * pipe(['aa', 'aaaa', 'a', 'aaa'], dropFirstBy(2, x => x.length)); // => ['aaaa', 'aaa']\n * @dataLast\n * @category Array\n */\nexport function dropFirstBy<T>(\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function dropFirstBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(dropFirstByImplementation, args);\n}\n\nfunction dropFirstByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n n: number,\n): Array<T> {\n if (n >= data.length) {\n return [];\n }\n\n if (n <= 0) {\n return [...data];\n }\n\n const heap = data.slice(0, n);\n heapify(heap, compareFn);\n\n const out = [];\n\n const rest = data.slice(n);\n for (const item of rest) {\n const previousHead = heapMaybeInsert(heap, compareFn, item);\n out.push(previousHead ?? item);\n }\n\n return out;\n}\n"],"mappings":"wJAmDA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAOA,EAAAA,EAA4B,EAA2B,
|
|
1
|
+
{"version":3,"file":"drop-first-by.cjs","names":["curryOrderRulesWithArgument","heapMaybeInsert"],"sources":["../src/drop-first-by.ts"],"sourcesContent":["import type { OrderRule } from './internal/curry-order-rules';\nimport type { CompareFunction } from './internal/types/compare-function';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport {\n curryOrderRulesWithArgument,\n\n} from './internal/curry-order-rules';\nimport { heapify, heapMaybeInsert } from './internal/heap';\n\n/**\n * Drop the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before dropping the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to keep `n` elements) see `takeFirstBy`.\n *\n * @param data - The input array.\n * @param n - The number of items to drop. If `n` is non-positive no items would be dropped and a *clone* of the input would be returned, if `n` is bigger then data.length no items would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * dropFirstBy(data, n, ...rules);\n * @example\n * dropFirstBy(['aa', 'aaaa', 'a', 'aaa'], 2, x => x.length); // => ['aaaa', 'aaa']\n * @dataFirst\n * @category Array\n */\nexport function dropFirstBy<T>(\n data: ReadonlyArray<T>,\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): Array<T>;\n\n/**\n * Drop the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before dropping the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to keep `n` elements) see `takeFirstBy`.\n *\n * @param n - The number of items to drop. If `n` is non-positive no items would be dropped and a *clone* of the input would be returned, if `n` is bigger then data.length no items would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * dropFirstBy(n, ...rules)(data);\n * @example\n * pipe(['aa', 'aaaa', 'a', 'aaa'], dropFirstBy(2, x => x.length)); // => ['aaaa', 'aaa']\n * @dataLast\n * @category Array\n */\nexport function dropFirstBy<T>(\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function dropFirstBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(dropFirstByImplementation, args);\n}\n\nfunction dropFirstByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n n: number,\n): Array<T> {\n if (n >= data.length) {\n return [];\n }\n\n if (n <= 0) {\n return [...data];\n }\n\n const heap = data.slice(0, n);\n heapify(heap, compareFn);\n\n const out = [];\n\n const rest = data.slice(n);\n for (const item of rest) {\n const previousHead = heapMaybeInsert(heap, compareFn, item);\n out.push(previousHead ?? item);\n }\n\n return out;\n}\n"],"mappings":"wJAmDA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAOA,EAAAA,EAA4B,EAA2B,CAAI,CACpE,CAEA,SAAS,EACP,EACA,EACA,EACU,CACV,GAAI,GAAK,EAAK,OACZ,MAAO,CAAC,EAGV,GAAI,GAAK,EACP,MAAO,CAAC,GAAG,CAAI,EAGjB,IAAM,EAAO,EAAK,MAAM,EAAG,CAAC,EAC5B,EAAA,EAAQ,EAAM,CAAS,EAEvB,IAAM,EAAM,CAAC,EAEP,EAAO,EAAK,MAAM,CAAC,EACzB,IAAK,IAAM,KAAQ,EAAM,CACvB,IAAM,EAAeC,EAAAA,EAAgB,EAAM,EAAW,CAAI,EAC1D,EAAI,KAAK,GAAgB,CAAI,CAC/B,CAEA,OAAO,CACT"}
|
package/dist/drop-first-by.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./curry-order-rules-
|
|
1
|
+
import{n as e}from"./curry-order-rules-Dage-BeC.js";import{n as t,t as n}from"./heap-CL5ahv5n.js";function r(...t){return e(i,t)}function i(e,r,i){if(i>=e.length)return[];if(i<=0)return[...e];let a=e.slice(0,i);t(a,r);let o=[],s=e.slice(i);for(let e of s){let t=n(a,r,e);o.push(t??e)}return o}export{r as dropFirstBy};
|
|
2
2
|
//# sourceMappingURL=drop-first-by.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-first-by.js","names":[],"sources":["../src/drop-first-by.ts"],"sourcesContent":["import type { OrderRule } from './internal/curry-order-rules';\nimport type { CompareFunction } from './internal/types/compare-function';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport {\n curryOrderRulesWithArgument,\n\n} from './internal/curry-order-rules';\nimport { heapify, heapMaybeInsert } from './internal/heap';\n\n/**\n * Drop the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before dropping the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to keep `n` elements) see `takeFirstBy`.\n *\n * @param data - The input array.\n * @param n - The number of items to drop. If `n` is non-positive no items would be dropped and a *clone* of the input would be returned, if `n` is bigger then data.length no items would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * dropFirstBy(data, n, ...rules);\n * @example\n * dropFirstBy(['aa', 'aaaa', 'a', 'aaa'], 2, x => x.length); // => ['aaaa', 'aaa']\n * @dataFirst\n * @category Array\n */\nexport function dropFirstBy<T>(\n data: ReadonlyArray<T>,\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): Array<T>;\n\n/**\n * Drop the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before dropping the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to keep `n` elements) see `takeFirstBy`.\n *\n * @param n - The number of items to drop. If `n` is non-positive no items would be dropped and a *clone* of the input would be returned, if `n` is bigger then data.length no items would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * dropFirstBy(n, ...rules)(data);\n * @example\n * pipe(['aa', 'aaaa', 'a', 'aaa'], dropFirstBy(2, x => x.length)); // => ['aaaa', 'aaa']\n * @dataLast\n * @category Array\n */\nexport function dropFirstBy<T>(\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function dropFirstBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(dropFirstByImplementation, args);\n}\n\nfunction dropFirstByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n n: number,\n): Array<T> {\n if (n >= data.length) {\n return [];\n }\n\n if (n <= 0) {\n return [...data];\n }\n\n const heap = data.slice(0, n);\n heapify(heap, compareFn);\n\n const out = [];\n\n const rest = data.slice(n);\n for (const item of rest) {\n const previousHead = heapMaybeInsert(heap, compareFn, item);\n out.push(previousHead ?? item);\n }\n\n return out;\n}\n"],"mappings":"kGAmDA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAO,EAA4B,EAA2B,
|
|
1
|
+
{"version":3,"file":"drop-first-by.js","names":[],"sources":["../src/drop-first-by.ts"],"sourcesContent":["import type { OrderRule } from './internal/curry-order-rules';\nimport type { CompareFunction } from './internal/types/compare-function';\nimport type { NonEmptyArray } from './internal/types/non-empty-array';\nimport {\n curryOrderRulesWithArgument,\n\n} from './internal/curry-order-rules';\nimport { heapify, heapMaybeInsert } from './internal/heap';\n\n/**\n * Drop the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before dropping the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to keep `n` elements) see `takeFirstBy`.\n *\n * @param data - The input array.\n * @param n - The number of items to drop. If `n` is non-positive no items would be dropped and a *clone* of the input would be returned, if `n` is bigger then data.length no items would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * dropFirstBy(data, n, ...rules);\n * @example\n * dropFirstBy(['aa', 'aaaa', 'a', 'aaa'], 2, x => x.length); // => ['aaaa', 'aaa']\n * @dataFirst\n * @category Array\n */\nexport function dropFirstBy<T>(\n data: ReadonlyArray<T>,\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): Array<T>;\n\n/**\n * Drop the first `n` items from `data` based on the provided ordering criteria. This allows you to avoid sorting the array before dropping the items. The complexity of this function is *O(Nlogn)* where `N` is the length of the array.\n *\n * For the opposite operation (to keep `n` elements) see `takeFirstBy`.\n *\n * @param n - The number of items to drop. If `n` is non-positive no items would be dropped and a *clone* of the input would be returned, if `n` is bigger then data.length no items would be returned.\n * @param rules - A variadic array of order rules defining the sorting criteria. Each order rule is a projection function that extracts a comparable value from the data. Sorting is based on these extracted values using the native `<` and `>` operators. Earlier rules take precedence over later ones. Use the syntax `[projection, \"desc\"]` for descending order.\n * @returns A subset of the input array.\n * @signature\n * dropFirstBy(n, ...rules)(data);\n * @example\n * pipe(['aa', 'aaaa', 'a', 'aaa'], dropFirstBy(2, x => x.length)); // => ['aaaa', 'aaa']\n * @dataLast\n * @category Array\n */\nexport function dropFirstBy<T>(\n n: number,\n ...rules: Readonly<NonEmptyArray<OrderRule<T>>>\n): (data: ReadonlyArray<T>) => Array<T>;\n\nexport function dropFirstBy(...args: ReadonlyArray<unknown>): unknown {\n return curryOrderRulesWithArgument(dropFirstByImplementation, args);\n}\n\nfunction dropFirstByImplementation<T>(\n data: ReadonlyArray<T>,\n compareFn: CompareFunction<T>,\n n: number,\n): Array<T> {\n if (n >= data.length) {\n return [];\n }\n\n if (n <= 0) {\n return [...data];\n }\n\n const heap = data.slice(0, n);\n heapify(heap, compareFn);\n\n const out = [];\n\n const rest = data.slice(n);\n for (const item of rest) {\n const previousHead = heapMaybeInsert(heap, compareFn, item);\n out.push(previousHead ?? item);\n }\n\n return out;\n}\n"],"mappings":"kGAmDA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAO,EAA4B,EAA2B,CAAI,CACpE,CAEA,SAAS,EACP,EACA,EACA,EACU,CACV,GAAI,GAAK,EAAK,OACZ,MAAO,CAAC,EAGV,GAAI,GAAK,EACP,MAAO,CAAC,GAAG,CAAI,EAGjB,IAAM,EAAO,EAAK,MAAM,EAAG,CAAC,EAC5B,EAAQ,EAAM,CAAS,EAEvB,IAAM,EAAM,CAAC,EAEP,EAAO,EAAK,MAAM,CAAC,EACzB,IAAK,IAAM,KAAQ,EAAM,CACvB,IAAM,EAAe,EAAgB,EAAM,EAAW,CAAI,EAC1D,EAAI,KAAK,GAAgB,CAAI,CAC/B,CAEA,OAAO,CACT"}
|
package/dist/drop-last-while.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){for(let n=e.length-1;n>=0;n--)if(!t(e[n],n,e))return e.slice(0,n+1);return[]}exports.dropLastWhile=t;
|
|
2
2
|
//# sourceMappingURL=drop-last-while.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-last-while.cjs","names":["curry"],"sources":["../src/drop-last-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes elements from the end of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array starting from the end and moving towards the beginning, until the predicate returns false. The returned array includes elements from the beginning of the array, up to and including the element that produced false for the predicate.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * dropLastWhile(data, predicate)\n * @example\n * dropLastWhile([1, 2, 10, 3, 4], x => x < 10) // => [1, 2, 10]\n * @dataFirst\n * @category Array\n */\nexport function dropLastWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Removes elements from the end of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array starting from the end and moving towards the beginning, until the predicate returns false. The returned array includes elements from the beginning of the array, up to and including the element that produced false for the predicate.\n *\n * @param predicate - The predicate.\n * @signature\n * dropLastWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4], dropLastWhile(x => x < 10)) // => [1, 2, 10]\n * @dataLast\n * @category Array\n */\nexport function dropLastWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function dropLastWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropLastWhileImplementation, args);\n}\n\nfunction dropLastWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (let i = data.length - 1; i >= 0; i--) {\n if (!predicate(data[i], i, data)) {\n return data.slice(0, i + 1);\n }\n }\n return [];\n}\n"],"mappings":"kGAuCA,SAAgB,EAAc,GAAG,EAAuC,CACtE,OAAOA,EAAAA,MAAM,EAA6B,
|
|
1
|
+
{"version":3,"file":"drop-last-while.cjs","names":["curry"],"sources":["../src/drop-last-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes elements from the end of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array starting from the end and moving towards the beginning, until the predicate returns false. The returned array includes elements from the beginning of the array, up to and including the element that produced false for the predicate.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * dropLastWhile(data, predicate)\n * @example\n * dropLastWhile([1, 2, 10, 3, 4], x => x < 10) // => [1, 2, 10]\n * @dataFirst\n * @category Array\n */\nexport function dropLastWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Removes elements from the end of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array starting from the end and moving towards the beginning, until the predicate returns false. The returned array includes elements from the beginning of the array, up to and including the element that produced false for the predicate.\n *\n * @param predicate - The predicate.\n * @signature\n * dropLastWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4], dropLastWhile(x => x < 10)) // => [1, 2, 10]\n * @dataLast\n * @category Array\n */\nexport function dropLastWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function dropLastWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropLastWhileImplementation, args);\n}\n\nfunction dropLastWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (let i = data.length - 1; i >= 0; i--) {\n if (!predicate(data[i], i, data)) {\n return data.slice(0, i + 1);\n }\n }\n return [];\n}\n"],"mappings":"kGAuCA,SAAgB,EAAc,GAAG,EAAuC,CACtE,OAAOA,EAAAA,MAAM,EAA6B,CAAI,CAChD,CAEA,SAAS,EACP,EACA,EACkB,CAClB,IAAK,IAAI,EAAI,EAAK,OAAS,EAAG,GAAK,EAAG,IACpC,GAAI,CAAC,EAAU,EAAK,GAAI,EAAG,CAAI,EAC7B,OAAO,EAAK,MAAM,EAAG,EAAI,CAAC,EAG9B,MAAO,CAAC,CACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-last-while.js","names":[],"sources":["../src/drop-last-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes elements from the end of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array starting from the end and moving towards the beginning, until the predicate returns false. The returned array includes elements from the beginning of the array, up to and including the element that produced false for the predicate.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * dropLastWhile(data, predicate)\n * @example\n * dropLastWhile([1, 2, 10, 3, 4], x => x < 10) // => [1, 2, 10]\n * @dataFirst\n * @category Array\n */\nexport function dropLastWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Removes elements from the end of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array starting from the end and moving towards the beginning, until the predicate returns false. The returned array includes elements from the beginning of the array, up to and including the element that produced false for the predicate.\n *\n * @param predicate - The predicate.\n * @signature\n * dropLastWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4], dropLastWhile(x => x < 10)) // => [1, 2, 10]\n * @dataLast\n * @category Array\n */\nexport function dropLastWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function dropLastWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropLastWhileImplementation, args);\n}\n\nfunction dropLastWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (let i = data.length - 1; i >= 0; i--) {\n if (!predicate(data[i], i, data)) {\n return data.slice(0, i + 1);\n }\n }\n return [];\n}\n"],"mappings":"mCAuCA,SAAgB,EAAc,GAAG,EAAuC,CACtE,OAAO,EAAM,EAA6B,
|
|
1
|
+
{"version":3,"file":"drop-last-while.js","names":[],"sources":["../src/drop-last-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes elements from the end of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array starting from the end and moving towards the beginning, until the predicate returns false. The returned array includes elements from the beginning of the array, up to and including the element that produced false for the predicate.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * dropLastWhile(data, predicate)\n * @example\n * dropLastWhile([1, 2, 10, 3, 4], x => x < 10) // => [1, 2, 10]\n * @dataFirst\n * @category Array\n */\nexport function dropLastWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Removes elements from the end of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array starting from the end and moving towards the beginning, until the predicate returns false. The returned array includes elements from the beginning of the array, up to and including the element that produced false for the predicate.\n *\n * @param predicate - The predicate.\n * @signature\n * dropLastWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4], dropLastWhile(x => x < 10)) // => [1, 2, 10]\n * @dataLast\n * @category Array\n */\nexport function dropLastWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function dropLastWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropLastWhileImplementation, args);\n}\n\nfunction dropLastWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (let i = data.length - 1; i >= 0; i--) {\n if (!predicate(data[i], i, data)) {\n return data.slice(0, i + 1);\n }\n }\n return [];\n}\n"],"mappings":"mCAuCA,SAAgB,EAAc,GAAG,EAAuC,CACtE,OAAO,EAAM,EAA6B,CAAI,CAChD,CAEA,SAAS,EACP,EACA,EACkB,CAClB,IAAK,IAAI,EAAI,EAAK,OAAS,EAAG,GAAK,EAAG,IACpC,GAAI,CAAC,EAAU,EAAK,GAAI,EAAG,CAAI,EAC7B,OAAO,EAAK,MAAM,EAAG,EAAI,CAAC,EAG9B,MAAO,CAAC,CACV"}
|
package/dist/drop-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,t){return t>0?e.slice(0,Math.max(0,e.length-t)):[...e]}exports.dropLast=t;
|
|
2
2
|
//# sourceMappingURL=drop-last.cjs.map
|
package/dist/drop-last.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-last.cjs","names":["curry"],"sources":["../src/drop-last.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes last `n` elements from the `array`.\n *\n * @param array - The target array.\n * @param n - The number of elements to skip.\n * @signature\n * dropLast(array, n)\n * @example\n * dropLast([1, 2, 3, 4, 5], 2) // => [1, 2, 3]\n * @dataFirst\n * @category Array\n */\nexport function dropLast<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Removes last `n` elements from the `array`.\n *\n * @param n - The number of elements to skip.\n * @signature\n * dropLast(n)(array)\n * @example\n * dropLast(2)([1, 2, 3, 4, 5]) // => [1, 2, 3]\n * @dataLast\n * @category Array\n */\nexport function dropLast(\n n: number,\n): <T extends IterableContainer>(array: T) => Array<T[number]>;\n\nexport function dropLast(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropLastImplementation, args);\n}\n\nfunction dropLastImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n > 0 ? array.slice(0, Math.max(0, array.length - n)) : [...array];\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"drop-last.cjs","names":["curry"],"sources":["../src/drop-last.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes last `n` elements from the `array`.\n *\n * Related operations:\n * - `drop` - same, but from the start of the array.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `takeLast` - to keep the last `n` instead.\n *\n * @param array - The target array.\n * @param n - The number of elements to skip.\n * @signature\n * dropLast(array, n)\n * @example\n * dropLast([1, 2, 3, 4, 5], 2) // => [1, 2, 3]\n * @dataFirst\n * @category Array\n */\nexport function dropLast<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Removes last `n` elements from the `array`.\n *\n * Related operations:\n * - `drop` - same, but from the start of the array.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `takeLast` - to keep the last `n` instead.\n *\n * @param n - The number of elements to skip.\n * @signature\n * dropLast(n)(array)\n * @example\n * dropLast(2)([1, 2, 3, 4, 5]) // => [1, 2, 3]\n * @dataLast\n * @category Array\n */\nexport function dropLast(\n n: number,\n): <T extends IterableContainer>(array: T) => Array<T[number]>;\n\nexport function dropLast(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropLastImplementation, args);\n}\n\nfunction dropLastImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n > 0 ? array.slice(0, Math.max(0, array.length - n)) : [...array];\n}\n"],"mappings":"kGA6CA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAOA,EAAAA,MAAM,EAAwB,CAAI,CAC3C,CAEA,SAAS,EAAoD,EAAU,EAA6B,CAClG,OAAO,EAAI,EAAI,EAAM,MAAM,EAAG,KAAK,IAAI,EAAG,EAAM,OAAS,CAAC,CAAC,EAAI,CAAC,GAAG,CAAK,CAC1E"}
|
package/dist/drop-last.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-last.js","names":[],"sources":["../src/drop-last.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes last `n` elements from the `array`.\n *\n * @param array - The target array.\n * @param n - The number of elements to skip.\n * @signature\n * dropLast(array, n)\n * @example\n * dropLast([1, 2, 3, 4, 5], 2) // => [1, 2, 3]\n * @dataFirst\n * @category Array\n */\nexport function dropLast<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Removes last `n` elements from the `array`.\n *\n * @param n - The number of elements to skip.\n * @signature\n * dropLast(n)(array)\n * @example\n * dropLast(2)([1, 2, 3, 4, 5]) // => [1, 2, 3]\n * @dataLast\n * @category Array\n */\nexport function dropLast(\n n: number,\n): <T extends IterableContainer>(array: T) => Array<T[number]>;\n\nexport function dropLast(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropLastImplementation, args);\n}\n\nfunction dropLastImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n > 0 ? array.slice(0, Math.max(0, array.length - n)) : [...array];\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"drop-last.js","names":[],"sources":["../src/drop-last.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes last `n` elements from the `array`.\n *\n * Related operations:\n * - `drop` - same, but from the start of the array.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `takeLast` - to keep the last `n` instead.\n *\n * @param array - The target array.\n * @param n - The number of elements to skip.\n * @signature\n * dropLast(array, n)\n * @example\n * dropLast([1, 2, 3, 4, 5], 2) // => [1, 2, 3]\n * @dataFirst\n * @category Array\n */\nexport function dropLast<T extends IterableContainer>(\n array: T,\n n: number,\n): Array<T[number]>;\n\n/**\n * Removes last `n` elements from the `array`.\n *\n * Related operations:\n * - `drop` - same, but from the start of the array.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `takeLast` - to keep the last `n` instead.\n *\n * @param n - The number of elements to skip.\n * @signature\n * dropLast(n)(array)\n * @example\n * dropLast(2)([1, 2, 3, 4, 5]) // => [1, 2, 3]\n * @dataLast\n * @category Array\n */\nexport function dropLast(\n n: number,\n): <T extends IterableContainer>(array: T) => Array<T[number]>;\n\nexport function dropLast(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropLastImplementation, args);\n}\n\nfunction dropLastImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n > 0 ? array.slice(0, Math.max(0, array.length - n)) : [...array];\n}\n"],"mappings":"mCA6CA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAO,EAAM,EAAwB,CAAI,CAC3C,CAEA,SAAS,EAAoD,EAAU,EAA6B,CAClG,OAAO,EAAI,EAAI,EAAM,MAAM,EAAG,KAAK,IAAI,EAAG,EAAM,OAAS,CAAC,CAAC,EAAI,CAAC,GAAG,CAAK,CAC1E"}
|
package/dist/drop-while.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){for(let[n,r]of e.entries())if(!t(r,n,e))return e.slice(n);return[]}exports.dropWhile=t;
|
|
2
2
|
//# sourceMappingURL=drop-while.cjs.map
|
package/dist/drop-while.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-while.cjs","names":["curry"],"sources":["../src/drop-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes elements from the beginning of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array, until the predicate returns false. The returned array includes the rest of the elements, starting with the element that produced false for the predicate.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * dropWhile(data, predicate)\n * @example\n * dropWhile([1, 2, 10, 3, 4], x => x < 10) // => [10, 3, 4]\n * @dataFirst\n * @category Array\n */\nexport function dropWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Removes elements from the beginning of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array, until the predicate returns false. The returned array includes the rest of the elements, starting with the element that produced false for the predicate.\n *\n * @param predicate - The predicate.\n * @signature\n * dropWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4], dropWhile(x => x < 10)) // => [10, 3, 4]\n * @dataLast\n * @category Array\n */\nexport function dropWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function dropWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropWhileImplementation, args);\n}\n\nfunction dropWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (const [index, item] of data.entries()) {\n if (!predicate(item, index, data)) {\n return data.slice(index);\n }\n }\n return [];\n}\n"],"mappings":"kGAuCA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAOA,EAAAA,MAAM,EAAyB,
|
|
1
|
+
{"version":3,"file":"drop-while.cjs","names":["curry"],"sources":["../src/drop-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes elements from the beginning of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array, until the predicate returns false. The returned array includes the rest of the elements, starting with the element that produced false for the predicate.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * dropWhile(data, predicate)\n * @example\n * dropWhile([1, 2, 10, 3, 4], x => x < 10) // => [10, 3, 4]\n * @dataFirst\n * @category Array\n */\nexport function dropWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Removes elements from the beginning of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array, until the predicate returns false. The returned array includes the rest of the elements, starting with the element that produced false for the predicate.\n *\n * @param predicate - The predicate.\n * @signature\n * dropWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4], dropWhile(x => x < 10)) // => [10, 3, 4]\n * @dataLast\n * @category Array\n */\nexport function dropWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function dropWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropWhileImplementation, args);\n}\n\nfunction dropWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (const [index, item] of data.entries()) {\n if (!predicate(item, index, data)) {\n return data.slice(index);\n }\n }\n return [];\n}\n"],"mappings":"kGAuCA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAOA,EAAAA,MAAM,EAAyB,CAAI,CAC5C,CAEA,SAAS,EACP,EACA,EACkB,CAClB,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,QAAQ,EACvC,GAAI,CAAC,EAAU,EAAM,EAAO,CAAI,EAC9B,OAAO,EAAK,MAAM,CAAK,EAG3B,MAAO,CAAC,CACV"}
|
package/dist/drop-while.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-while.js","names":[],"sources":["../src/drop-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes elements from the beginning of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array, until the predicate returns false. The returned array includes the rest of the elements, starting with the element that produced false for the predicate.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * dropWhile(data, predicate)\n * @example\n * dropWhile([1, 2, 10, 3, 4], x => x < 10) // => [10, 3, 4]\n * @dataFirst\n * @category Array\n */\nexport function dropWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Removes elements from the beginning of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array, until the predicate returns false. The returned array includes the rest of the elements, starting with the element that produced false for the predicate.\n *\n * @param predicate - The predicate.\n * @signature\n * dropWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4], dropWhile(x => x < 10)) // => [10, 3, 4]\n * @dataLast\n * @category Array\n */\nexport function dropWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function dropWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropWhileImplementation, args);\n}\n\nfunction dropWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (const [index, item] of data.entries()) {\n if (!predicate(item, index, data)) {\n return data.slice(index);\n }\n }\n return [];\n}\n"],"mappings":"mCAuCA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAO,EAAM,EAAyB,
|
|
1
|
+
{"version":3,"file":"drop-while.js","names":[],"sources":["../src/drop-while.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Removes elements from the beginning of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array, until the predicate returns false. The returned array includes the rest of the elements, starting with the element that produced false for the predicate.\n *\n * @param data - The array.\n * @param predicate - The predicate.\n * @signature\n * dropWhile(data, predicate)\n * @example\n * dropWhile([1, 2, 10, 3, 4], x => x < 10) // => [10, 3, 4]\n * @dataFirst\n * @category Array\n */\nexport function dropWhile<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]>;\n\n/**\n * Removes elements from the beginning of the array until the predicate returns false.\n *\n * The predicate is applied to each element in the array, until the predicate returns false. The returned array includes the rest of the elements, starting with the element that produced false for the predicate.\n *\n * @param predicate - The predicate.\n * @signature\n * dropWhile(predicate)(data)\n * @example\n * pipe([1, 2, 10, 3, 4], dropWhile(x => x < 10)) // => [10, 3, 4]\n * @dataLast\n * @category Array\n */\nexport function dropWhile<T extends IterableContainer>(\n predicate: (item: T[number], index: number, data: T) => boolean,\n): (data: T) => Array<T[number]>;\n\nexport function dropWhile(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropWhileImplementation, args);\n}\n\nfunction dropWhileImplementation<T extends IterableContainer>(\n data: T,\n predicate: (item: T[number], index: number, data: T) => boolean,\n): Array<T[number]> {\n for (const [index, item] of data.entries()) {\n if (!predicate(item, index, data)) {\n return data.slice(index);\n }\n }\n return [];\n}\n"],"mappings":"mCAuCA,SAAgB,EAAU,GAAG,EAAuC,CAClE,OAAO,EAAM,EAAyB,CAAI,CAC5C,CAEA,SAAS,EACP,EACA,EACkB,CAClB,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,QAAQ,EACvC,GAAI,CAAC,EAAU,EAAM,EAAO,CAAI,EAC9B,OAAO,EAAK,MAAM,CAAK,EAG3B,MAAO,CAAC,CACV"}
|
package/dist/drop.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("./utility-evaluators-BGM19SpK.cjs");function n(...t){return e.curry(r,t,i)}function r(e,t){return t<0?[...e]:e.slice(t)}function i(e){if(e<=0)return t.r;let n=e;return e=>n>0?(--n,t.t):{done:!1,hasNext:!0,next:e}}exports.drop=n;
|
|
2
2
|
//# sourceMappingURL=drop.cjs.map
|
package/dist/drop.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop.cjs","names":["curry","lazyIdentityEvaluator","SKIP_ITEM"],"sources":["../src/drop.ts"],"sourcesContent":["import type { IsInteger, IsNegative, Writable } from 'type-fest';\nimport type { ClampedIntegerSubtract } from './internal/types/clamped-integer-subtract';\nimport type { CoercedArray } from './internal/types/coerced-array';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { PartialArray } from './internal/types/partial-array';\nimport type { TupleParts } from './internal/types/tuple-parts';\nimport { curry } from './curry';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\ntype Drop<T extends IterableContainer, N extends number>\n = IsNegative<N> extends true\n ? // Negative numbers result in nothing being dropped, we return a shallow\n // clone of the array.\n Writable<T>\n : IsInteger<N> extends true\n ? ClampedIntegerSubtract<\n N,\n TupleParts<T>['required']['length']\n > extends infer RemainingPrefix extends number\n ? RemainingPrefix extends 0\n ? // The drop will occur within the required part of the tuple, we\n // simply remove those elements from it and reconstruct the rest of\n // the tuple.\n [\n ...DropFixedTuple<TupleParts<T>['required'], N>,\n ...PartialArray<TupleParts<T>['optional']>,\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n : ClampedIntegerSubtract<\n RemainingPrefix,\n TupleParts<T>['optional']['length']\n > extends infer RemainingOptional extends number\n ? RemainingOptional extends 0\n ? // The drop will occur within the optional part of the tuple, we\n // completely remove the required part, remove enough elements\n // from the optional part, and reconstruct the rest of the\n // tuple.\n [\n ...PartialArray<\n DropFixedTuple<TupleParts<T>['optional'], RemainingPrefix>\n >,\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n : // The drop will occur within the rest element or the suffix.\n // Because the suffix can contain any number of elements this\n // case adds more complexity as we need to consider all\n // possible (relevant) lengths. We start by considering the\n // case where there are enough elements within the rest\n // param; this means we still maintain the rest element as it\n // could contain even more elements, and we add the suffix\n // untouched.\n | [\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n // Additionally, we need to consider the case where the rest\n // element has up to the same number of elements as the\n // suffix; this will result in removing the rest element\n // entirely, and dropping elements from the suffix. We do this\n // for all possible values from 0 to N where N is the\n // remaining value after we handled the prefix. We can exclude\n // the 0 case because it is contained in the previous case.\n | Exclude<\n DropFixedTuple<\n TupleParts<T>['suffix'],\n RemainingOptional,\n true\n >,\n TupleParts<T>['suffix']\n >\n : never\n : never\n : // We can't compute accurate types for non-integer numbers so we\n // fallback to the \"legacy\" typing where we convert our output to a\n // simple array. This is also the case when N is not a literal value\n // (e.g. it is `number`).\n // TODO: We can improve this type by returning a union of all possible dropped shapes (e.g. the equivalent of Drop<T, 1> | Drop<T, 2> | Drop<T, 3> | ...).\n Array<T[number]>;\n\ntype DropFixedTuple<\n T,\n N,\n // This flag controls if we want a union of all possible prefixes, or just the\n // final tuple with all N items dropped.\n IncludePrefixes = false,\n Dropped extends Array<unknown> = [],\n> = Dropped['length'] extends N\n ? T\n : T extends readonly [unknown, ...infer Rest]\n ?\n | DropFixedTuple<Rest, N, IncludePrefixes, [...Dropped, unknown]>\n | (true extends IncludePrefixes ? T : never)\n : [];\n\n/**\n * Removes first `n` elements from the `array`.\n *\n * @param array - The target array.\n * @param n - The number of elements to skip.\n * @signature\n * drop(array, n)\n * @example\n * drop([1, 2, 3, 4, 5], 2) // => [3, 4, 5]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function drop<T extends IterableContainer, N extends number>(\n array: T,\n n: N,\n): Drop<T, N>;\n\n/**\n * Removes first `n` elements from the `array`.\n *\n * @param n - The number of elements to skip.\n * @signature\n * drop(n)(array)\n * @example\n * drop(2)([1, 2, 3, 4, 5]) // => [3, 4, 5]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function drop<N extends number>(\n n: N,\n): <T extends IterableContainer>(array: T) => Drop<T, N>;\n\nexport function drop(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropImplementation, args, lazyImplementation);\n}\n\nfunction dropImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n < 0 ? [...array] : array.slice(n);\n}\n\nfunction lazyImplementation<T>(n: number): LazyEvaluator<T> {\n if (n <= 0) {\n return lazyIdentityEvaluator;\n }\n\n let left = n;\n return (value) => {\n if (left > 0) {\n left -= 1;\n return SKIP_ITEM;\n }\n return { done: false, hasNext: true, next: value };\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"drop.cjs","names":["curry","lazyIdentityEvaluator","SKIP_ITEM"],"sources":["../src/drop.ts"],"sourcesContent":["import type { IsInteger, IsNegative, Writable } from 'type-fest';\nimport type { ClampedIntegerSubtract } from './internal/types/clamped-integer-subtract';\nimport type { CoercedArray } from './internal/types/coerced-array';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { PartialArray } from './internal/types/partial-array';\nimport type { TupleParts } from './internal/types/tuple-parts';\nimport { curry } from './curry';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\ntype Drop<T extends IterableContainer, N extends number>\n = IsNegative<N> extends true\n ? // Negative numbers result in nothing being dropped, we return a shallow\n // clone of the array.\n Writable<T>\n : IsInteger<N> extends true\n ? ClampedIntegerSubtract<\n N,\n TupleParts<T>['required']['length']\n > extends infer RemainingPrefix extends number\n ? RemainingPrefix extends 0\n ? // The drop will occur within the required part of the tuple, we\n // simply remove those elements from it and reconstruct the rest of\n // the tuple.\n [\n ...DropFixedTuple<TupleParts<T>['required'], N>,\n ...PartialArray<TupleParts<T>['optional']>,\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n : ClampedIntegerSubtract<\n RemainingPrefix,\n TupleParts<T>['optional']['length']\n > extends infer RemainingOptional extends number\n ? RemainingOptional extends 0\n ? // The drop will occur within the optional part of the tuple, we\n // completely remove the required part, remove enough elements\n // from the optional part, and reconstruct the rest of the\n // tuple.\n [\n ...PartialArray<\n DropFixedTuple<TupleParts<T>['optional'], RemainingPrefix>\n >,\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n : // The drop will occur within the rest element or the suffix.\n // Because the suffix can contain any number of elements this\n // case adds more complexity as we need to consider all\n // possible (relevant) lengths. We start by considering the\n // case where there are enough elements within the rest\n // param; this means we still maintain the rest element as it\n // could contain even more elements, and we add the suffix\n // untouched.\n | [\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n // Additionally, we need to consider the case where the rest\n // element has up to the same number of elements as the\n // suffix; this will result in removing the rest element\n // entirely, and dropping elements from the suffix. We do this\n // for all possible values from 0 to N where N is the\n // remaining value after we handled the prefix. We can exclude\n // the 0 case because it is contained in the previous case.\n | Exclude<\n DropFixedTuple<\n TupleParts<T>['suffix'],\n RemainingOptional,\n true\n >,\n TupleParts<T>['suffix']\n >\n : never\n : never\n : // We can't compute accurate types for non-integer numbers so we\n // fallback to the \"legacy\" typing where we convert our output to a\n // simple array. This is also the case when N is not a literal value\n // (e.g. it is `number`).\n // TODO: We can improve this type by returning a union of all possible dropped shapes (e.g. the equivalent of Drop<T, 1> | Drop<T, 2> | Drop<T, 3> | ...).\n Array<T[number]>;\n\ntype DropFixedTuple<\n T,\n N,\n // This flag controls if we want a union of all possible prefixes, or just the\n // final tuple with all N items dropped.\n IncludePrefixes = false,\n Dropped extends Array<unknown> = [],\n> = Dropped['length'] extends N\n ? T\n : T extends readonly [unknown, ...infer Rest]\n ?\n | DropFixedTuple<Rest, N, IncludePrefixes, [...Dropped, unknown]>\n | (true extends IncludePrefixes ? T : never)\n : [];\n\n/**\n * Removes first `n` elements from the `array`.\n *\n * Related operations:\n * - `dropLast` - same, but from the end of the array.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `take` - to keep the first `n` instead.\n *\n * @param array - The target array.\n * @param n - The number of elements to skip.\n * @signature\n * drop(array, n)\n * @example\n * drop([1, 2, 3, 4, 5], 2) // => [3, 4, 5]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function drop<T extends IterableContainer, N extends number>(\n array: T,\n n: N,\n): Drop<T, N>;\n\n/**\n * Removes first `n` elements from the `array`.\n *\n * Related operations:\n * - `dropLast` - same, but from the end of the array.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `take` - to keep the first `n` instead.\n *\n * @param n - The number of elements to skip.\n * @signature\n * drop(n)(array)\n * @example\n * drop(2)([1, 2, 3, 4, 5]) // => [3, 4, 5]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function drop<N extends number>(\n n: N,\n): <T extends IterableContainer>(array: T) => Drop<T, N>;\n\nexport function drop(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropImplementation, args, lazyImplementation);\n}\n\nfunction dropImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n < 0 ? [...array] : array.slice(n);\n}\n\nfunction lazyImplementation<T>(n: number): LazyEvaluator<T> {\n if (n <= 0) {\n return lazyIdentityEvaluator;\n }\n\n let left = n;\n return (value) => {\n if (left > 0) {\n left -= 1;\n return SKIP_ITEM;\n }\n return { done: false, hasNext: true, next: value };\n };\n}\n"],"mappings":"iJA6IA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAOA,EAAAA,MAAM,EAAoB,EAAM,CAAkB,CAC3D,CAEA,SAAS,EAAgD,EAAU,EAA6B,CAC9F,OAAO,EAAI,EAAI,CAAC,GAAG,CAAK,EAAI,EAAM,MAAM,CAAC,CAC3C,CAEA,SAAS,EAAsB,EAA6B,CAC1D,GAAI,GAAK,EACP,OAAOC,EAAAA,EAGT,IAAI,EAAO,EACX,MAAQ,IACF,EAAO,GACT,IACOC,EAAAA,GAEF,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,CAAM,CAErD"}
|
package/dist/drop.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{curry as e}from"./curry.js";import{r as t,t as n}from"./utility-evaluators-
|
|
1
|
+
import{curry as e}from"./curry.js";import{r as t,t as n}from"./utility-evaluators-DDW55xeL.js";function r(...t){return e(i,t,a)}function i(e,t){return t<0?[...e]:e.slice(t)}function a(e){if(e<=0)return t;let r=e;return e=>r>0?(--r,n):{done:!1,hasNext:!0,next:e}}export{r as drop};
|
|
2
2
|
//# sourceMappingURL=drop.js.map
|
package/dist/drop.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop.js","names":[],"sources":["../src/drop.ts"],"sourcesContent":["import type { IsInteger, IsNegative, Writable } from 'type-fest';\nimport type { ClampedIntegerSubtract } from './internal/types/clamped-integer-subtract';\nimport type { CoercedArray } from './internal/types/coerced-array';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { PartialArray } from './internal/types/partial-array';\nimport type { TupleParts } from './internal/types/tuple-parts';\nimport { curry } from './curry';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\ntype Drop<T extends IterableContainer, N extends number>\n = IsNegative<N> extends true\n ? // Negative numbers result in nothing being dropped, we return a shallow\n // clone of the array.\n Writable<T>\n : IsInteger<N> extends true\n ? ClampedIntegerSubtract<\n N,\n TupleParts<T>['required']['length']\n > extends infer RemainingPrefix extends number\n ? RemainingPrefix extends 0\n ? // The drop will occur within the required part of the tuple, we\n // simply remove those elements from it and reconstruct the rest of\n // the tuple.\n [\n ...DropFixedTuple<TupleParts<T>['required'], N>,\n ...PartialArray<TupleParts<T>['optional']>,\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n : ClampedIntegerSubtract<\n RemainingPrefix,\n TupleParts<T>['optional']['length']\n > extends infer RemainingOptional extends number\n ? RemainingOptional extends 0\n ? // The drop will occur within the optional part of the tuple, we\n // completely remove the required part, remove enough elements\n // from the optional part, and reconstruct the rest of the\n // tuple.\n [\n ...PartialArray<\n DropFixedTuple<TupleParts<T>['optional'], RemainingPrefix>\n >,\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n : // The drop will occur within the rest element or the suffix.\n // Because the suffix can contain any number of elements this\n // case adds more complexity as we need to consider all\n // possible (relevant) lengths. We start by considering the\n // case where there are enough elements within the rest\n // param; this means we still maintain the rest element as it\n // could contain even more elements, and we add the suffix\n // untouched.\n | [\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n // Additionally, we need to consider the case where the rest\n // element has up to the same number of elements as the\n // suffix; this will result in removing the rest element\n // entirely, and dropping elements from the suffix. We do this\n // for all possible values from 0 to N where N is the\n // remaining value after we handled the prefix. We can exclude\n // the 0 case because it is contained in the previous case.\n | Exclude<\n DropFixedTuple<\n TupleParts<T>['suffix'],\n RemainingOptional,\n true\n >,\n TupleParts<T>['suffix']\n >\n : never\n : never\n : // We can't compute accurate types for non-integer numbers so we\n // fallback to the \"legacy\" typing where we convert our output to a\n // simple array. This is also the case when N is not a literal value\n // (e.g. it is `number`).\n // TODO: We can improve this type by returning a union of all possible dropped shapes (e.g. the equivalent of Drop<T, 1> | Drop<T, 2> | Drop<T, 3> | ...).\n Array<T[number]>;\n\ntype DropFixedTuple<\n T,\n N,\n // This flag controls if we want a union of all possible prefixes, or just the\n // final tuple with all N items dropped.\n IncludePrefixes = false,\n Dropped extends Array<unknown> = [],\n> = Dropped['length'] extends N\n ? T\n : T extends readonly [unknown, ...infer Rest]\n ?\n | DropFixedTuple<Rest, N, IncludePrefixes, [...Dropped, unknown]>\n | (true extends IncludePrefixes ? T : never)\n : [];\n\n/**\n * Removes first `n` elements from the `array`.\n *\n * @param array - The target array.\n * @param n - The number of elements to skip.\n * @signature\n * drop(array, n)\n * @example\n * drop([1, 2, 3, 4, 5], 2) // => [3, 4, 5]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function drop<T extends IterableContainer, N extends number>(\n array: T,\n n: N,\n): Drop<T, N>;\n\n/**\n * Removes first `n` elements from the `array`.\n *\n * @param n - The number of elements to skip.\n * @signature\n * drop(n)(array)\n * @example\n * drop(2)([1, 2, 3, 4, 5]) // => [3, 4, 5]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function drop<N extends number>(\n n: N,\n): <T extends IterableContainer>(array: T) => Drop<T, N>;\n\nexport function drop(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropImplementation, args, lazyImplementation);\n}\n\nfunction dropImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n < 0 ? [...array] : array.slice(n);\n}\n\nfunction lazyImplementation<T>(n: number): LazyEvaluator<T> {\n if (n <= 0) {\n return lazyIdentityEvaluator;\n }\n\n let left = n;\n return (value) => {\n if (left > 0) {\n left -= 1;\n return SKIP_ITEM;\n }\n return { done: false, hasNext: true, next: value };\n };\n}\n"],"mappings":"+
|
|
1
|
+
{"version":3,"file":"drop.js","names":[],"sources":["../src/drop.ts"],"sourcesContent":["import type { IsInteger, IsNegative, Writable } from 'type-fest';\nimport type { ClampedIntegerSubtract } from './internal/types/clamped-integer-subtract';\nimport type { CoercedArray } from './internal/types/coerced-array';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport type { PartialArray } from './internal/types/partial-array';\nimport type { TupleParts } from './internal/types/tuple-parts';\nimport { curry } from './curry';\nimport { lazyIdentityEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\ntype Drop<T extends IterableContainer, N extends number>\n = IsNegative<N> extends true\n ? // Negative numbers result in nothing being dropped, we return a shallow\n // clone of the array.\n Writable<T>\n : IsInteger<N> extends true\n ? ClampedIntegerSubtract<\n N,\n TupleParts<T>['required']['length']\n > extends infer RemainingPrefix extends number\n ? RemainingPrefix extends 0\n ? // The drop will occur within the required part of the tuple, we\n // simply remove those elements from it and reconstruct the rest of\n // the tuple.\n [\n ...DropFixedTuple<TupleParts<T>['required'], N>,\n ...PartialArray<TupleParts<T>['optional']>,\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n : ClampedIntegerSubtract<\n RemainingPrefix,\n TupleParts<T>['optional']['length']\n > extends infer RemainingOptional extends number\n ? RemainingOptional extends 0\n ? // The drop will occur within the optional part of the tuple, we\n // completely remove the required part, remove enough elements\n // from the optional part, and reconstruct the rest of the\n // tuple.\n [\n ...PartialArray<\n DropFixedTuple<TupleParts<T>['optional'], RemainingPrefix>\n >,\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n : // The drop will occur within the rest element or the suffix.\n // Because the suffix can contain any number of elements this\n // case adds more complexity as we need to consider all\n // possible (relevant) lengths. We start by considering the\n // case where there are enough elements within the rest\n // param; this means we still maintain the rest element as it\n // could contain even more elements, and we add the suffix\n // untouched.\n | [\n ...CoercedArray<TupleParts<T>['item']>,\n ...TupleParts<T>['suffix'],\n ]\n // Additionally, we need to consider the case where the rest\n // element has up to the same number of elements as the\n // suffix; this will result in removing the rest element\n // entirely, and dropping elements from the suffix. We do this\n // for all possible values from 0 to N where N is the\n // remaining value after we handled the prefix. We can exclude\n // the 0 case because it is contained in the previous case.\n | Exclude<\n DropFixedTuple<\n TupleParts<T>['suffix'],\n RemainingOptional,\n true\n >,\n TupleParts<T>['suffix']\n >\n : never\n : never\n : // We can't compute accurate types for non-integer numbers so we\n // fallback to the \"legacy\" typing where we convert our output to a\n // simple array. This is also the case when N is not a literal value\n // (e.g. it is `number`).\n // TODO: We can improve this type by returning a union of all possible dropped shapes (e.g. the equivalent of Drop<T, 1> | Drop<T, 2> | Drop<T, 3> | ...).\n Array<T[number]>;\n\ntype DropFixedTuple<\n T,\n N,\n // This flag controls if we want a union of all possible prefixes, or just the\n // final tuple with all N items dropped.\n IncludePrefixes = false,\n Dropped extends Array<unknown> = [],\n> = Dropped['length'] extends N\n ? T\n : T extends readonly [unknown, ...infer Rest]\n ?\n | DropFixedTuple<Rest, N, IncludePrefixes, [...Dropped, unknown]>\n | (true extends IncludePrefixes ? T : never)\n : [];\n\n/**\n * Removes first `n` elements from the `array`.\n *\n * Related operations:\n * - `dropLast` - same, but from the end of the array.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `take` - to keep the first `n` instead.\n *\n * @param array - The target array.\n * @param n - The number of elements to skip.\n * @signature\n * drop(array, n)\n * @example\n * drop([1, 2, 3, 4, 5], 2) // => [3, 4, 5]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function drop<T extends IterableContainer, N extends number>(\n array: T,\n n: N,\n): Drop<T, N>;\n\n/**\n * Removes first `n` elements from the `array`.\n *\n * Related operations:\n * - `dropLast` - same, but from the end of the array.\n * - `splice` - to remove or insert at an arbitrary index.\n * - `take` - to keep the first `n` instead.\n *\n * @param n - The number of elements to skip.\n * @signature\n * drop(n)(array)\n * @example\n * drop(2)([1, 2, 3, 4, 5]) // => [3, 4, 5]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function drop<N extends number>(\n n: N,\n): <T extends IterableContainer>(array: T) => Drop<T, N>;\n\nexport function drop(...args: ReadonlyArray<unknown>): unknown {\n return curry(dropImplementation, args, lazyImplementation);\n}\n\nfunction dropImplementation<T extends IterableContainer>(array: T, n: number): Array<T[number]> {\n return n < 0 ? [...array] : array.slice(n);\n}\n\nfunction lazyImplementation<T>(n: number): LazyEvaluator<T> {\n if (n <= 0) {\n return lazyIdentityEvaluator;\n }\n\n let left = n;\n return (value) => {\n if (left > 0) {\n left -= 1;\n return SKIP_ITEM;\n }\n return { done: false, hasNext: true, next: value };\n };\n}\n"],"mappings":"+FA6IA,SAAgB,EAAK,GAAG,EAAuC,CAC7D,OAAO,EAAM,EAAoB,EAAM,CAAkB,CAC3D,CAEA,SAAS,EAAgD,EAAU,EAA6B,CAC9F,OAAO,EAAI,EAAI,CAAC,GAAG,CAAK,EAAI,EAAM,MAAM,CAAC,CAC3C,CAEA,SAAS,EAAsB,EAA6B,CAC1D,GAAI,GAAK,EACP,OAAO,EAGT,IAAI,EAAO,EACX,MAAQ,IACF,EAAO,GACT,IACO,GAEF,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,CAAM,CAErD"}
|
package/dist/ends-with.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){return e.endsWith(t)}exports.endsWith=t;
|
|
2
2
|
//# sourceMappingURL=ends-with.cjs.map
|
package/dist/ends-with.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ends-with.cjs","names":["curry"],"sources":["../src/ends-with.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Determines whether a string ends with the provided suffix, and refines the\n * output type if possible.\n *\n * This function is a wrapper around the built-in [`String.prototype.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\n * method, but doesn't expose the `endPosition` parameter. To check only up to a\n * specific position, use `endsWith(sliceString(data, 0, endPosition), suffix)`.\n *\n * @param data - The input string.\n * @param suffix - The string to check for at the end.\n * @signature\n * endsWith(data, suffix);\n * @example\n * endsWith(\"hello world\", \"hello\"); // false\n * endsWith(\"hello world\", \"world\"); // true\n * @dataFirst\n * @category String\n */\nexport function endsWith<T extends string, Suffix extends string>(\n data: T,\n suffix: string extends Suffix ? never : Suffix,\n): data is T & `${string}${Suffix}`;\nexport function endsWith(data: string, suffix: string): boolean;\n\n/**\n * Determines whether a string ends with the provided suffix, and refines the\n * output type if possible.\n *\n * This function is a wrapper around the built-in [`String.prototype.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\n * method, but doesn't expose the `endPosition` parameter. To check only up to a\n * specific position, use `endsWith(sliceString(data, 0, endPosition), suffix)`.\n *\n * @param suffix - The string to check for at the end.\n * @signature\n * endsWith(suffix)(data);\n * @example\n * pipe(\"hello world\", endsWith(\"hello\")); // false\n * pipe(\"hello world\", endsWith(\"world\")); // true\n * @dataLast\n * @category String\n */\nexport function endsWith<Suffix extends string>(\n suffix: string extends Suffix ? never : Suffix,\n): <T extends string>(data: T) => data is T & `${string}${Suffix}`;\nexport function endsWith(suffix: string): (data: string) => boolean;\n\nexport function endsWith(...args: ReadonlyArray<unknown>): unknown {\n return curry(endsWithImplementation, args);\n}\n\nfunction endsWithImplementation(data: string, suffix: string): boolean {\n return data.endsWith(suffix);\n}\n"],"mappings":"kGAgDA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAOA,EAAAA,MAAM,EAAwB,
|
|
1
|
+
{"version":3,"file":"ends-with.cjs","names":["curry"],"sources":["../src/ends-with.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Determines whether a string ends with the provided suffix, and refines the\n * output type if possible.\n *\n * This function is a wrapper around the built-in [`String.prototype.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\n * method, but doesn't expose the `endPosition` parameter. To check only up to a\n * specific position, use `endsWith(sliceString(data, 0, endPosition), suffix)`.\n *\n * @param data - The input string.\n * @param suffix - The string to check for at the end.\n * @signature\n * endsWith(data, suffix);\n * @example\n * endsWith(\"hello world\", \"hello\"); // false\n * endsWith(\"hello world\", \"world\"); // true\n * @dataFirst\n * @category String\n */\nexport function endsWith<T extends string, Suffix extends string>(\n data: T,\n suffix: string extends Suffix ? never : Suffix,\n): data is T & `${string}${Suffix}`;\nexport function endsWith(data: string, suffix: string): boolean;\n\n/**\n * Determines whether a string ends with the provided suffix, and refines the\n * output type if possible.\n *\n * This function is a wrapper around the built-in [`String.prototype.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\n * method, but doesn't expose the `endPosition` parameter. To check only up to a\n * specific position, use `endsWith(sliceString(data, 0, endPosition), suffix)`.\n *\n * @param suffix - The string to check for at the end.\n * @signature\n * endsWith(suffix)(data);\n * @example\n * pipe(\"hello world\", endsWith(\"hello\")); // false\n * pipe(\"hello world\", endsWith(\"world\")); // true\n * @dataLast\n * @category String\n */\nexport function endsWith<Suffix extends string>(\n suffix: string extends Suffix ? never : Suffix,\n): <T extends string>(data: T) => data is T & `${string}${Suffix}`;\nexport function endsWith(suffix: string): (data: string) => boolean;\n\nexport function endsWith(...args: ReadonlyArray<unknown>): unknown {\n return curry(endsWithImplementation, args);\n}\n\nfunction endsWithImplementation(data: string, suffix: string): boolean {\n return data.endsWith(suffix);\n}\n"],"mappings":"kGAgDA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAOA,EAAAA,MAAM,EAAwB,CAAI,CAC3C,CAEA,SAAS,EAAuB,EAAc,EAAyB,CACrE,OAAO,EAAK,SAAS,CAAM,CAC7B"}
|
package/dist/ends-with.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ends-with.js","names":[],"sources":["../src/ends-with.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Determines whether a string ends with the provided suffix, and refines the\n * output type if possible.\n *\n * This function is a wrapper around the built-in [`String.prototype.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\n * method, but doesn't expose the `endPosition` parameter. To check only up to a\n * specific position, use `endsWith(sliceString(data, 0, endPosition), suffix)`.\n *\n * @param data - The input string.\n * @param suffix - The string to check for at the end.\n * @signature\n * endsWith(data, suffix);\n * @example\n * endsWith(\"hello world\", \"hello\"); // false\n * endsWith(\"hello world\", \"world\"); // true\n * @dataFirst\n * @category String\n */\nexport function endsWith<T extends string, Suffix extends string>(\n data: T,\n suffix: string extends Suffix ? never : Suffix,\n): data is T & `${string}${Suffix}`;\nexport function endsWith(data: string, suffix: string): boolean;\n\n/**\n * Determines whether a string ends with the provided suffix, and refines the\n * output type if possible.\n *\n * This function is a wrapper around the built-in [`String.prototype.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\n * method, but doesn't expose the `endPosition` parameter. To check only up to a\n * specific position, use `endsWith(sliceString(data, 0, endPosition), suffix)`.\n *\n * @param suffix - The string to check for at the end.\n * @signature\n * endsWith(suffix)(data);\n * @example\n * pipe(\"hello world\", endsWith(\"hello\")); // false\n * pipe(\"hello world\", endsWith(\"world\")); // true\n * @dataLast\n * @category String\n */\nexport function endsWith<Suffix extends string>(\n suffix: string extends Suffix ? never : Suffix,\n): <T extends string>(data: T) => data is T & `${string}${Suffix}`;\nexport function endsWith(suffix: string): (data: string) => boolean;\n\nexport function endsWith(...args: ReadonlyArray<unknown>): unknown {\n return curry(endsWithImplementation, args);\n}\n\nfunction endsWithImplementation(data: string, suffix: string): boolean {\n return data.endsWith(suffix);\n}\n"],"mappings":"mCAgDA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAO,EAAM,EAAwB,
|
|
1
|
+
{"version":3,"file":"ends-with.js","names":[],"sources":["../src/ends-with.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Determines whether a string ends with the provided suffix, and refines the\n * output type if possible.\n *\n * This function is a wrapper around the built-in [`String.prototype.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\n * method, but doesn't expose the `endPosition` parameter. To check only up to a\n * specific position, use `endsWith(sliceString(data, 0, endPosition), suffix)`.\n *\n * @param data - The input string.\n * @param suffix - The string to check for at the end.\n * @signature\n * endsWith(data, suffix);\n * @example\n * endsWith(\"hello world\", \"hello\"); // false\n * endsWith(\"hello world\", \"world\"); // true\n * @dataFirst\n * @category String\n */\nexport function endsWith<T extends string, Suffix extends string>(\n data: T,\n suffix: string extends Suffix ? never : Suffix,\n): data is T & `${string}${Suffix}`;\nexport function endsWith(data: string, suffix: string): boolean;\n\n/**\n * Determines whether a string ends with the provided suffix, and refines the\n * output type if possible.\n *\n * This function is a wrapper around the built-in [`String.prototype.endsWith`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith)\n * method, but doesn't expose the `endPosition` parameter. To check only up to a\n * specific position, use `endsWith(sliceString(data, 0, endPosition), suffix)`.\n *\n * @param suffix - The string to check for at the end.\n * @signature\n * endsWith(suffix)(data);\n * @example\n * pipe(\"hello world\", endsWith(\"hello\")); // false\n * pipe(\"hello world\", endsWith(\"world\")); // true\n * @dataLast\n * @category String\n */\nexport function endsWith<Suffix extends string>(\n suffix: string extends Suffix ? never : Suffix,\n): <T extends string>(data: T) => data is T & `${string}${Suffix}`;\nexport function endsWith(suffix: string): (data: string) => boolean;\n\nexport function endsWith(...args: ReadonlyArray<unknown>): unknown {\n return curry(endsWithImplementation, args);\n}\n\nfunction endsWithImplementation(data: string, suffix: string): boolean {\n return data.endsWith(suffix);\n}\n"],"mappings":"mCAgDA,SAAgB,EAAS,GAAG,EAAuC,CACjE,OAAO,EAAM,EAAwB,CAAI,CAC3C,CAEA,SAAS,EAAuB,EAAc,EAAyB,CACrE,OAAO,EAAK,SAAS,CAAM,CAC7B"}
|
package/dist/entries.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(Object.entries,t)}exports.entries=t;
|
|
2
2
|
//# sourceMappingURL=entries.cjs.map
|
package/dist/entries.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entries.cjs","names":["curry"],"sources":["../src/entries.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 */\nimport type { Simplify, ValueOf } from 'type-fest';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Entry<T> = Simplify<\n ValueOf<{\n // `Object.entries` only returns enumerable keys, skipping symbols.\n [P in Exclude<keyof T, symbol>]-?: [\n // and all keys are converted to strings.\n key: ToString<P>,\n // Optionality doesn't play a factor in the result of entries because its\n // a typing thing, not a runtime thing. We need to remove any `undefined`\n // added just because the prop is optional.\n value: Required<T>[P],\n ];\n }>\n>;\n\n/**\n * Returns an array of key/values of the enumerable properties of an object.\n *\n * @param data - Object to return keys and values of.\n * @signature\n * entries(object)\n * @example\n * entries({ a: 1, b: 2, c: 3 }); // => [['a', 1], ['b', 2], ['c', 3]]\n * @dataFirst\n * @category Object\n */\nexport function entries<T extends {}>(data: T): Array<Entry<T>>;\n\n/**\n * Returns an array of key/values of the enumerable properties of an object.\n *\n * @signature\n * entries()(object)\n * @example\n * pipe({ a: 1, b: 2, c: 3 }, entries()); // => [['a', 1], ['b', 2], ['c', 3]]\n * @dataLast\n * @category Object\n */\nexport function entries(): <T extends {}>(data: T) => Array<Entry<T>>;\n\nexport function entries(...args: ReadonlyArray<unknown>): unknown {\n return curry(Object.entries, args);\n}\n"],"mappings":"kGA+CA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAOA,EAAAA,MAAM,OAAO,QAAS,
|
|
1
|
+
{"version":3,"file":"entries.cjs","names":["curry"],"sources":["../src/entries.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 */\nimport type { Simplify, ValueOf } from 'type-fest';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Entry<T> = Simplify<\n ValueOf<{\n // `Object.entries` only returns enumerable keys, skipping symbols.\n [P in Exclude<keyof T, symbol>]-?: [\n // and all keys are converted to strings.\n key: ToString<P>,\n // Optionality doesn't play a factor in the result of entries because its\n // a typing thing, not a runtime thing. We need to remove any `undefined`\n // added just because the prop is optional.\n value: Required<T>[P],\n ];\n }>\n>;\n\n/**\n * Returns an array of key/values of the enumerable properties of an object.\n *\n * @param data - Object to return keys and values of.\n * @signature\n * entries(object)\n * @example\n * entries({ a: 1, b: 2, c: 3 }); // => [['a', 1], ['b', 2], ['c', 3]]\n * @dataFirst\n * @category Object\n */\nexport function entries<T extends {}>(data: T): Array<Entry<T>>;\n\n/**\n * Returns an array of key/values of the enumerable properties of an object.\n *\n * @signature\n * entries()(object)\n * @example\n * pipe({ a: 1, b: 2, c: 3 }, entries()); // => [['a', 1], ['b', 2], ['c', 3]]\n * @dataLast\n * @category Object\n */\nexport function entries(): <T extends {}>(data: T) => Array<Entry<T>>;\n\nexport function entries(...args: ReadonlyArray<unknown>): unknown {\n return curry(Object.entries, args);\n}\n"],"mappings":"kGA+CA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAOA,EAAAA,MAAM,OAAO,QAAS,CAAI,CACnC"}
|
package/dist/entries.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entries.js","names":[],"sources":["../src/entries.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 */\nimport type { Simplify, ValueOf } from 'type-fest';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Entry<T> = Simplify<\n ValueOf<{\n // `Object.entries` only returns enumerable keys, skipping symbols.\n [P in Exclude<keyof T, symbol>]-?: [\n // and all keys are converted to strings.\n key: ToString<P>,\n // Optionality doesn't play a factor in the result of entries because its\n // a typing thing, not a runtime thing. We need to remove any `undefined`\n // added just because the prop is optional.\n value: Required<T>[P],\n ];\n }>\n>;\n\n/**\n * Returns an array of key/values of the enumerable properties of an object.\n *\n * @param data - Object to return keys and values of.\n * @signature\n * entries(object)\n * @example\n * entries({ a: 1, b: 2, c: 3 }); // => [['a', 1], ['b', 2], ['c', 3]]\n * @dataFirst\n * @category Object\n */\nexport function entries<T extends {}>(data: T): Array<Entry<T>>;\n\n/**\n * Returns an array of key/values of the enumerable properties of an object.\n *\n * @signature\n * entries()(object)\n * @example\n * pipe({ a: 1, b: 2, c: 3 }, entries()); // => [['a', 1], ['b', 2], ['c', 3]]\n * @dataLast\n * @category Object\n */\nexport function entries(): <T extends {}>(data: T) => Array<Entry<T>>;\n\nexport function entries(...args: ReadonlyArray<unknown>): unknown {\n return curry(Object.entries, args);\n}\n"],"mappings":"mCA+CA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAO,EAAM,OAAO,QAAS,
|
|
1
|
+
{"version":3,"file":"entries.js","names":[],"sources":["../src/entries.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 */\nimport type { Simplify, ValueOf } from 'type-fest';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Entry<T> = Simplify<\n ValueOf<{\n // `Object.entries` only returns enumerable keys, skipping symbols.\n [P in Exclude<keyof T, symbol>]-?: [\n // and all keys are converted to strings.\n key: ToString<P>,\n // Optionality doesn't play a factor in the result of entries because its\n // a typing thing, not a runtime thing. We need to remove any `undefined`\n // added just because the prop is optional.\n value: Required<T>[P],\n ];\n }>\n>;\n\n/**\n * Returns an array of key/values of the enumerable properties of an object.\n *\n * @param data - Object to return keys and values of.\n * @signature\n * entries(object)\n * @example\n * entries({ a: 1, b: 2, c: 3 }); // => [['a', 1], ['b', 2], ['c', 3]]\n * @dataFirst\n * @category Object\n */\nexport function entries<T extends {}>(data: T): Array<Entry<T>>;\n\n/**\n * Returns an array of key/values of the enumerable properties of an object.\n *\n * @signature\n * entries()(object)\n * @example\n * pipe({ a: 1, b: 2, c: 3 }, entries()); // => [['a', 1], ['b', 2], ['c', 3]]\n * @dataLast\n * @category Object\n */\nexport function entries(): <T extends {}>(data: T) => Array<Entry<T>>;\n\nexport function entries(...args: ReadonlyArray<unknown>): unknown {\n return curry(Object.entries, args);\n}\n"],"mappings":"mCA+CA,SAAgB,EAAQ,GAAG,EAAuC,CAChE,OAAO,EAAM,OAAO,QAAS,CAAI,CACnC"}
|
package/dist/evolve.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(typeof e!=`object`||!e)return e;let r={...e};for(let[e,i]of Object.entries(t))e in r&&(r[e]=typeof i==`function`?i(r[e]):n(r[e],i));return r}exports.evolve=t;
|
|
2
2
|
//# sourceMappingURL=evolve.cjs.map
|
package/dist/evolve.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evolve.cjs","names":["curry"],"sources":["../src/evolve.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Basic structure of `evolver` parameter of the function `evolve`.\n */\ntype GenericEvolver = {\n readonly [P in string]: GenericEvolver | ((data: unknown) => unknown);\n};\n\n/**\n * Creates an assumed `evolver` type from the type of `data` argument.\n *\n * @example\n * interface Data {\n * id: number;\n * quartile: number[];\n * time?: { elapsed: number; remaining?: number };\n * }\n * type Nested = Evolver<Data>; // => type Nested = {\n * // id?: ((data: number) => unknown) | undefined;\n * // quartile?: ((data: number[]) => unknown) | undefined;\n * // time?:\n * // | ((data: { elapsed: number; remaining?: number | undefined }) => unknown)\n * // | {\n * // elapsed?: ((data: number) => unknown) | undefined;\n * // remaining?: ((data: number) => unknown) | undefined;\n * // }\n * // | undefined;\n * // };\n */\ntype Evolver<T> = T extends object\n ? T extends IterableContainer\n ? never\n : {\n readonly [K in keyof T]?: K extends symbol\n ? never\n : Evolver<T[K]> | ((data: Required<T>[K]) => unknown);\n }\n : never;\n\n/**\n * Creates return type from the type of arguments of `evolve`.\n */\ntype Evolved<T, E> = T extends object\n ? {\n -readonly [K in keyof T]: K extends keyof E\n ? E[K] extends (\n // eslint-disable-next-line ts/no-explicit-any -- Functions aren't inferred correctly when using `unknown` for the params.\n ...arg: any\n ) => infer R\n ? R\n : Evolved<T[K], E[K]>\n : Required<T>[K];\n }\n : T;\n\n/**\n * Creates a new object by applying functions that is included in `evolver` object parameter\n * to the `data` object parameter according to their corresponding path.\n *\n * Functions included in `evolver` object will not be invoked\n * if its corresponding key does not exist in the `data` object.\n * Also, values included in `data` object will be kept as is\n * if its corresponding key does not exist in the `evolver` object.\n *\n * @param object - Object whose value is applied to the corresponding function\n * that is defined in `evolver` at the same path.\n * @param evolver - Object that include functions that is applied to\n * the corresponding value of `data` object at the same path.\n * @signature\n * evolve(data, evolver)\n * @example\n * const evolver = {\n * count: add(1),\n * time: { elapsed: add(1), remaining: add(-1) },\n * };\n * const data = {\n * id: 10,\n * count: 10,\n * time: { elapsed: 100, remaining: 1400 },\n * };\n * evolve(data, evolver)\n * // => {\n * // id: 10,\n * // count: 11,\n * // time: { elapsed: 101, remaining: 1399 },\n * // }\n * @dataFirst\n * @category Object\n */\nexport function evolve<T extends object, E extends Evolver<T>>(\n object: T,\n evolver: E,\n): Evolved<T, E>;\n\n/**\n * Creates a new object by applying functions that is included in `evolver` object parameter\n * to the `data` object parameter according to their corresponding path.\n *\n * Functions included in `evolver` object will not be invoked\n * if its corresponding key does not exist in the `data` object.\n * Also, values included in `data` object will not be used\n * if its corresponding key does not exist in the `evolver` object.\n *\n * @param evolver - Object that include functions that is applied to\n * the corresponding value of `data` object at the same path.\n * @signature\n * evolve(evolver)(data)\n * @example\n * const evolver = {\n * count: add(1),\n * time: { elapsed: add(1), remaining: add(-1) },\n * };\n * const data = {\n * id: 10,\n * count: 10,\n * time: { elapsed: 100, remaining: 1400 },\n * };\n * pipe(data, evolve(evolver))\n * // => {\n * // id: 10,\n * // count: 11,\n * // time: { elapsed: 101, remaining: 1399 },\n * // }\n * @dataLast\n * @category Object\n */\nexport function evolve<T extends object, E extends Evolver<T>>(\n evolver: E,\n): (object: T) => Evolved<T, E>;\n\nexport function evolve(...args: ReadonlyArray<unknown>): unknown {\n return curry(evolveImplementation, args);\n}\n\nfunction evolveImplementation(data: unknown, evolver: GenericEvolver): unknown {\n if (typeof data !== 'object' || data === null) {\n return data;\n }\n\n const out: Record<string, unknown> = { ...data };\n\n for (const [key, value] of Object.entries(evolver)) {\n if (key in out) {\n out[key]\n = typeof value === 'function'\n ? value(out[key])\n : evolveImplementation(out[key], value);\n }\n }\n\n return out;\n}\n"],"mappings":"kGAoIA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"evolve.cjs","names":["curry"],"sources":["../src/evolve.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Basic structure of `evolver` parameter of the function `evolve`.\n */\ntype GenericEvolver = {\n readonly [P in string]: GenericEvolver | ((data: unknown) => unknown);\n};\n\n/**\n * Creates an assumed `evolver` type from the type of `data` argument.\n *\n * @example\n * interface Data {\n * id: number;\n * quartile: number[];\n * time?: { elapsed: number; remaining?: number };\n * }\n * type Nested = Evolver<Data>; // => type Nested = {\n * // id?: ((data: number) => unknown) | undefined;\n * // quartile?: ((data: number[]) => unknown) | undefined;\n * // time?:\n * // | ((data: { elapsed: number; remaining?: number | undefined }) => unknown)\n * // | {\n * // elapsed?: ((data: number) => unknown) | undefined;\n * // remaining?: ((data: number) => unknown) | undefined;\n * // }\n * // | undefined;\n * // };\n */\ntype Evolver<T> = T extends object\n ? T extends IterableContainer\n ? never\n : {\n readonly [K in keyof T]?: K extends symbol\n ? never\n : Evolver<T[K]> | ((data: Required<T>[K]) => unknown);\n }\n : never;\n\n/**\n * Creates return type from the type of arguments of `evolve`.\n */\ntype Evolved<T, E> = T extends object\n ? {\n -readonly [K in keyof T]: K extends keyof E\n ? E[K] extends (\n // eslint-disable-next-line ts/no-explicit-any -- Functions aren't inferred correctly when using `unknown` for the params.\n ...arg: any\n ) => infer R\n ? R\n : Evolved<T[K], E[K]>\n : Required<T>[K];\n }\n : T;\n\n/**\n * Creates a new object by applying functions that is included in `evolver` object parameter\n * to the `data` object parameter according to their corresponding path.\n *\n * Functions included in `evolver` object will not be invoked\n * if its corresponding key does not exist in the `data` object.\n * Also, values included in `data` object will be kept as is\n * if its corresponding key does not exist in the `evolver` object.\n *\n * @param object - Object whose value is applied to the corresponding function\n * that is defined in `evolver` at the same path.\n * @param evolver - Object that include functions that is applied to\n * the corresponding value of `data` object at the same path.\n * @signature\n * evolve(data, evolver)\n * @example\n * const evolver = {\n * count: add(1),\n * time: { elapsed: add(1), remaining: add(-1) },\n * };\n * const data = {\n * id: 10,\n * count: 10,\n * time: { elapsed: 100, remaining: 1400 },\n * };\n * evolve(data, evolver)\n * // => {\n * // id: 10,\n * // count: 11,\n * // time: { elapsed: 101, remaining: 1399 },\n * // }\n * @dataFirst\n * @category Object\n */\nexport function evolve<T extends object, E extends Evolver<T>>(\n object: T,\n evolver: E,\n): Evolved<T, E>;\n\n/**\n * Creates a new object by applying functions that is included in `evolver` object parameter\n * to the `data` object parameter according to their corresponding path.\n *\n * Functions included in `evolver` object will not be invoked\n * if its corresponding key does not exist in the `data` object.\n * Also, values included in `data` object will not be used\n * if its corresponding key does not exist in the `evolver` object.\n *\n * @param evolver - Object that include functions that is applied to\n * the corresponding value of `data` object at the same path.\n * @signature\n * evolve(evolver)(data)\n * @example\n * const evolver = {\n * count: add(1),\n * time: { elapsed: add(1), remaining: add(-1) },\n * };\n * const data = {\n * id: 10,\n * count: 10,\n * time: { elapsed: 100, remaining: 1400 },\n * };\n * pipe(data, evolve(evolver))\n * // => {\n * // id: 10,\n * // count: 11,\n * // time: { elapsed: 101, remaining: 1399 },\n * // }\n * @dataLast\n * @category Object\n */\nexport function evolve<T extends object, E extends Evolver<T>>(\n evolver: E,\n): (object: T) => Evolved<T, E>;\n\nexport function evolve(...args: ReadonlyArray<unknown>): unknown {\n return curry(evolveImplementation, args);\n}\n\nfunction evolveImplementation(data: unknown, evolver: GenericEvolver): unknown {\n if (typeof data !== 'object' || data === null) {\n return data;\n }\n\n const out: Record<string, unknown> = { ...data };\n\n for (const [key, value] of Object.entries(evolver)) {\n if (key in out) {\n out[key]\n = typeof value === 'function'\n ? value(out[key])\n : evolveImplementation(out[key], value);\n }\n }\n\n return out;\n}\n"],"mappings":"kGAoIA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,CAAI,CACzC,CAEA,SAAS,EAAqB,EAAe,EAAkC,CAC7E,GAAI,OAAO,GAAS,WAAY,EAC9B,OAAO,EAGT,IAAM,EAA+B,CAAE,GAAG,CAAK,EAE/C,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAO,EAC3C,KAAO,IACT,EAAI,GACA,OAAO,GAAU,WACf,EAAM,EAAI,EAAI,EACd,EAAqB,EAAI,GAAM,CAAK,GAI9C,OAAO,CACT"}
|
package/dist/evolve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evolve.js","names":[],"sources":["../src/evolve.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Basic structure of `evolver` parameter of the function `evolve`.\n */\ntype GenericEvolver = {\n readonly [P in string]: GenericEvolver | ((data: unknown) => unknown);\n};\n\n/**\n * Creates an assumed `evolver` type from the type of `data` argument.\n *\n * @example\n * interface Data {\n * id: number;\n * quartile: number[];\n * time?: { elapsed: number; remaining?: number };\n * }\n * type Nested = Evolver<Data>; // => type Nested = {\n * // id?: ((data: number) => unknown) | undefined;\n * // quartile?: ((data: number[]) => unknown) | undefined;\n * // time?:\n * // | ((data: { elapsed: number; remaining?: number | undefined }) => unknown)\n * // | {\n * // elapsed?: ((data: number) => unknown) | undefined;\n * // remaining?: ((data: number) => unknown) | undefined;\n * // }\n * // | undefined;\n * // };\n */\ntype Evolver<T> = T extends object\n ? T extends IterableContainer\n ? never\n : {\n readonly [K in keyof T]?: K extends symbol\n ? never\n : Evolver<T[K]> | ((data: Required<T>[K]) => unknown);\n }\n : never;\n\n/**\n * Creates return type from the type of arguments of `evolve`.\n */\ntype Evolved<T, E> = T extends object\n ? {\n -readonly [K in keyof T]: K extends keyof E\n ? E[K] extends (\n // eslint-disable-next-line ts/no-explicit-any -- Functions aren't inferred correctly when using `unknown` for the params.\n ...arg: any\n ) => infer R\n ? R\n : Evolved<T[K], E[K]>\n : Required<T>[K];\n }\n : T;\n\n/**\n * Creates a new object by applying functions that is included in `evolver` object parameter\n * to the `data` object parameter according to their corresponding path.\n *\n * Functions included in `evolver` object will not be invoked\n * if its corresponding key does not exist in the `data` object.\n * Also, values included in `data` object will be kept as is\n * if its corresponding key does not exist in the `evolver` object.\n *\n * @param object - Object whose value is applied to the corresponding function\n * that is defined in `evolver` at the same path.\n * @param evolver - Object that include functions that is applied to\n * the corresponding value of `data` object at the same path.\n * @signature\n * evolve(data, evolver)\n * @example\n * const evolver = {\n * count: add(1),\n * time: { elapsed: add(1), remaining: add(-1) },\n * };\n * const data = {\n * id: 10,\n * count: 10,\n * time: { elapsed: 100, remaining: 1400 },\n * };\n * evolve(data, evolver)\n * // => {\n * // id: 10,\n * // count: 11,\n * // time: { elapsed: 101, remaining: 1399 },\n * // }\n * @dataFirst\n * @category Object\n */\nexport function evolve<T extends object, E extends Evolver<T>>(\n object: T,\n evolver: E,\n): Evolved<T, E>;\n\n/**\n * Creates a new object by applying functions that is included in `evolver` object parameter\n * to the `data` object parameter according to their corresponding path.\n *\n * Functions included in `evolver` object will not be invoked\n * if its corresponding key does not exist in the `data` object.\n * Also, values included in `data` object will not be used\n * if its corresponding key does not exist in the `evolver` object.\n *\n * @param evolver - Object that include functions that is applied to\n * the corresponding value of `data` object at the same path.\n * @signature\n * evolve(evolver)(data)\n * @example\n * const evolver = {\n * count: add(1),\n * time: { elapsed: add(1), remaining: add(-1) },\n * };\n * const data = {\n * id: 10,\n * count: 10,\n * time: { elapsed: 100, remaining: 1400 },\n * };\n * pipe(data, evolve(evolver))\n * // => {\n * // id: 10,\n * // count: 11,\n * // time: { elapsed: 101, remaining: 1399 },\n * // }\n * @dataLast\n * @category Object\n */\nexport function evolve<T extends object, E extends Evolver<T>>(\n evolver: E,\n): (object: T) => Evolved<T, E>;\n\nexport function evolve(...args: ReadonlyArray<unknown>): unknown {\n return curry(evolveImplementation, args);\n}\n\nfunction evolveImplementation(data: unknown, evolver: GenericEvolver): unknown {\n if (typeof data !== 'object' || data === null) {\n return data;\n }\n\n const out: Record<string, unknown> = { ...data };\n\n for (const [key, value] of Object.entries(evolver)) {\n if (key in out) {\n out[key]\n = typeof value === 'function'\n ? value(out[key])\n : evolveImplementation(out[key], value);\n }\n }\n\n return out;\n}\n"],"mappings":"mCAoIA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"evolve.js","names":[],"sources":["../src/evolve.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\nimport { curry } from './curry';\n\n/**\n * Basic structure of `evolver` parameter of the function `evolve`.\n */\ntype GenericEvolver = {\n readonly [P in string]: GenericEvolver | ((data: unknown) => unknown);\n};\n\n/**\n * Creates an assumed `evolver` type from the type of `data` argument.\n *\n * @example\n * interface Data {\n * id: number;\n * quartile: number[];\n * time?: { elapsed: number; remaining?: number };\n * }\n * type Nested = Evolver<Data>; // => type Nested = {\n * // id?: ((data: number) => unknown) | undefined;\n * // quartile?: ((data: number[]) => unknown) | undefined;\n * // time?:\n * // | ((data: { elapsed: number; remaining?: number | undefined }) => unknown)\n * // | {\n * // elapsed?: ((data: number) => unknown) | undefined;\n * // remaining?: ((data: number) => unknown) | undefined;\n * // }\n * // | undefined;\n * // };\n */\ntype Evolver<T> = T extends object\n ? T extends IterableContainer\n ? never\n : {\n readonly [K in keyof T]?: K extends symbol\n ? never\n : Evolver<T[K]> | ((data: Required<T>[K]) => unknown);\n }\n : never;\n\n/**\n * Creates return type from the type of arguments of `evolve`.\n */\ntype Evolved<T, E> = T extends object\n ? {\n -readonly [K in keyof T]: K extends keyof E\n ? E[K] extends (\n // eslint-disable-next-line ts/no-explicit-any -- Functions aren't inferred correctly when using `unknown` for the params.\n ...arg: any\n ) => infer R\n ? R\n : Evolved<T[K], E[K]>\n : Required<T>[K];\n }\n : T;\n\n/**\n * Creates a new object by applying functions that is included in `evolver` object parameter\n * to the `data` object parameter according to their corresponding path.\n *\n * Functions included in `evolver` object will not be invoked\n * if its corresponding key does not exist in the `data` object.\n * Also, values included in `data` object will be kept as is\n * if its corresponding key does not exist in the `evolver` object.\n *\n * @param object - Object whose value is applied to the corresponding function\n * that is defined in `evolver` at the same path.\n * @param evolver - Object that include functions that is applied to\n * the corresponding value of `data` object at the same path.\n * @signature\n * evolve(data, evolver)\n * @example\n * const evolver = {\n * count: add(1),\n * time: { elapsed: add(1), remaining: add(-1) },\n * };\n * const data = {\n * id: 10,\n * count: 10,\n * time: { elapsed: 100, remaining: 1400 },\n * };\n * evolve(data, evolver)\n * // => {\n * // id: 10,\n * // count: 11,\n * // time: { elapsed: 101, remaining: 1399 },\n * // }\n * @dataFirst\n * @category Object\n */\nexport function evolve<T extends object, E extends Evolver<T>>(\n object: T,\n evolver: E,\n): Evolved<T, E>;\n\n/**\n * Creates a new object by applying functions that is included in `evolver` object parameter\n * to the `data` object parameter according to their corresponding path.\n *\n * Functions included in `evolver` object will not be invoked\n * if its corresponding key does not exist in the `data` object.\n * Also, values included in `data` object will not be used\n * if its corresponding key does not exist in the `evolver` object.\n *\n * @param evolver - Object that include functions that is applied to\n * the corresponding value of `data` object at the same path.\n * @signature\n * evolve(evolver)(data)\n * @example\n * const evolver = {\n * count: add(1),\n * time: { elapsed: add(1), remaining: add(-1) },\n * };\n * const data = {\n * id: 10,\n * count: 10,\n * time: { elapsed: 100, remaining: 1400 },\n * };\n * pipe(data, evolve(evolver))\n * // => {\n * // id: 10,\n * // count: 11,\n * // time: { elapsed: 101, remaining: 1399 },\n * // }\n * @dataLast\n * @category Object\n */\nexport function evolve<T extends object, E extends Evolver<T>>(\n evolver: E,\n): (object: T) => Evolved<T, E>;\n\nexport function evolve(...args: ReadonlyArray<unknown>): unknown {\n return curry(evolveImplementation, args);\n}\n\nfunction evolveImplementation(data: unknown, evolver: GenericEvolver): unknown {\n if (typeof data !== 'object' || data === null) {\n return data;\n }\n\n const out: Record<string, unknown> = { ...data };\n\n for (const [key, value] of Object.entries(evolver)) {\n if (key in out) {\n out[key]\n = typeof value === 'function'\n ? value(out[key])\n : evolveImplementation(out[key], value);\n }\n }\n\n return out;\n}\n"],"mappings":"mCAoIA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,CAAI,CACzC,CAEA,SAAS,EAAqB,EAAe,EAAkC,CAC7E,GAAI,OAAO,GAAS,WAAY,EAC9B,OAAO,EAGT,IAAM,EAA+B,CAAE,GAAG,CAAK,EAE/C,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAO,EAC3C,KAAO,IACT,EAAI,GACA,OAAO,GAAU,WACf,EAAM,EAAI,EAAI,EACd,EAAqB,EAAI,GAAM,CAAK,GAI9C,OAAO,CACT"}
|
package/dist/filter.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("./utility-evaluators-BGM19SpK.cjs");function n(...t){return e.curry(r,t,i)}function r(e,t){return e.filter(t)}function i(e){return(n,r,i)=>e(n,r,i)?{done:!1,hasNext:!0,next:n}:t.t}exports.filter=n;
|
|
2
2
|
//# sourceMappingURL=filter.cjs.map
|
package/dist/filter.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.cjs","names":["curry","SKIP_ITEM"],"sources":["../src/filter.ts"],"sourcesContent":["import type { Writable } from 'type-fest';\nimport type { FilteredArray } from './internal/types/filtered-array';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curry } from './curry';\nimport { SKIP_ITEM } from './internal/utility-evaluators';\n\n// When the predicate used for filter isn't refining (like a type-predicate) we\n// can narrow the result slightly if it's also trivial (it returns the same\n// result for all items). This is uncommon, but can be useful to \"short-circuit\"\n// the filter.\ntype NonRefinedFilteredArray<\n T extends IterableContainer,\n IsItemIncluded extends boolean,\n> = boolean extends IsItemIncluded\n ? // We don't know which items of the array the predicate would allow in the\n// output so we can only safely say that the result is an array with items\n// from the input array.\n// TODO: Theoretically we could build an output shape that would take into account the **order** of elements in the input array by reconstructing it with every single element in it either included or not, but this type can grow to a union of as much as 2^n options which might not be usable in practice.\n Array<T[number]>\n : IsItemIncluded extends true\n ? // If the predicate is always true we return a shallow copy of the array.\n // If it was originally readonly we need to strip that away.\n Writable<T>\n : // If the predicate is always false we will always return an empty\n // array.\n [];\n\n/**\n * Creates a shallow copy of a portion of a given array, filtered down to just\n * the elements from the given array that pass the test implemented by the\n * provided function. Equivalent to `Array.prototype.filter`.\n *\n * @param data - The array to filter.\n * @param predicate - A function to execute for each element in the array. It\n * should return `true` to keep the element in the resulting array, and `false`\n * otherwise. A type-predicate can also be used to narrow the result.\n * @returns A shallow copy of the given array containing just the elements that\n * pass the test. If no elements pass the test, an empty array is returned.\n * @signature\n * filter(data, predicate)\n * @example\n * filter([1, 2, 3], x => x % 2 === 1) // => [1, 3]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function filter<\n T extends IterableContainer,\n Condition extends T[number],\n>(\n data: T,\n predicate: (value: T[number], index: number, data: T) => value is Condition,\n): FilteredArray<T, Condition>;\nexport function filter<\n T extends IterableContainer,\n IsItemIncluded extends boolean,\n>(\n data: T,\n predicate: (value: T[number], index: number, data: T) => IsItemIncluded,\n): NonRefinedFilteredArray<T, IsItemIncluded>;\n\n/**\n * Creates a shallow copy of a portion of a given array, filtered down to just\n * the elements from the given array that pass the test implemented by the\n * provided function. Equivalent to `Array.prototype.filter`.\n *\n * @param predicate - A function to execute for each element in the array. It\n * should return `true` to keep the element in the resulting array, and `false`\n * otherwise.\n * @returns A shallow copy of the given array containing just the elements that\n * pass the test. If no elements pass the test, an empty array is returned.\n * @signature\n * filter(predicate)(data)\n * @example\n * pipe([1, 2, 3], filter(x => x % 2 === 1)) // => [1, 3]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function filter<\n T extends IterableContainer,\n Condition extends T[number],\n>(\n predicate: (value: T[number], index: number, data: T) => value is Condition,\n): (data: T) => FilteredArray<T, Condition>;\nexport function filter<\n T extends IterableContainer,\n IsItemIncluded extends boolean,\n>(\n predicate: (value: T[number], index: number, data: T) => IsItemIncluded,\n): (data: T) => NonRefinedFilteredArray<T, IsItemIncluded>;\n\nexport function filter(...args: ReadonlyArray<unknown>): unknown {\n return curry(filterImplementation, args, lazyImplementation);\n}\n\nfunction filterImplementation<T>(data: ReadonlyArray<T>, predicate: (value: T, index: number, array: ReadonlyArray<T>) => boolean): Array<T> {\n return data.filter(predicate);\n}\n\nfunction lazyImplementation<T>(predicate: (value: T, index: number, data: ReadonlyArray<T>) => boolean): LazyEvaluator<T> {\n return (value, index, data) =>\n predicate(value, index, data)\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter.cjs","names":["curry","SKIP_ITEM"],"sources":["../src/filter.ts"],"sourcesContent":["import type { Writable } from 'type-fest';\nimport type { FilteredArray } from './internal/types/filtered-array';\nimport type { IterableContainer } from './internal/types/iterable-container';\nimport type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curry } from './curry';\nimport { SKIP_ITEM } from './internal/utility-evaluators';\n\n// When the predicate used for filter isn't refining (like a type-predicate) we\n// can narrow the result slightly if it's also trivial (it returns the same\n// result for all items). This is uncommon, but can be useful to \"short-circuit\"\n// the filter.\ntype NonRefinedFilteredArray<\n T extends IterableContainer,\n IsItemIncluded extends boolean,\n> = boolean extends IsItemIncluded\n ? // We don't know which items of the array the predicate would allow in the\n// output so we can only safely say that the result is an array with items\n// from the input array.\n// TODO: Theoretically we could build an output shape that would take into account the **order** of elements in the input array by reconstructing it with every single element in it either included or not, but this type can grow to a union of as much as 2^n options which might not be usable in practice.\n Array<T[number]>\n : IsItemIncluded extends true\n ? // If the predicate is always true we return a shallow copy of the array.\n // If it was originally readonly we need to strip that away.\n Writable<T>\n : // If the predicate is always false we will always return an empty\n // array.\n [];\n\n/**\n * Creates a shallow copy of a portion of a given array, filtered down to just\n * the elements from the given array that pass the test implemented by the\n * provided function. Equivalent to `Array.prototype.filter`.\n *\n * Related operations:\n * - `splice` - to shape the array by *position* rather than by *value*.\n *\n * @param data - The array to filter.\n * @param predicate - A function to execute for each element in the array. It\n * should return `true` to keep the element in the resulting array, and `false`\n * otherwise. A type-predicate can also be used to narrow the result.\n * @returns A shallow copy of the given array containing just the elements that\n * pass the test. If no elements pass the test, an empty array is returned.\n * @signature\n * filter(data, predicate)\n * @example\n * filter([1, 2, 3], x => x % 2 === 1) // => [1, 3]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function filter<\n T extends IterableContainer,\n Condition extends T[number],\n>(\n data: T,\n predicate: (value: T[number], index: number, data: T) => value is Condition,\n): FilteredArray<T, Condition>;\nexport function filter<\n T extends IterableContainer,\n IsItemIncluded extends boolean,\n>(\n data: T,\n predicate: (value: T[number], index: number, data: T) => IsItemIncluded,\n): NonRefinedFilteredArray<T, IsItemIncluded>;\n\n/**\n * Creates a shallow copy of a portion of a given array, filtered down to just\n * the elements from the given array that pass the test implemented by the\n * provided function. Equivalent to `Array.prototype.filter`.\n *\n * Related operations:\n * - `splice` - to shape the array by *position* rather than by *value*.\n *\n * @param predicate - A function to execute for each element in the array. It\n * should return `true` to keep the element in the resulting array, and `false`\n * otherwise.\n * @returns A shallow copy of the given array containing just the elements that\n * pass the test. If no elements pass the test, an empty array is returned.\n * @signature\n * filter(predicate)(data)\n * @example\n * pipe([1, 2, 3], filter(x => x % 2 === 1)) // => [1, 3]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function filter<\n T extends IterableContainer,\n Condition extends T[number],\n>(\n predicate: (value: T[number], index: number, data: T) => value is Condition,\n): (data: T) => FilteredArray<T, Condition>;\nexport function filter<\n T extends IterableContainer,\n IsItemIncluded extends boolean,\n>(\n predicate: (value: T[number], index: number, data: T) => IsItemIncluded,\n): (data: T) => NonRefinedFilteredArray<T, IsItemIncluded>;\n\nexport function filter(...args: ReadonlyArray<unknown>): unknown {\n return curry(filterImplementation, args, lazyImplementation);\n}\n\nfunction filterImplementation<T>(data: ReadonlyArray<T>, predicate: (value: T, index: number, array: ReadonlyArray<T>) => boolean): Array<T> {\n return data.filter(predicate);\n}\n\nfunction lazyImplementation<T>(predicate: (value: T, index: number, data: ReadonlyArray<T>) => boolean): LazyEvaluator<T> {\n return (value, index, data) =>\n predicate(value, index, data)\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"iJAmGA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,EAAM,CAAkB,CAC7D,CAEA,SAAS,EAAwB,EAAwB,EAAoF,CAC3I,OAAO,EAAK,OAAO,CAAS,CAC9B,CAEA,SAAS,EAAsB,EAA2F,CACxH,OAAQ,EAAO,EAAO,IACpB,EAAU,EAAO,EAAO,CAAI,EACxB,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,CAAM,EAC1CC,EAAAA,CACR"}
|
package/dist/filter.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{curry as e}from"./curry.js";import{t}from"./utility-evaluators-
|
|
1
|
+
import{curry as e}from"./curry.js";import{t}from"./utility-evaluators-DDW55xeL.js";function n(...t){return e(r,t,i)}function r(e,t){return e.filter(t)}function i(e){return(n,r,i)=>e(n,r,i)?{done:!1,hasNext:!0,next:n}:t}export{n as filter};
|
|
2
2
|
//# sourceMappingURL=filter.js.map
|