@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
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{curry as e}from"./curry.js";import{addProp as t}from"./add-prop.js";import{add as n}from"./add.js";import{allPass as r}from"./all-pass.js";import{anyPass as i}from"./any-pass.js";import{capitalize as a}from"./capitalize.js";import{ceil as o}from"./ceil.js";import{chunk as s}from"./chunk.js";import{clamp as c}from"./clamp.js";import{clone as l}from"./clone.js";import{concat as u}from"./concat.js";import{
|
|
1
|
+
import{curry as e}from"./curry.js";import{addProp as t}from"./add-prop.js";import{add as n}from"./add.js";import{allPass as r}from"./all-pass.js";import{anyPass as i}from"./any-pass.js";import{capitalize as a}from"./capitalize.js";import{ceil as o}from"./ceil.js";import{chunk as s}from"./chunk.js";import{clamp as c}from"./clamp.js";import{clone as l}from"./clone.js";import{concat as u}from"./concat.js";import{conditional as d}from"./conditional.js";import{constant as f}from"./constant.js";import{countBy as p}from"./count-by.js";import{debounce as m}from"./debounce.js";import{defaultTo as h}from"./default-to.js";import{pipe as g}from"./pipe.js";import{differenceWith as _}from"./difference-with.js";import{difference as v}from"./difference.js";import{divide as y}from"./divide.js";import{doNothing as b}from"./do-nothing.js";import{hasAtLeast as x}from"./has-at-least.js";import{dropFirstBy as S}from"./drop-first-by.js";import{dropLastWhile as C}from"./drop-last-while.js";import{dropLast as w}from"./drop-last.js";import{dropWhile as T}from"./drop-while.js";import{drop as E}from"./drop.js";import{endsWith as D}from"./ends-with.js";import{entries as O}from"./entries.js";import{evolve as k}from"./evolve.js";import{filter as A}from"./filter.js";import{findIndex as j}from"./find-index.js";import{findLastIndex as M}from"./find-last-index.js";import{findLast as N}from"./find-last.js";import{find as P}from"./find.js";import{firstBy as F}from"./first-by.js";import{first as I}from"./first.js";import{flatMap as L}from"./flat-map.js";import{flat as R}from"./flat.js";import{floor as z}from"./floor.js";import{forEachObj as B}from"./for-each-obj.js";import{forEach as V}from"./for-each.js";import{fromEntries as H}from"./from-entries.js";import{fromKeys as U}from"./from-keys.js";import{funnel as W}from"./funnel.js";import{groupByProp as G}from"./group-by-prop.js";import{groupBy as K}from"./group-by.js";import{hasProp as q}from"./has-prop.js";import{isDeepEqual as J}from"./is-deep-equal.js";import{hasSubObject as Y}from"./has-sub-object.js";import{humanReadableFileSize as X}from"./human-readable-file-size.js";import{identity as Z}from"./identity.js";import{indexBy as Q}from"./index-by.js";import{intersection as $}from"./intersection.js";import{intersectionWith as ee}from"./intersection-with.js";import{invert as te}from"./invert.js";import{isArray as ne}from"./is-array.js";import{isBigInt as re}from"./is-big-int.js";import{isBoolean as ie}from"./is-boolean.js";import{isDate as ae}from"./is-date.js";import{isDefined as oe}from"./is-defined.js";import{isEmpty as se}from"./is-empty.js";import{isEmptyish as ce}from"./is-emptyish.js";import{isError as le}from"./is-error.js";import{isFunction as ue}from"./is-function.js";import{isIncludedIn as de}from"./is-included-in.js";import{isNonNull as fe}from"./is-non-null.js";import{isNonNullish as pe}from"./is-non-nullish.js";import{isNot as me}from"./is-not.js";import{isNullish as he}from"./is-nullish.js";import{isNumber as ge}from"./is-number.js";import{isObjectType as _e}from"./is-object-type.js";import{isPlainObject as ve}from"./is-plain-object.js";import{isPromise as ye}from"./is-promise.js";import{isShallowEqual as be}from"./is-shallow-equal.js";import{isStrictEqual as xe}from"./is-strict-equal.js";import{isString as Se}from"./is-string.js";import{isSymbol as Ce}from"./is-symbol.js";import{isTruthy as we}from"./is-truthy.js";import{join as Te}from"./join.js";import{KEY_CODES as Ee}from"./key-codes.js";import{keys as De}from"./keys.js";import{last as Oe}from"./last.js";import{length as ke}from"./length.js";import{map as Ae}from"./map.js";import{mapKeys as je}from"./map-keys.js";import{mapToObj as Me}from"./map-to-obj.js";import{mapValues as Ne}from"./map-values.js";import{mapWithFeedback as Pe}from"./map-with-feedback.js";import{sum as Fe}from"./sum.js";import{mean as Ie}from"./mean.js";import{meanBy as Le}from"./mean-by.js";import{median as Re}from"./median.js";import{merge as ze}from"./merge.js";import{mergeAll as Be}from"./merge-all.js";import{mergeDeep as Ve}from"./merge-deep.js";import{multiply as He}from"./multiply.js";import{t as Ue}from"./nth-by-DGcGGvJX.js";import{objOf as We}from"./obj-of.js";import{omit as Ge}from"./omit.js";import{omitBy as Ke}from"./omit-by.js";import{once as qe}from"./once.js";import{only as Je}from"./only.js";import{partialBind as Ye}from"./partial-bind.js";import{partialLastBind as Xe}from"./partial-last-bind.js";import{partition as Ze}from"./partition.js";import{pathOr as Qe}from"./path-or.js";import{pick as $e}from"./pick.js";import{pickBy as et}from"./pick-by.js";import{piped as tt}from"./piped.js";import{product as nt}from"./product.js";import{prop as rt}from"./prop.js";import{pullObject as it}from"./pull-object.js";import{randomBigInt as at}from"./random-big-int.js";import{randomInteger as ot}from"./random-integer.js";import{randomString as st}from"./random-string.js";import{range as ct}from"./range.js";import{rankBy as lt}from"./rank-by.js";import{reduce as ut}from"./reduce.js";import{reverse as dt}from"./reverse.js";import{round as ft}from"./round.js";import{sample as pt}from"./sample.js";import{set as mt}from"./set.js";import{setPath as ht}from"./set-path.js";import{shuffle as gt}from"./shuffle.js";import{sleep as _t}from"./sleep.js";import{sliceString as vt}from"./slice-string.js";import{slugify as yt}from"./slugify.js";import{sort as bt}from"./sort.js";import{sortBy as xt}from"./sort-by.js";import{sortedIndex as St}from"./sorted-index.js";import{sortedIndexBy as Ct}from"./sorted-index-by.js";import{sortedIndexWith as wt}from"./sorted-index-with.js";import{sortedLastIndex as Tt}from"./sorted-last-index.js";import{sortedLastIndexBy as Et}from"./sorted-last-index-by.js";import{splice as Dt}from"./splice.js";import{split as Ot}from"./split.js";import{splitAt as kt}from"./split-at.js";import{splitWhen as At}from"./split-when.js";import{startsWith as jt}from"./starts-with.js";import{stringToPath as Mt}from"./string-to-path.js";import{subtract as Nt}from"./subtract.js";import{sumBy as Pt}from"./sum-by.js";import{swapIndices as Ft}from"./swap-indices.js";import{swapProps as It}from"./swap-props.js";import{take as Lt}from"./take.js";import{takeFirstBy as Rt}from"./take-first-by.js";import{takeLast as zt}from"./take-last.js";import{takeLastWhile as Bt}from"./take-last-while.js";import{takeWhile as Vt}from"./take-while.js";import{tap as Ht}from"./tap.js";import{times as Ut}from"./times.js";import{toCamelCase as Wt}from"./to-camel-case.js";import{toKebabCase as Gt}from"./to-kebab-case.js";import{toLowerCase as Kt}from"./to-lower-case.js";import{toSnakeCase as qt}from"./to-snake-case.js";import{toTitleCase as Jt}from"./to-title-case.js";import{toUpperCase as Yt}from"./to-upper-case.js";import{truncate as Xt}from"./truncate.js";import"./type.helpers.js";import{uncapitalize as Zt}from"./uncapitalize.js";import{unique as Qt}from"./unique.js";import{uniqueBy as $t}from"./unique-by.js";import{uniqueWith as en}from"./unique-with.js";import{values as tn}from"./values.js";import{when as nn}from"./when.js";import{zip as rn}from"./zip.js";import{zipWith as an}from"./zip-with.js";const on=typeof window<`u`;export{Ee as KEY_CODES,n as add,t as addProp,r as allPass,i as anyPass,a as capitalize,o as ceil,s as chunk,c as clamp,l as clone,u as concat,d as conditional,f as constant,p as countBy,e as curry,m as debounce,h as defaultTo,v as difference,_ as differenceWith,y as divide,b as doNothing,E as drop,S as dropFirstBy,w as dropLast,C as dropLastWhile,T as dropWhile,D as endsWith,O as entries,k as evolve,A as filter,P as find,j as findIndex,N as findLast,M as findLastIndex,I as first,F as firstBy,R as flat,L as flatMap,z as floor,V as forEach,B as forEachObj,H as fromEntries,U as fromKeys,W as funnel,K as groupBy,G as groupByProp,x as hasAtLeast,q as hasProp,Y as hasSubObject,X as humanReadableFileSize,Z as identity,Q as indexBy,$ as intersection,ee as intersectionWith,te as invert,ne as isArray,re as isBigInt,ie as isBoolean,on as isBrowser,ae as isDate,J as isDeepEqual,oe as isDefined,se as isEmpty,ce as isEmptyish,le as isError,ue as isFunction,de as isIncludedIn,fe as isNonNull,pe as isNonNullish,me as isNot,he as isNullish,ge as isNumber,_e as isObjectType,ve as isPlainObject,ye as isPromise,be as isShallowEqual,xe as isStrictEqual,Se as isString,Ce as isSymbol,we as isTruthy,Te as join,De as keys,Oe as last,ke as length,Ae as map,je as mapKeys,Me as mapToObj,Ne as mapValues,Pe as mapWithFeedback,Ie as mean,Le as meanBy,Re as median,ze as merge,Be as mergeAll,Ve as mergeDeep,He as multiply,Ue as nthBy,We as objOf,Ge as omit,Ke as omitBy,qe as once,Je as only,Ye as partialBind,Xe as partialLastBind,Ze as partition,Qe as pathOr,$e as pick,et as pickBy,g as pipe,tt as piped,nt as product,rt as prop,it as pullObject,at as randomBigInt,ot as randomInteger,st as randomString,ct as range,lt as rankBy,ut as reduce,dt as reverse,ft as round,pt as sample,mt as set,ht as setPath,gt as shuffle,_t as sleep,vt as sliceString,yt as slugify,bt as sort,xt as sortBy,St as sortedIndex,Ct as sortedIndexBy,wt as sortedIndexWith,Tt as sortedLastIndex,Et as sortedLastIndexBy,Dt as splice,Ot as split,kt as splitAt,At as splitWhen,jt as startsWith,Mt as stringToPath,Nt as subtract,Fe as sum,Pt as sumBy,Ft as swapIndices,It as swapProps,Lt as take,Rt as takeFirstBy,zt as takeLast,Bt as takeLastWhile,Vt as takeWhile,Ht as tap,Ut as times,Wt as toCamelCase,Gt as toKebabCase,Kt as toLowerCase,qt as toSnakeCase,Jt as toTitleCase,Yt as toUpperCase,Xt as truncate,Zt as uncapitalize,Qt as unique,$t as uniqueBy,en as uniqueWith,tn as values,nn as when,rn as zip,an as zipWith};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './add';\nexport * from './add-prop';\nexport * from './all-pass';\nexport * from './any-pass';\nexport * from './capitalize';\nexport * from './ceil';\nexport * from './chunk';\nexport * from './clamp';\nexport * from './clone';\nexport * from './concat';\nexport * from './conditional';\nexport * from './constant';\nexport * from './count-by';\nexport * from './curry';\nexport * from './debounce';\nexport * from './default-to';\nexport * from './difference';\nexport * from './difference-with';\nexport * from './divide';\nexport * from './do-nothing';\nexport * from './drop';\nexport * from './drop-first-by';\nexport * from './drop-last';\nexport * from './drop-last-while';\nexport * from './drop-while';\nexport * from './ends-with';\nexport * from './entries';\nexport * from './evolve';\nexport * from './filter';\nexport * from './find';\nexport * from './find-index';\nexport * from './find-last';\nexport * from './find-last-index';\nexport * from './first';\nexport * from './first-by';\nexport * from './flat';\nexport * from './flat-map';\nexport * from './floor';\nexport * from './for-each';\nexport * from './for-each-obj';\nexport * from './from-entries';\nexport * from './from-keys';\nexport * from './funnel';\nexport * from './group-by';\nexport * from './group-by-prop';\nexport * from './has-at-least';\nexport * from './has-sub-object';\nexport * from './human-readable-file-size';\nexport * from './identity';\nexport * from './index-by';\nexport * from './intersection';\nexport * from './intersection-with';\nexport * from './invert';\nexport * from './is-array';\nexport * from './is-big-int';\nexport * from './is-boolean';\nexport * from './is-date';\nexport * from './is-deep-equal';\nexport * from './is-defined';\nexport * from './is-empty';\nexport * from './is-emptyish';\nexport * from './is-error';\nexport * from './is-function';\nexport * from './is-included-in';\nexport * from './is-non-null';\nexport * from './is-non-nullish';\nexport * from './is-not';\nexport * from './is-nullish';\nexport * from './is-number';\nexport * from './is-object-type';\nexport * from './is-plain-object';\nexport * from './is-promise';\nexport * from './is-shallow-equal';\nexport * from './is-strict-equal';\nexport * from './is-string';\nexport * from './is-symbol';\nexport * from './is-truthy';\nexport * from './join';\nexport * from './key-codes';\nexport * from './keys';\nexport * from './last';\nexport * from './length';\nexport * from './map';\nexport * from './map-keys';\nexport * from './map-to-obj';\nexport * from './map-values';\nexport * from './map-with-feedback';\nexport * from './mean';\nexport * from './mean-by';\nexport * from './median';\nexport * from './merge';\nexport * from './merge-all';\nexport * from './merge-deep';\nexport * from './multiply';\nexport * from './nth-by';\nexport * from './obj-of';\nexport * from './omit';\nexport * from './omit-by';\nexport * from './once';\nexport * from './only';\nexport * from './partial-bind';\nexport * from './partial-last-bind';\nexport * from './partition';\nexport * from './path-or';\nexport * from './pick';\nexport * from './pick-by';\nexport * from './pipe';\nexport * from './piped';\nexport * from './product';\nexport * from './prop';\nexport * from './pull-object';\nexport * from './random-big-int';\nexport * from './random-integer';\nexport * from './random-string';\nexport * from './range';\nexport * from './rank-by';\nexport * from './reduce';\nexport * from './reverse';\nexport * from './round';\nexport * from './sample';\nexport * from './set';\nexport * from './set-path';\nexport * from './shuffle';\nexport * from './sleep';\nexport * from './slice-string';\nexport * from './slugify';\nexport * from './sort';\nexport * from './sort-by';\nexport * from './sorted-index';\nexport * from './sorted-index-by';\nexport * from './sorted-index-with';\nexport * from './sorted-last-index';\nexport * from './sorted-last-index-by';\nexport * from './splice';\nexport * from './split';\nexport * from './split-at';\nexport * from './split-when';\nexport * from './starts-with';\nexport * from './string-to-path';\nexport * from './subtract';\nexport * from './sum';\nexport * from './sum-by';\nexport * from './swap-indices';\nexport * from './swap-props';\nexport * from './take';\nexport * from './take-first-by';\nexport * from './take-last';\nexport * from './take-last-while';\nexport * from './take-while';\nexport * from './tap';\nexport * from './times';\nexport * from './to-camel-case';\nexport * from './to-kebab-case';\nexport * from './to-lower-case';\nexport * from './to-snake-case';\nexport * from './to-title-case';\nexport * from './to-upper-case';\nexport * from './truncate';\nexport * from './type.helpers';\nexport * from './uncapitalize';\nexport * from './unique';\nexport * from './unique-by';\nexport * from './unique-with';\nexport * from './values';\nexport * from './when';\nexport * from './zip';\nexport * from './zip-with';\n\nexport const isBrowser = typeof window !== 'undefined';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './add';\nexport * from './add-prop';\nexport * from './all-pass';\nexport * from './any-pass';\nexport * from './capitalize';\nexport * from './ceil';\nexport * from './chunk';\nexport * from './clamp';\nexport * from './clone';\nexport * from './concat';\nexport * from './conditional';\nexport * from './constant';\nexport * from './count-by';\nexport * from './curry';\nexport * from './debounce';\nexport * from './default-to';\nexport * from './difference';\nexport * from './difference-with';\nexport * from './divide';\nexport * from './do-nothing';\nexport * from './drop';\nexport * from './drop-first-by';\nexport * from './drop-last';\nexport * from './drop-last-while';\nexport * from './drop-while';\nexport * from './ends-with';\nexport * from './entries';\nexport * from './evolve';\nexport * from './filter';\nexport * from './find';\nexport * from './find-index';\nexport * from './find-last';\nexport * from './find-last-index';\nexport * from './first';\nexport * from './first-by';\nexport * from './flat';\nexport * from './flat-map';\nexport * from './floor';\nexport * from './for-each';\nexport * from './for-each-obj';\nexport * from './from-entries';\nexport * from './from-keys';\nexport * from './funnel';\nexport * from './group-by';\nexport * from './group-by-prop';\nexport * from './has-at-least';\nexport * from './has-prop';\nexport * from './has-sub-object';\nexport * from './human-readable-file-size';\nexport * from './identity';\nexport * from './index-by';\nexport * from './intersection';\nexport * from './intersection-with';\nexport * from './invert';\nexport * from './is-array';\nexport * from './is-big-int';\nexport * from './is-boolean';\nexport * from './is-date';\nexport * from './is-deep-equal';\nexport * from './is-defined';\nexport * from './is-empty';\nexport * from './is-emptyish';\nexport * from './is-error';\nexport * from './is-function';\nexport * from './is-included-in';\nexport * from './is-non-null';\nexport * from './is-non-nullish';\nexport * from './is-not';\nexport * from './is-nullish';\nexport * from './is-number';\nexport * from './is-object-type';\nexport * from './is-plain-object';\nexport * from './is-promise';\nexport * from './is-shallow-equal';\nexport * from './is-strict-equal';\nexport * from './is-string';\nexport * from './is-symbol';\nexport * from './is-truthy';\nexport * from './join';\nexport * from './key-codes';\nexport * from './keys';\nexport * from './last';\nexport * from './length';\nexport * from './map';\nexport * from './map-keys';\nexport * from './map-to-obj';\nexport * from './map-values';\nexport * from './map-with-feedback';\nexport * from './mean';\nexport * from './mean-by';\nexport * from './median';\nexport * from './merge';\nexport * from './merge-all';\nexport * from './merge-deep';\nexport * from './multiply';\nexport * from './nth-by';\nexport * from './obj-of';\nexport * from './omit';\nexport * from './omit-by';\nexport * from './once';\nexport * from './only';\nexport * from './partial-bind';\nexport * from './partial-last-bind';\nexport * from './partition';\nexport * from './path-or';\nexport * from './pick';\nexport * from './pick-by';\nexport * from './pipe';\nexport * from './piped';\nexport * from './product';\nexport * from './prop';\nexport * from './pull-object';\nexport * from './random-big-int';\nexport * from './random-integer';\nexport * from './random-string';\nexport * from './range';\nexport * from './rank-by';\nexport * from './reduce';\nexport * from './reverse';\nexport * from './round';\nexport * from './sample';\nexport * from './set';\nexport * from './set-path';\nexport * from './shuffle';\nexport * from './sleep';\nexport * from './slice-string';\nexport * from './slugify';\nexport * from './sort';\nexport * from './sort-by';\nexport * from './sorted-index';\nexport * from './sorted-index-by';\nexport * from './sorted-index-with';\nexport * from './sorted-last-index';\nexport * from './sorted-last-index-by';\nexport * from './splice';\nexport * from './split';\nexport * from './split-at';\nexport * from './split-when';\nexport * from './starts-with';\nexport * from './string-to-path';\nexport * from './subtract';\nexport * from './sum';\nexport * from './sum-by';\nexport * from './swap-indices';\nexport * from './swap-props';\nexport * from './take';\nexport * from './take-first-by';\nexport * from './take-last';\nexport * from './take-last-while';\nexport * from './take-while';\nexport * from './tap';\nexport * from './times';\nexport * from './to-camel-case';\nexport * from './to-kebab-case';\nexport * from './to-lower-case';\nexport * from './to-snake-case';\nexport * from './to-title-case';\nexport * from './to-upper-case';\nexport * from './truncate';\nexport * from './type.helpers';\nexport * from './uncapitalize';\nexport * from './unique';\nexport * from './unique-by';\nexport * from './unique-with';\nexport * from './values';\nexport * from './when';\nexport * from './zip';\nexport * from './zip-with';\n\nexport const isBrowser = typeof window !== 'undefined';\n"],"mappings":"++NAyKA,MAAa,GAAY,OAAO,OAAW"}
|
|
@@ -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,n){return r=>t.some(e=>n(r,e))?{done:!1,hasNext:!0,next:r}:e.t}exports.intersectionWith=n;
|
|
2
2
|
//# sourceMappingURL=intersection-with.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersection-with.cjs","names":["curryFromLazy","SKIP_ITEM"],"sources":["../src/intersection-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 Comparator<TFirst, TSecond> = (a: TFirst, b: TSecond) => boolean;\n\n/**\n * Returns a list of intersecting values based on a custom\n * comparator function that compares elements of both arrays.\n *\n * @param array - The source array.\n * @param other - The second array.\n * @param comparator - The custom comparator.\n * @signature\n * intersectionWith(array, other, comparator)\n * @example\n * intersectionWith(\n * [\n * { id: 1, name: 'Ryan' },\n * { id: 3, name: 'Emma' },\n * ],\n * [3, 5],\n * (a, b) => a.id === b,\n * ) // => [{ id: 3, name: 'Emma' }]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function intersectionWith<TFirst, TSecond>(\n array: ReadonlyArray<TFirst>,\n other: ReadonlyArray<TSecond>,\n comparator: Comparator<TFirst, TSecond>,\n): Array<TFirst>;\n\n/**\n * Returns a list of intersecting values based on a custom\n * comparator function that compares elements of both arrays.\n *\n * @param other - The second array.\n * @param comparator - The custom comparator.\n * @signature\n * intersectionWith(other, comparator)(array)\n * @example\n * intersectionWith(\n * [3, 5],\n * (a, b) => a.id === b\n * )([\n * { id: 1, name: 'Ryan' },\n * { id: 3, name: 'Emma' },\n * ]); // => [{ id: 3, name: 'Emma' }]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function intersectionWith<TFirst, TSecond>(\n other: ReadonlyArray<TSecond>,\n /**\n * Type inference doesn't work properly for the comparator's first parameter\n * in data last variant.\n */\n comparator: Comparator<TFirst, TSecond>,\n): (array: ReadonlyArray<TFirst>) => Array<TFirst>;\n\nexport function intersectionWith(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<TFirst, TSecond>(other: ReadonlyArray<TSecond>, comparator: Comparator<TFirst, TSecond>): LazyEvaluator<TFirst> {\n return (value) =>\n other.some((otherValue) => comparator(value, otherValue))\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"oKA+DA,SAAgB,EAAiB,GAAG,EAAuC,CACzE,OAAOA,EAAAA,EAAc,EAAoB,
|
|
1
|
+
{"version":3,"file":"intersection-with.cjs","names":["curryFromLazy","SKIP_ITEM"],"sources":["../src/intersection-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 Comparator<TFirst, TSecond> = (a: TFirst, b: TSecond) => boolean;\n\n/**\n * Returns a list of intersecting values based on a custom\n * comparator function that compares elements of both arrays.\n *\n * @param array - The source array.\n * @param other - The second array.\n * @param comparator - The custom comparator.\n * @signature\n * intersectionWith(array, other, comparator)\n * @example\n * intersectionWith(\n * [\n * { id: 1, name: 'Ryan' },\n * { id: 3, name: 'Emma' },\n * ],\n * [3, 5],\n * (a, b) => a.id === b,\n * ) // => [{ id: 3, name: 'Emma' }]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function intersectionWith<TFirst, TSecond>(\n array: ReadonlyArray<TFirst>,\n other: ReadonlyArray<TSecond>,\n comparator: Comparator<TFirst, TSecond>,\n): Array<TFirst>;\n\n/**\n * Returns a list of intersecting values based on a custom\n * comparator function that compares elements of both arrays.\n *\n * @param other - The second array.\n * @param comparator - The custom comparator.\n * @signature\n * intersectionWith(other, comparator)(array)\n * @example\n * intersectionWith(\n * [3, 5],\n * (a, b) => a.id === b\n * )([\n * { id: 1, name: 'Ryan' },\n * { id: 3, name: 'Emma' },\n * ]); // => [{ id: 3, name: 'Emma' }]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function intersectionWith<TFirst, TSecond>(\n other: ReadonlyArray<TSecond>,\n /**\n * Type inference doesn't work properly for the comparator's first parameter\n * in data last variant.\n */\n comparator: Comparator<TFirst, TSecond>,\n): (array: ReadonlyArray<TFirst>) => Array<TFirst>;\n\nexport function intersectionWith(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<TFirst, TSecond>(other: ReadonlyArray<TSecond>, comparator: Comparator<TFirst, TSecond>): LazyEvaluator<TFirst> {\n return (value) =>\n other.some((otherValue) => comparator(value, otherValue))\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"oKA+DA,SAAgB,EAAiB,GAAG,EAAuC,CACzE,OAAOA,EAAAA,EAAc,EAAoB,CAAI,CAC/C,CAEA,SAAS,EAAoC,EAA+B,EAAgE,CAC1I,MAAQ,IACN,EAAM,KAAM,GAAe,EAAW,EAAO,CAAU,CAAC,EACpD,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,CAAM,EAC1CC,EAAAA,CACR"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./utility-evaluators-
|
|
1
|
+
import{t as e}from"./utility-evaluators-DDW55xeL.js";import{t}from"./curry-from-lazy-BoPMn2L_.js";function n(...e){return t(r,e)}function r(t,n){return r=>t.some(e=>n(r,e))?{done:!1,hasNext:!0,next:r}:e}export{n as intersectionWith};
|
|
2
2
|
//# sourceMappingURL=intersection-with.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersection-with.js","names":[],"sources":["../src/intersection-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 Comparator<TFirst, TSecond> = (a: TFirst, b: TSecond) => boolean;\n\n/**\n * Returns a list of intersecting values based on a custom\n * comparator function that compares elements of both arrays.\n *\n * @param array - The source array.\n * @param other - The second array.\n * @param comparator - The custom comparator.\n * @signature\n * intersectionWith(array, other, comparator)\n * @example\n * intersectionWith(\n * [\n * { id: 1, name: 'Ryan' },\n * { id: 3, name: 'Emma' },\n * ],\n * [3, 5],\n * (a, b) => a.id === b,\n * ) // => [{ id: 3, name: 'Emma' }]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function intersectionWith<TFirst, TSecond>(\n array: ReadonlyArray<TFirst>,\n other: ReadonlyArray<TSecond>,\n comparator: Comparator<TFirst, TSecond>,\n): Array<TFirst>;\n\n/**\n * Returns a list of intersecting values based on a custom\n * comparator function that compares elements of both arrays.\n *\n * @param other - The second array.\n * @param comparator - The custom comparator.\n * @signature\n * intersectionWith(other, comparator)(array)\n * @example\n * intersectionWith(\n * [3, 5],\n * (a, b) => a.id === b\n * )([\n * { id: 1, name: 'Ryan' },\n * { id: 3, name: 'Emma' },\n * ]); // => [{ id: 3, name: 'Emma' }]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function intersectionWith<TFirst, TSecond>(\n other: ReadonlyArray<TSecond>,\n /**\n * Type inference doesn't work properly for the comparator's first parameter\n * in data last variant.\n */\n comparator: Comparator<TFirst, TSecond>,\n): (array: ReadonlyArray<TFirst>) => Array<TFirst>;\n\nexport function intersectionWith(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<TFirst, TSecond>(other: ReadonlyArray<TSecond>, comparator: Comparator<TFirst, TSecond>): LazyEvaluator<TFirst> {\n return (value) =>\n other.some((otherValue) => comparator(value, otherValue))\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"kGA+DA,SAAgB,EAAiB,GAAG,EAAuC,CACzE,OAAO,EAAc,EAAoB,
|
|
1
|
+
{"version":3,"file":"intersection-with.js","names":[],"sources":["../src/intersection-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 Comparator<TFirst, TSecond> = (a: TFirst, b: TSecond) => boolean;\n\n/**\n * Returns a list of intersecting values based on a custom\n * comparator function that compares elements of both arrays.\n *\n * @param array - The source array.\n * @param other - The second array.\n * @param comparator - The custom comparator.\n * @signature\n * intersectionWith(array, other, comparator)\n * @example\n * intersectionWith(\n * [\n * { id: 1, name: 'Ryan' },\n * { id: 3, name: 'Emma' },\n * ],\n * [3, 5],\n * (a, b) => a.id === b,\n * ) // => [{ id: 3, name: 'Emma' }]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function intersectionWith<TFirst, TSecond>(\n array: ReadonlyArray<TFirst>,\n other: ReadonlyArray<TSecond>,\n comparator: Comparator<TFirst, TSecond>,\n): Array<TFirst>;\n\n/**\n * Returns a list of intersecting values based on a custom\n * comparator function that compares elements of both arrays.\n *\n * @param other - The second array.\n * @param comparator - The custom comparator.\n * @signature\n * intersectionWith(other, comparator)(array)\n * @example\n * intersectionWith(\n * [3, 5],\n * (a, b) => a.id === b\n * )([\n * { id: 1, name: 'Ryan' },\n * { id: 3, name: 'Emma' },\n * ]); // => [{ id: 3, name: 'Emma' }]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function intersectionWith<TFirst, TSecond>(\n other: ReadonlyArray<TSecond>,\n /**\n * Type inference doesn't work properly for the comparator's first parameter\n * in data last variant.\n */\n comparator: Comparator<TFirst, TSecond>,\n): (array: ReadonlyArray<TFirst>) => Array<TFirst>;\n\nexport function intersectionWith(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<TFirst, TSecond>(other: ReadonlyArray<TSecond>, comparator: Comparator<TFirst, TSecond>): LazyEvaluator<TFirst> {\n return (value) =>\n other.some((otherValue) => comparator(value, otherValue))\n ? { done: false, hasNext: true, next: value }\n : SKIP_ITEM;\n}\n"],"mappings":"kGA+DA,SAAgB,EAAiB,GAAG,EAAuC,CACzE,OAAO,EAAc,EAAoB,CAAI,CAC/C,CAEA,SAAS,EAAoC,EAA+B,EAAgE,CAC1I,MAAQ,IACN,EAAM,KAAM,GAAe,EAAW,EAAO,CAAU,CAAC,EACpD,CAAE,KAAM,GAAO,QAAS,GAAM,KAAM,CAAM,EAC1C,CACR"}
|
package/dist/intersection.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.n;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?e.t:(r===1?n.delete(t):n.set(t,r-1),{hasNext:!0,next:t,done:n.size===0})}}exports.intersection=n;
|
|
2
2
|
//# sourceMappingURL=intersection.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersection.cjs","names":["curryFromLazy","lazyEmptyEvaluator","SKIP_ITEM"],"sources":["../src/intersection.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyEmptyEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Returns a list of elements that exist in both array. The output maintains the\n * same order as the input. The inputs are treated as multi-sets/bags (multiple\n * copies of items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The items to compare against.\n * @signature\n * intersection(data, other)\n * @example\n * intersection([1, 2, 3], [2, 3, 5]); // => [2, 3]\n * intersection([1, 1, 2, 2], [1]); // => [1]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function intersection<T, S>(\n data: ReadonlyArray<T>,\n other: ReadonlyArray<S>,\n): Array<S & T>;\n\n/**\n * Returns a list of elements that exist in both array. The output maintains the\n * same order as the input. The inputs are treated as multi-sets/bags (multiple\n * copies of items are treated as unique items).\n *\n * @param other - The items to compare against.\n * @signature\n * intersection(other)(data)\n * @example\n * pipe([1, 2, 3], intersection([2, 3, 5])); // => [2, 3]\n * pipe([1, 1, 2, 2], intersection([1])); // => [1]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function intersection<S>(\n other: ReadonlyArray<S>,\n): <T>(data: ReadonlyArray<T>) => Array<S & T>;\n\nexport function intersection(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, S>(\n other: ReadonlyArray<S>,\n): LazyEvaluator<T, S & T> {\n if (other.length === 0) {\n return lazyEmptyEvaluator;\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<S | 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 \"used\" enough\n // copies of it so we skip the remaining values.\n return SKIP_ITEM;\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 return this one and remove it from\n // our ongoing tally.\n if (copies === 1) {\n remaining.delete(value);\n } else {\n remaining.set(value, copies - 1);\n }\n\n return {\n hasNext: true,\n // We can safely cast here because if value was in the `remaining` map, it\n // has to be of type S (that's just how we built it).\n next: value as S & T,\n // We can stop the iteration if the remaining map is empty.\n done: remaining.size === 0,\n };\n };\n}\n"],"mappings":"oKA4CA,SAAgB,EAAa,GAAG,EAAuC,CACrE,OAAOA,EAAAA,EAAc,EAAoB,
|
|
1
|
+
{"version":3,"file":"intersection.cjs","names":["curryFromLazy","lazyEmptyEvaluator","SKIP_ITEM"],"sources":["../src/intersection.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyEmptyEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Returns a list of elements that exist in both array. The output maintains the\n * same order as the input. The inputs are treated as multi-sets/bags (multiple\n * copies of items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The items to compare against.\n * @signature\n * intersection(data, other)\n * @example\n * intersection([1, 2, 3], [2, 3, 5]); // => [2, 3]\n * intersection([1, 1, 2, 2], [1]); // => [1]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function intersection<T, S>(\n data: ReadonlyArray<T>,\n other: ReadonlyArray<S>,\n): Array<S & T>;\n\n/**\n * Returns a list of elements that exist in both array. The output maintains the\n * same order as the input. The inputs are treated as multi-sets/bags (multiple\n * copies of items are treated as unique items).\n *\n * @param other - The items to compare against.\n * @signature\n * intersection(other)(data)\n * @example\n * pipe([1, 2, 3], intersection([2, 3, 5])); // => [2, 3]\n * pipe([1, 1, 2, 2], intersection([1])); // => [1]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function intersection<S>(\n other: ReadonlyArray<S>,\n): <T>(data: ReadonlyArray<T>) => Array<S & T>;\n\nexport function intersection(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, S>(\n other: ReadonlyArray<S>,\n): LazyEvaluator<T, S & T> {\n if (other.length === 0) {\n return lazyEmptyEvaluator;\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<S | 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 \"used\" enough\n // copies of it so we skip the remaining values.\n return SKIP_ITEM;\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 return this one and remove it from\n // our ongoing tally.\n if (copies === 1) {\n remaining.delete(value);\n } else {\n remaining.set(value, copies - 1);\n }\n\n return {\n hasNext: true,\n // We can safely cast here because if value was in the `remaining` map, it\n // has to be of type S (that's just how we built it).\n next: value as S & T,\n // We can stop the iteration if the remaining map is empty.\n done: remaining.size === 0,\n };\n };\n}\n"],"mappings":"oKA4CA,SAAgB,EAAa,GAAG,EAAuC,CACrE,OAAOA,EAAAA,EAAc,EAAoB,CAAI,CAC/C,CAEA,SAAS,EACP,EACyB,CACzB,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,EAiBlC,OAfI,IAAW,IAAA,IAAa,IAAW,EAG9BC,EAAAA,GAML,IAAW,EACb,EAAU,OAAO,CAAK,EAEtB,EAAU,IAAI,EAAO,EAAS,CAAC,EAG1B,CACL,QAAS,GAGT,KAAM,EAEN,KAAM,EAAU,OAAS,CAC3B,EACF,CACF"}
|
package/dist/intersection.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,t}from"./utility-evaluators-
|
|
1
|
+
import{n 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?t:(n===1?r.delete(e):r.set(e,n-1),{hasNext:!0,next:e,done:r.size===0})}}export{r as intersection};
|
|
2
2
|
//# sourceMappingURL=intersection.js.map
|
package/dist/intersection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersection.js","names":[],"sources":["../src/intersection.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyEmptyEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Returns a list of elements that exist in both array. The output maintains the\n * same order as the input. The inputs are treated as multi-sets/bags (multiple\n * copies of items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The items to compare against.\n * @signature\n * intersection(data, other)\n * @example\n * intersection([1, 2, 3], [2, 3, 5]); // => [2, 3]\n * intersection([1, 1, 2, 2], [1]); // => [1]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function intersection<T, S>(\n data: ReadonlyArray<T>,\n other: ReadonlyArray<S>,\n): Array<S & T>;\n\n/**\n * Returns a list of elements that exist in both array. The output maintains the\n * same order as the input. The inputs are treated as multi-sets/bags (multiple\n * copies of items are treated as unique items).\n *\n * @param other - The items to compare against.\n * @signature\n * intersection(other)(data)\n * @example\n * pipe([1, 2, 3], intersection([2, 3, 5])); // => [2, 3]\n * pipe([1, 1, 2, 2], intersection([1])); // => [1]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function intersection<S>(\n other: ReadonlyArray<S>,\n): <T>(data: ReadonlyArray<T>) => Array<S & T>;\n\nexport function intersection(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, S>(\n other: ReadonlyArray<S>,\n): LazyEvaluator<T, S & T> {\n if (other.length === 0) {\n return lazyEmptyEvaluator;\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<S | 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 \"used\" enough\n // copies of it so we skip the remaining values.\n return SKIP_ITEM;\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 return this one and remove it from\n // our ongoing tally.\n if (copies === 1) {\n remaining.delete(value);\n } else {\n remaining.set(value, copies - 1);\n }\n\n return {\n hasNext: true,\n // We can safely cast here because if value was in the `remaining` map, it\n // has to be of type S (that's just how we built it).\n next: value as S & T,\n // We can stop the iteration if the remaining map is empty.\n done: remaining.size === 0,\n };\n };\n}\n"],"mappings":"yGA4CA,SAAgB,EAAa,GAAG,EAAuC,CACrE,OAAO,EAAc,EAAoB,
|
|
1
|
+
{"version":3,"file":"intersection.js","names":[],"sources":["../src/intersection.ts"],"sourcesContent":["import type { LazyEvaluator } from './internal/types/lazy-evaluator';\nimport { curryFromLazy } from './internal/curry-from-lazy';\nimport { lazyEmptyEvaluator, SKIP_ITEM } from './internal/utility-evaluators';\n\n/**\n * Returns a list of elements that exist in both array. The output maintains the\n * same order as the input. The inputs are treated as multi-sets/bags (multiple\n * copies of items are treated as unique items).\n *\n * @param data - The input items.\n * @param other - The items to compare against.\n * @signature\n * intersection(data, other)\n * @example\n * intersection([1, 2, 3], [2, 3, 5]); // => [2, 3]\n * intersection([1, 1, 2, 2], [1]); // => [1]\n * @dataFirst\n * @lazy\n * @category Array\n */\nexport function intersection<T, S>(\n data: ReadonlyArray<T>,\n other: ReadonlyArray<S>,\n): Array<S & T>;\n\n/**\n * Returns a list of elements that exist in both array. The output maintains the\n * same order as the input. The inputs are treated as multi-sets/bags (multiple\n * copies of items are treated as unique items).\n *\n * @param other - The items to compare against.\n * @signature\n * intersection(other)(data)\n * @example\n * pipe([1, 2, 3], intersection([2, 3, 5])); // => [2, 3]\n * pipe([1, 1, 2, 2], intersection([1])); // => [1]\n * @dataLast\n * @lazy\n * @category Array\n */\nexport function intersection<S>(\n other: ReadonlyArray<S>,\n): <T>(data: ReadonlyArray<T>) => Array<S & T>;\n\nexport function intersection(...args: ReadonlyArray<unknown>): unknown {\n return curryFromLazy(lazyImplementation, args);\n}\n\nfunction lazyImplementation<T, S>(\n other: ReadonlyArray<S>,\n): LazyEvaluator<T, S & T> {\n if (other.length === 0) {\n return lazyEmptyEvaluator;\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<S | 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 \"used\" enough\n // copies of it so we skip the remaining values.\n return SKIP_ITEM;\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 return this one and remove it from\n // our ongoing tally.\n if (copies === 1) {\n remaining.delete(value);\n } else {\n remaining.set(value, copies - 1);\n }\n\n return {\n hasNext: true,\n // We can safely cast here because if value was in the `remaining` map, it\n // has to be of type S (that's just how we built it).\n next: value as S & T,\n // We can stop the iteration if the remaining map is empty.\n done: remaining.size === 0,\n };\n };\n}\n"],"mappings":"yGA4CA,SAAgB,EAAa,GAAG,EAAuC,CACrE,OAAO,EAAc,EAAoB,CAAI,CAC/C,CAEA,SAAS,EACP,EACyB,CACzB,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,EAiBlC,OAfI,IAAW,IAAA,IAAa,IAAW,EAG9B,GAML,IAAW,EACb,EAAU,OAAO,CAAK,EAEtB,EAAU,IAAI,EAAO,EAAS,CAAC,EAG1B,CACL,QAAS,GAGT,KAAM,EAEN,KAAM,EAAU,OAAS,CAC3B,EACF,CACF"}
|
package/dist/invert.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){let t={};for(let[n,r]of Object.entries(e))t[r]=n;return t}exports.invert=t;
|
|
2
2
|
//# sourceMappingURL=invert.cjs.map
|
package/dist/invert.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invert.cjs","names":["curry"],"sources":["../src/invert.ts"],"sourcesContent":["import type { Simplify } from 'type-fest';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Inverted<T extends object> = Simplify<{\n -readonly [K in keyof T as K extends number | string\n ? Required<T>[K] extends PropertyKey\n ? Required<T>[K]\n : never\n : never]: ToString<K>;\n}>;\n\n/**\n * Returns an object whose keys and values are swapped. If the object contains duplicate values,\n * subsequent values will overwrite previous values.\n *\n * @param object - The object.\n * @signature\n * invert(object)\n * @example\n * invert({ a: \"d\", b: \"e\", c: \"f\" }) // => { d: \"a\", e: \"b\", f: \"c\" }\n * @dataFirst\n * @category Object\n */\nexport function invert<T extends object>(object: T): Inverted<T>;\n\n/**\n * Returns an object whose keys and values are swapped. If the object contains duplicate values,\n * subsequent values will overwrite previous values.\n *\n * @signature\n * invert()(object)\n * @example\n * pipe({ a: \"d\", b: \"e\", c: \"f\" }, invert()); // => { d: \"a\", e: \"b\", f: \"c\" }\n * @dataLast\n * @category Object\n */\nexport function invert<T extends object>(): (object: T) => Inverted<T>;\n\nexport function invert(...args: ReadonlyArray<unknown>): unknown {\n return curry(invertImplementation, args);\n}\n\nfunction invertImplementation(\n data: Readonly<Record<PropertyKey, PropertyKey>>,\n): Record<PropertyKey, PropertyKey> {\n const result: Record<PropertyKey, PropertyKey> = {};\n\n for (const [key, value] of Object.entries(data)) {\n result[value] = key;\n }\n\n return result;\n}\n"],"mappings":"kGAuCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"invert.cjs","names":["curry"],"sources":["../src/invert.ts"],"sourcesContent":["import type { Simplify } from 'type-fest';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Inverted<T extends object> = Simplify<{\n -readonly [K in keyof T as K extends number | string\n ? Required<T>[K] extends PropertyKey\n ? Required<T>[K]\n : never\n : never]: ToString<K>;\n}>;\n\n/**\n * Returns an object whose keys and values are swapped. If the object contains duplicate values,\n * subsequent values will overwrite previous values.\n *\n * @param object - The object.\n * @signature\n * invert(object)\n * @example\n * invert({ a: \"d\", b: \"e\", c: \"f\" }) // => { d: \"a\", e: \"b\", f: \"c\" }\n * @dataFirst\n * @category Object\n */\nexport function invert<T extends object>(object: T): Inverted<T>;\n\n/**\n * Returns an object whose keys and values are swapped. If the object contains duplicate values,\n * subsequent values will overwrite previous values.\n *\n * @signature\n * invert()(object)\n * @example\n * pipe({ a: \"d\", b: \"e\", c: \"f\" }, invert()); // => { d: \"a\", e: \"b\", f: \"c\" }\n * @dataLast\n * @category Object\n */\nexport function invert<T extends object>(): (object: T) => Inverted<T>;\n\nexport function invert(...args: ReadonlyArray<unknown>): unknown {\n return curry(invertImplementation, args);\n}\n\nfunction invertImplementation(\n data: Readonly<Record<PropertyKey, PropertyKey>>,\n): Record<PropertyKey, PropertyKey> {\n const result: Record<PropertyKey, PropertyKey> = {};\n\n for (const [key, value] of Object.entries(data)) {\n result[value] = key;\n }\n\n return result;\n}\n"],"mappings":"kGAuCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAOA,EAAAA,MAAM,EAAsB,CAAI,CACzC,CAEA,SAAS,EACP,EACkC,CAClC,IAAM,EAA2C,CAAC,EAElD,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAI,EAC5C,EAAO,GAAS,EAGlB,OAAO,CACT"}
|
package/dist/invert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invert.js","names":[],"sources":["../src/invert.ts"],"sourcesContent":["import type { Simplify } from 'type-fest';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Inverted<T extends object> = Simplify<{\n -readonly [K in keyof T as K extends number | string\n ? Required<T>[K] extends PropertyKey\n ? Required<T>[K]\n : never\n : never]: ToString<K>;\n}>;\n\n/**\n * Returns an object whose keys and values are swapped. If the object contains duplicate values,\n * subsequent values will overwrite previous values.\n *\n * @param object - The object.\n * @signature\n * invert(object)\n * @example\n * invert({ a: \"d\", b: \"e\", c: \"f\" }) // => { d: \"a\", e: \"b\", f: \"c\" }\n * @dataFirst\n * @category Object\n */\nexport function invert<T extends object>(object: T): Inverted<T>;\n\n/**\n * Returns an object whose keys and values are swapped. If the object contains duplicate values,\n * subsequent values will overwrite previous values.\n *\n * @signature\n * invert()(object)\n * @example\n * pipe({ a: \"d\", b: \"e\", c: \"f\" }, invert()); // => { d: \"a\", e: \"b\", f: \"c\" }\n * @dataLast\n * @category Object\n */\nexport function invert<T extends object>(): (object: T) => Inverted<T>;\n\nexport function invert(...args: ReadonlyArray<unknown>): unknown {\n return curry(invertImplementation, args);\n}\n\nfunction invertImplementation(\n data: Readonly<Record<PropertyKey, PropertyKey>>,\n): Record<PropertyKey, PropertyKey> {\n const result: Record<PropertyKey, PropertyKey> = {};\n\n for (const [key, value] of Object.entries(data)) {\n result[value] = key;\n }\n\n return result;\n}\n"],"mappings":"mCAuCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,
|
|
1
|
+
{"version":3,"file":"invert.js","names":[],"sources":["../src/invert.ts"],"sourcesContent":["import type { Simplify } from 'type-fest';\nimport type { ToString } from './internal/types/to-string';\nimport { curry } from './curry';\n\ntype Inverted<T extends object> = Simplify<{\n -readonly [K in keyof T as K extends number | string\n ? Required<T>[K] extends PropertyKey\n ? Required<T>[K]\n : never\n : never]: ToString<K>;\n}>;\n\n/**\n * Returns an object whose keys and values are swapped. If the object contains duplicate values,\n * subsequent values will overwrite previous values.\n *\n * @param object - The object.\n * @signature\n * invert(object)\n * @example\n * invert({ a: \"d\", b: \"e\", c: \"f\" }) // => { d: \"a\", e: \"b\", f: \"c\" }\n * @dataFirst\n * @category Object\n */\nexport function invert<T extends object>(object: T): Inverted<T>;\n\n/**\n * Returns an object whose keys and values are swapped. If the object contains duplicate values,\n * subsequent values will overwrite previous values.\n *\n * @signature\n * invert()(object)\n * @example\n * pipe({ a: \"d\", b: \"e\", c: \"f\" }, invert()); // => { d: \"a\", e: \"b\", f: \"c\" }\n * @dataLast\n * @category Object\n */\nexport function invert<T extends object>(): (object: T) => Inverted<T>;\n\nexport function invert(...args: ReadonlyArray<unknown>): unknown {\n return curry(invertImplementation, args);\n}\n\nfunction invertImplementation(\n data: Readonly<Record<PropertyKey, PropertyKey>>,\n): Record<PropertyKey, PropertyKey> {\n const result: Record<PropertyKey, PropertyKey> = {};\n\n for (const [key, value] of Object.entries(data)) {\n result[value] = key;\n }\n\n return result;\n}\n"],"mappings":"mCAuCA,SAAgB,EAAO,GAAG,EAAuC,CAC/D,OAAO,EAAM,EAAsB,CAAI,CACzC,CAEA,SAAS,EACP,EACkC,CAClC,IAAM,EAA2C,CAAC,EAElD,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAI,EAC5C,EAAO,GAAS,EAGlB,OAAO,CACT"}
|
package/dist/is-array.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-array.cjs","names":[],"sources":["../src/is-array.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is an Array and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is an Array, false otherwise.\n * @signature\n * isArray(data)\n * @example\n * isArray([5]) //=> true\n * isArray([]) //=> true\n * isArray('somethingElse') //=> false\n * @category Guard\n */\nexport function isArray<T>(\n data: ArrayLike<unknown> | T,\n): data is NarrowedTo<T, ReadonlyArray<unknown>> {\n return Array.isArray(data);\n}\n"],"mappings":"mEAeA,SAAgB,EACd,EAC+C,CAC/C,OAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"is-array.cjs","names":[],"sources":["../src/is-array.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is an Array and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is an Array, false otherwise.\n * @signature\n * isArray(data)\n * @example\n * isArray([5]) //=> true\n * isArray([]) //=> true\n * isArray('somethingElse') //=> false\n * @category Guard\n */\nexport function isArray<T>(\n data: ArrayLike<unknown> | T,\n): data is NarrowedTo<T, ReadonlyArray<unknown>> {\n return Array.isArray(data);\n}\n"],"mappings":"mEAeA,SAAgB,EACd,EAC+C,CAC/C,OAAO,MAAM,QAAQ,CAAI,CAC3B"}
|
package/dist/is-array.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-array.js","names":[],"sources":["../src/is-array.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is an Array and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is an Array, false otherwise.\n * @signature\n * isArray(data)\n * @example\n * isArray([5]) //=> true\n * isArray([]) //=> true\n * isArray('somethingElse') //=> false\n * @category Guard\n */\nexport function isArray<T>(\n data: ArrayLike<unknown> | T,\n): data is NarrowedTo<T, ReadonlyArray<unknown>> {\n return Array.isArray(data);\n}\n"],"mappings":"AAeA,SAAgB,EACd,EAC+C,CAC/C,OAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"is-array.js","names":[],"sources":["../src/is-array.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is an Array and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is an Array, false otherwise.\n * @signature\n * isArray(data)\n * @example\n * isArray([5]) //=> true\n * isArray([]) //=> true\n * isArray('somethingElse') //=> false\n * @category Guard\n */\nexport function isArray<T>(\n data: ArrayLike<unknown> | T,\n): data is NarrowedTo<T, ReadonlyArray<unknown>> {\n return Array.isArray(data);\n}\n"],"mappings":"AAeA,SAAgB,EACd,EAC+C,CAC/C,OAAO,MAAM,QAAQ,CAAI,CAC3B"}
|
package/dist/is-big-int.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-big-int.cjs","names":[],"sources":["../src/is-big-int.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is a bigint and narrows its\n * type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a number, false otherwise.\n * @signature\n * isBigInt(data)\n * @example\n * isBigInt(1n); // => true\n * isBigInt(1); // => false\n * isBigInt('notANumber'); // => false\n * @category Guard\n */\nexport function isBigInt<T>(data: T | bigint): data is NarrowedTo<T, bigint> {\n return typeof data === 'bigint';\n}\n"],"mappings":"mEAgBA,SAAgB,EAAY,EAAiD,CAC3E,OAAO,OAAO,GAAS"}
|
|
1
|
+
{"version":3,"file":"is-big-int.cjs","names":[],"sources":["../src/is-big-int.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is a bigint and narrows its\n * type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a number, false otherwise.\n * @signature\n * isBigInt(data)\n * @example\n * isBigInt(1n); // => true\n * isBigInt(1); // => false\n * isBigInt('notANumber'); // => false\n * @category Guard\n */\nexport function isBigInt<T>(data: T | bigint): data is NarrowedTo<T, bigint> {\n return typeof data === 'bigint';\n}\n"],"mappings":"mEAgBA,SAAgB,EAAY,EAAiD,CAC3E,OAAO,OAAO,GAAS,QACzB"}
|
package/dist/is-big-int.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-big-int.js","names":[],"sources":["../src/is-big-int.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is a bigint and narrows its\n * type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a number, false otherwise.\n * @signature\n * isBigInt(data)\n * @example\n * isBigInt(1n); // => true\n * isBigInt(1); // => false\n * isBigInt('notANumber'); // => false\n * @category Guard\n */\nexport function isBigInt<T>(data: T | bigint): data is NarrowedTo<T, bigint> {\n return typeof data === 'bigint';\n}\n"],"mappings":"AAgBA,SAAgB,EAAY,EAAiD,CAC3E,OAAO,OAAO,GAAS"}
|
|
1
|
+
{"version":3,"file":"is-big-int.js","names":[],"sources":["../src/is-big-int.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is a bigint and narrows its\n * type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a number, false otherwise.\n * @signature\n * isBigInt(data)\n * @example\n * isBigInt(1n); // => true\n * isBigInt(1); // => false\n * isBigInt('notANumber'); // => false\n * @category Guard\n */\nexport function isBigInt<T>(data: T | bigint): data is NarrowedTo<T, bigint> {\n return typeof data === 'bigint';\n}\n"],"mappings":"AAgBA,SAAgB,EAAY,EAAiD,CAC3E,OAAO,OAAO,GAAS,QACzB"}
|
package/dist/is-boolean.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-boolean.cjs","names":[],"sources":["../src/is-boolean.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is a boolean and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a boolean, false otherwise.\n * @signature\n * isBoolean(data)\n * @example\n * isBoolean(true) //=> true\n * isBoolean(false) //=> true\n * isBoolean('somethingElse') //=> false\n * @category Guard\n */\nexport function isBoolean<T>(\n data: T | boolean,\n): data is NarrowedTo<T, boolean> {\n return typeof data === 'boolean';\n}\n"],"mappings":"mEAeA,SAAgB,EACd,EACgC,CAChC,OAAO,OAAO,GAAS"}
|
|
1
|
+
{"version":3,"file":"is-boolean.cjs","names":[],"sources":["../src/is-boolean.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is a boolean and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a boolean, false otherwise.\n * @signature\n * isBoolean(data)\n * @example\n * isBoolean(true) //=> true\n * isBoolean(false) //=> true\n * isBoolean('somethingElse') //=> false\n * @category Guard\n */\nexport function isBoolean<T>(\n data: T | boolean,\n): data is NarrowedTo<T, boolean> {\n return typeof data === 'boolean';\n}\n"],"mappings":"mEAeA,SAAgB,EACd,EACgC,CAChC,OAAO,OAAO,GAAS,SACzB"}
|
package/dist/is-boolean.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-boolean.js","names":[],"sources":["../src/is-boolean.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is a boolean and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a boolean, false otherwise.\n * @signature\n * isBoolean(data)\n * @example\n * isBoolean(true) //=> true\n * isBoolean(false) //=> true\n * isBoolean('somethingElse') //=> false\n * @category Guard\n */\nexport function isBoolean<T>(\n data: T | boolean,\n): data is NarrowedTo<T, boolean> {\n return typeof data === 'boolean';\n}\n"],"mappings":"AAeA,SAAgB,EACd,EACgC,CAChC,OAAO,OAAO,GAAS"}
|
|
1
|
+
{"version":3,"file":"is-boolean.js","names":[],"sources":["../src/is-boolean.ts"],"sourcesContent":["import type { NarrowedTo } from './internal/types/narrowed-to';\n\n/**\n * A function that checks if the passed parameter is a boolean and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a boolean, false otherwise.\n * @signature\n * isBoolean(data)\n * @example\n * isBoolean(true) //=> true\n * isBoolean(false) //=> true\n * isBoolean('somethingElse') //=> false\n * @category Guard\n */\nexport function isBoolean<T>(\n data: T | boolean,\n): data is NarrowedTo<T, boolean> {\n return typeof data === 'boolean';\n}\n"],"mappings":"AAeA,SAAgB,EACd,EACgC,CAChC,OAAO,OAAO,GAAS,SACzB"}
|
package/dist/is-date.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-date.cjs","names":[],"sources":["../src/is-date.ts"],"sourcesContent":["/**\n * A function that checks if the passed parameter is a Date and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a Date, false otherwise.\n * @signature\n * isDate(data)\n * @example\n * isDate(new Date()) //=> true\n * isDate('somethingElse') //=> false\n * @category Guard\n */\nexport function isDate(data: unknown): data is Date {\n return data instanceof Date;\n}\n"],"mappings":"mEAYA,SAAgB,EAAO,EAA6B,CAClD,OAAO,aAAgB"}
|
|
1
|
+
{"version":3,"file":"is-date.cjs","names":[],"sources":["../src/is-date.ts"],"sourcesContent":["/**\n * A function that checks if the passed parameter is a Date and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a Date, false otherwise.\n * @signature\n * isDate(data)\n * @example\n * isDate(new Date()) //=> true\n * isDate('somethingElse') //=> false\n * @category Guard\n */\nexport function isDate(data: unknown): data is Date {\n return data instanceof Date;\n}\n"],"mappings":"mEAYA,SAAgB,EAAO,EAA6B,CAClD,OAAO,aAAgB,IACzB"}
|
package/dist/is-date.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-date.js","names":[],"sources":["../src/is-date.ts"],"sourcesContent":["/**\n * A function that checks if the passed parameter is a Date and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a Date, false otherwise.\n * @signature\n * isDate(data)\n * @example\n * isDate(new Date()) //=> true\n * isDate('somethingElse') //=> false\n * @category Guard\n */\nexport function isDate(data: unknown): data is Date {\n return data instanceof Date;\n}\n"],"mappings":"AAYA,SAAgB,EAAO,EAA6B,CAClD,OAAO,aAAgB"}
|
|
1
|
+
{"version":3,"file":"is-date.js","names":[],"sources":["../src/is-date.ts"],"sourcesContent":["/**\n * A function that checks if the passed parameter is a Date and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is a Date, false otherwise.\n * @signature\n * isDate(data)\n * @example\n * isDate(new Date()) //=> true\n * isDate('somethingElse') //=> false\n * @category Guard\n */\nexport function isDate(data: unknown): data is Date {\n return data instanceof Date;\n}\n"],"mappings":"AAYA,SAAgB,EAAO,EAA6B,CAClD,OAAO,aAAgB,IACzB"}
|
package/dist/is-deep-equal.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./curry.cjs");function t(...t){return e.curry(n,t)}function n(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||!r(e,t))return!1;if(Array.isArray(e))return i(e,t);if(e instanceof Map)return a(e,t);if(e instanceof Set)return o(e,t);if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let[r,i]of Object.entries(e))if(!(r in t)||!n(i,t[r]))return!1;return!0}function r(e,t){let n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t);return n===r?!0:n===null?r===Object.prototype:n===Object.prototype&&r===null}function i(e,t){if(e.length!==t.length)return!1;for(let[r,i]of e.entries())if(!n(i,t[r]))return!1;return!0}function a(e,t){if(e.size!==t.size)return!1;for(let[r,i]of e.entries())if(!t.has(r)||!n(i,t.get(r)))return!1;return!0}function o(e,t){if(e.size!==t.size)return!1;let r=[...t];for(let t of e){let e=!1;for(let[i,a]of r.entries())if(n(t,a)){e=!0,r.splice(i,1);break}if(!e)return!1}return!0}exports.isDeepEqual=t;
|
|
2
2
|
//# sourceMappingURL=is-deep-equal.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-deep-equal.cjs","names":["curry"],"sources":["../src/is-deep-equal.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Performs a *deep structural* comparison between two values to determine if\n * they are equivalent. For primitive values this is equivalent to `===`, for\n * arrays the check would be performed on every item recursively, in order, and\n * for objects all props will be compared recursively.\n *\n * The built-in Date and RegExp are special-cased and will be compared by their\n * values.\n *\n * !IMPORTANT: TypedArrays and symbol properties of objects are not supported\n * right now and might result in unexpected behavior
|
|
1
|
+
{"version":3,"file":"is-deep-equal.cjs","names":["curry"],"sources":["../src/is-deep-equal.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Performs a *deep structural* comparison between two values to determine if\n * they are equivalent. For primitive values this is equivalent to `===`, for\n * arrays the check would be performed on every item recursively, in order, and\n * for objects all props will be compared recursively.\n *\n * The built-in Date and RegExp are special-cased and will be compared by their\n * values. Objects with a `null` prototype are comparable to plain objects by\n * their enumerable properties.\n *\n * !IMPORTANT: TypedArrays and symbol properties of objects are not supported\n * right now and might result in unexpected behavior.\n *\n * The result would be narrowed to the second value so that the function can be\n * used as a type guard.\n *\n * See:\n * - `isStrictEqual` if you don't need a deep comparison and just want to\n * check for simple (`===`, `Object.is`) equality.\n * - `isShallowEqual` if you need to compare arrays and objects \"by-value\" but\n * don't want to recurse into their values.\n *\n * @param data - The first value to compare.\n * @param other - The second value to compare.\n * @signature\n * isDeepEqual(data, other)\n * @example\n * isDeepEqual(1, 1) //=> true\n * isDeepEqual(1, '1') //=> false\n * isDeepEqual([1, 2, 3], [1, 2, 3]) //=> true\n * @dataFirst\n * @category Guard\n */\nexport function isDeepEqual<T, S extends T>(\n data: T,\n other: T extends Exclude<T, S> ? S : never,\n): data is S;\nexport function isDeepEqual<T>(data: T, other: T): boolean;\n\n/**\n * Performs a *deep structural* comparison between two values to determine if\n * they are equivalent. For primitive values this is equivalent to `===`, for\n * arrays the check would be performed on every item recursively, in order, and\n * for objects all props will be compared recursively.\n *\n * The built-in Date and RegExp are special-cased and will be compared by their\n * values. Objects with a `null` prototype are comparable to plain objects by\n * their enumerable properties.\n *\n * !IMPORTANT: TypedArrays and symbol properties of objects are not supported\n * right now and might result in unexpected behavior.\n *\n * The result would be narrowed to the second value so that the function can be\n * used as a type guard.\n *\n * See:\n * - `isStrictEqual` if you don't need a deep comparison and just want to\n * check for simple (`===`, `Object.is`) equality.\n * - `isShallowEqual` if you need to compare arrays and objects \"by-value\" but\n * don't want to recurse into their values.\n *\n * @param other - The second value to compare.\n * @signature\n * isDeepEqual(other)(data)\n * @example\n * pipe(1, isDeepEqual(1)); //=> true\n * pipe(1, isDeepEqual('1')); //=> false\n * pipe([1, 2, 3], isDeepEqual([1, 2, 3])); //=> true\n * @dataLast\n * @category Guard\n */\nexport function isDeepEqual<T, S extends T>(\n other: T extends Exclude<T, S> ? S : never,\n): (data: T) => data is S;\nexport function isDeepEqual<T>(other: T): (data: T) => boolean;\n\nexport function isDeepEqual(...args: ReadonlyArray<unknown>): unknown {\n return curry(isDeepEqualImplementation, args);\n}\n\nfunction isDeepEqualImplementation<T>(data: unknown, other: T): data is T {\n if (data === other) {\n return true;\n }\n\n if (Object.is(data, other)) {\n // We want to ignore the slight differences between `===` and `Object.is` as\n // both of them largely define equality from a semantic point-of-view.\n return true;\n }\n\n if (typeof data !== 'object' || typeof other !== 'object') {\n return false;\n }\n\n if (data === null || other === null) {\n return false;\n }\n\n if (!isComparablePrototype(data, other)) {\n // If the objects don't share a prototype it's unlikely that they are\n // semantically equal. It is technically possible to build 2 prototypes that\n // act the same but are not equal (at the reference level, checked via\n // `===`) and then create 2 objects that are equal although we would fail on\n // them. Because this is so unlikely, the optimization we gain here for the\n // rest of the function by assuming that `other` is of the same type as\n // `data` is more than worth it.\n return false;\n }\n\n if (Array.isArray(data)) {\n return isDeepEqualArrays(data, other as unknown as ReadonlyArray<unknown>);\n }\n\n if (data instanceof Map) {\n return isDeepEqualMaps(data, other as unknown as Map<unknown, unknown>);\n }\n\n if (data instanceof Set) {\n return isDeepEqualSets(data, other as unknown as Set<unknown>);\n }\n\n if (data instanceof Date) {\n return data.getTime() === (other as unknown as Date).getTime();\n }\n\n if (data instanceof RegExp) {\n return data.toString() === (other as unknown as RegExp).toString();\n }\n\n // At this point we only know that the 2 objects have a comparable prototype and are not\n // any of the previous types. They could be plain objects (Object.prototype),\n // they could be classes, they could be other built-ins, or they could be\n // something weird. We assume that comparing values by keys is enough to judge\n // their equality.\n\n if (Object.keys(data).length !== Object.keys(other).length) {\n return false;\n }\n\n for (const [key, value] of Object.entries(data)) {\n if (!(key in other)) {\n return false;\n }\n\n if (\n !isDeepEqualImplementation(\n value,\n // @ts-expect-error [ts7053] - We already checked that `other` has `key`\n other[key],\n )\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isComparablePrototype(data: object, other: object): boolean {\n const dataPrototype = Object.getPrototypeOf(data);\n const otherPrototype = Object.getPrototypeOf(other);\n\n if (dataPrototype === otherPrototype) {\n return true;\n }\n\n if (dataPrototype === null) {\n return otherPrototype === Object.prototype;\n }\n\n return dataPrototype === Object.prototype && otherPrototype === null;\n}\n\nfunction isDeepEqualArrays(\n data: ReadonlyArray<unknown>,\n other: ReadonlyArray<unknown>,\n): boolean {\n if (data.length !== other.length) {\n return false;\n }\n\n for (const [index, item] of data.entries()) {\n if (!isDeepEqualImplementation(item, other[index])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isDeepEqualMaps(\n data: ReadonlyMap<unknown, unknown>,\n other: ReadonlyMap<unknown, unknown>,\n): boolean {\n if (data.size !== other.size) {\n return false;\n }\n\n for (const [key, value] of data.entries()) {\n if (!other.has(key)) {\n return false;\n }\n\n if (!isDeepEqualImplementation(value, other.get(key))) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isDeepEqualSets(\n data: ReadonlySet<unknown>,\n other: ReadonlySet<unknown>,\n): boolean {\n if (data.size !== other.size) {\n return false;\n }\n\n // To ensure we only count each item once we need to \"remember\" which items of\n // the other set we've already matched against. We do this by creating a copy\n // of the other set and removing items from it as we find them in the data\n // set.\n const otherCopy = [...other];\n\n for (const dataItem of data) {\n let isFound = false;\n\n for (const [index, otherItem] of otherCopy.entries()) {\n if (isDeepEqualImplementation(dataItem, otherItem)) {\n isFound = true;\n otherCopy.splice(index, 1);\n break;\n }\n }\n\n if (!isFound) {\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":"kGA8EA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAOA,EAAAA,MAAM,EAA2B,CAAI,CAC9C,CAEA,SAAS,EAA6B,EAAe,EAAqB,CAKxE,GAJI,IAAS,GAIT,OAAO,GAAG,EAAM,CAAK,EAGvB,MAAO,GAWT,GARI,OAAO,GAAS,UAAY,OAAO,GAAU,UAI7C,IAAS,MAAQ,IAAU,MAI3B,CAAC,EAAsB,EAAM,CAAK,EAQpC,MAAO,GAGT,GAAI,MAAM,QAAQ,CAAI,EACpB,OAAO,EAAkB,EAAM,CAA0C,EAG3E,GAAI,aAAgB,IAClB,OAAO,EAAgB,EAAM,CAAyC,EAGxE,GAAI,aAAgB,IAClB,OAAO,EAAgB,EAAM,CAAgC,EAG/D,GAAI,aAAgB,KAClB,OAAO,EAAK,QAAQ,IAAO,EAA0B,QAAQ,EAG/D,GAAI,aAAgB,OAClB,OAAO,EAAK,SAAS,IAAO,EAA4B,SAAS,EASnE,GAAI,OAAO,KAAK,CAAI,CAAC,CAAC,SAAW,OAAO,KAAK,CAAK,CAAC,CAAC,OAClD,MAAO,GAGT,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAI,EAK5C,GAJI,EAAE,KAAO,IAKX,CAAC,EACC,EAEA,EAAM,EACR,EAEA,MAAO,GAIX,MAAO,EACT,CAEA,SAAS,EAAsB,EAAc,EAAwB,CACnE,IAAM,EAAgB,OAAO,eAAe,CAAI,EAC1C,EAAiB,OAAO,eAAe,CAAK,EAUlD,OARI,IAAkB,EACb,GAGL,IAAkB,KACb,IAAmB,OAAO,UAG5B,IAAkB,OAAO,WAAa,IAAmB,IAClE,CAEA,SAAS,EACP,EACA,EACS,CACT,GAAI,EAAK,SAAW,EAAM,OACxB,MAAO,GAGT,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,QAAQ,EACvC,GAAI,CAAC,EAA0B,EAAM,EAAM,EAAM,EAC/C,MAAO,GAIX,MAAO,EACT,CAEA,SAAS,EACP,EACA,EACS,CACT,GAAI,EAAK,OAAS,EAAM,KACtB,MAAO,GAGT,IAAK,GAAM,CAAC,EAAK,KAAU,EAAK,QAAQ,EAKtC,GAJI,CAAC,EAAM,IAAI,CAAG,GAId,CAAC,EAA0B,EAAO,EAAM,IAAI,CAAG,CAAC,EAClD,MAAO,GAIX,MAAO,EACT,CAEA,SAAS,EACP,EACA,EACS,CACT,GAAI,EAAK,OAAS,EAAM,KACtB,MAAO,GAOT,IAAM,EAAY,CAAC,GAAG,CAAK,EAE3B,IAAK,IAAM,KAAY,EAAM,CAC3B,IAAI,EAAU,GAEd,IAAK,GAAM,CAAC,EAAO,KAAc,EAAU,QAAQ,EACjD,GAAI,EAA0B,EAAU,CAAS,EAAG,CAClD,EAAU,GACV,EAAU,OAAO,EAAO,CAAC,EACzB,KACF,CAGF,GAAI,CAAC,EACH,MAAO,EAEX,CAEA,MAAO,EACT"}
|
package/dist/is-deep-equal.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null
|
|
1
|
+
import{curry as e}from"./curry.js";function t(...t){return e(n,t)}function n(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||!r(e,t))return!1;if(Array.isArray(e))return i(e,t);if(e instanceof Map)return a(e,t);if(e instanceof Set)return o(e,t);if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let[r,i]of Object.entries(e))if(!(r in t)||!n(i,t[r]))return!1;return!0}function r(e,t){let n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t);return n===r?!0:n===null?r===Object.prototype:n===Object.prototype&&r===null}function i(e,t){if(e.length!==t.length)return!1;for(let[r,i]of e.entries())if(!n(i,t[r]))return!1;return!0}function a(e,t){if(e.size!==t.size)return!1;for(let[r,i]of e.entries())if(!t.has(r)||!n(i,t.get(r)))return!1;return!0}function o(e,t){if(e.size!==t.size)return!1;let r=[...t];for(let t of e){let e=!1;for(let[i,a]of r.entries())if(n(t,a)){e=!0,r.splice(i,1);break}if(!e)return!1}return!0}export{t as isDeepEqual};
|
|
2
2
|
//# sourceMappingURL=is-deep-equal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-deep-equal.js","names":[],"sources":["../src/is-deep-equal.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Performs a *deep structural* comparison between two values to determine if\n * they are equivalent. For primitive values this is equivalent to `===`, for\n * arrays the check would be performed on every item recursively, in order, and\n * for objects all props will be compared recursively.\n *\n * The built-in Date and RegExp are special-cased and will be compared by their\n * values.\n *\n * !IMPORTANT: TypedArrays and symbol properties of objects are not supported\n * right now and might result in unexpected behavior
|
|
1
|
+
{"version":3,"file":"is-deep-equal.js","names":[],"sources":["../src/is-deep-equal.ts"],"sourcesContent":["import { curry } from './curry';\n\n/**\n * Performs a *deep structural* comparison between two values to determine if\n * they are equivalent. For primitive values this is equivalent to `===`, for\n * arrays the check would be performed on every item recursively, in order, and\n * for objects all props will be compared recursively.\n *\n * The built-in Date and RegExp are special-cased and will be compared by their\n * values. Objects with a `null` prototype are comparable to plain objects by\n * their enumerable properties.\n *\n * !IMPORTANT: TypedArrays and symbol properties of objects are not supported\n * right now and might result in unexpected behavior.\n *\n * The result would be narrowed to the second value so that the function can be\n * used as a type guard.\n *\n * See:\n * - `isStrictEqual` if you don't need a deep comparison and just want to\n * check for simple (`===`, `Object.is`) equality.\n * - `isShallowEqual` if you need to compare arrays and objects \"by-value\" but\n * don't want to recurse into their values.\n *\n * @param data - The first value to compare.\n * @param other - The second value to compare.\n * @signature\n * isDeepEqual(data, other)\n * @example\n * isDeepEqual(1, 1) //=> true\n * isDeepEqual(1, '1') //=> false\n * isDeepEqual([1, 2, 3], [1, 2, 3]) //=> true\n * @dataFirst\n * @category Guard\n */\nexport function isDeepEqual<T, S extends T>(\n data: T,\n other: T extends Exclude<T, S> ? S : never,\n): data is S;\nexport function isDeepEqual<T>(data: T, other: T): boolean;\n\n/**\n * Performs a *deep structural* comparison between two values to determine if\n * they are equivalent. For primitive values this is equivalent to `===`, for\n * arrays the check would be performed on every item recursively, in order, and\n * for objects all props will be compared recursively.\n *\n * The built-in Date and RegExp are special-cased and will be compared by their\n * values. Objects with a `null` prototype are comparable to plain objects by\n * their enumerable properties.\n *\n * !IMPORTANT: TypedArrays and symbol properties of objects are not supported\n * right now and might result in unexpected behavior.\n *\n * The result would be narrowed to the second value so that the function can be\n * used as a type guard.\n *\n * See:\n * - `isStrictEqual` if you don't need a deep comparison and just want to\n * check for simple (`===`, `Object.is`) equality.\n * - `isShallowEqual` if you need to compare arrays and objects \"by-value\" but\n * don't want to recurse into their values.\n *\n * @param other - The second value to compare.\n * @signature\n * isDeepEqual(other)(data)\n * @example\n * pipe(1, isDeepEqual(1)); //=> true\n * pipe(1, isDeepEqual('1')); //=> false\n * pipe([1, 2, 3], isDeepEqual([1, 2, 3])); //=> true\n * @dataLast\n * @category Guard\n */\nexport function isDeepEqual<T, S extends T>(\n other: T extends Exclude<T, S> ? S : never,\n): (data: T) => data is S;\nexport function isDeepEqual<T>(other: T): (data: T) => boolean;\n\nexport function isDeepEqual(...args: ReadonlyArray<unknown>): unknown {\n return curry(isDeepEqualImplementation, args);\n}\n\nfunction isDeepEqualImplementation<T>(data: unknown, other: T): data is T {\n if (data === other) {\n return true;\n }\n\n if (Object.is(data, other)) {\n // We want to ignore the slight differences between `===` and `Object.is` as\n // both of them largely define equality from a semantic point-of-view.\n return true;\n }\n\n if (typeof data !== 'object' || typeof other !== 'object') {\n return false;\n }\n\n if (data === null || other === null) {\n return false;\n }\n\n if (!isComparablePrototype(data, other)) {\n // If the objects don't share a prototype it's unlikely that they are\n // semantically equal. It is technically possible to build 2 prototypes that\n // act the same but are not equal (at the reference level, checked via\n // `===`) and then create 2 objects that are equal although we would fail on\n // them. Because this is so unlikely, the optimization we gain here for the\n // rest of the function by assuming that `other` is of the same type as\n // `data` is more than worth it.\n return false;\n }\n\n if (Array.isArray(data)) {\n return isDeepEqualArrays(data, other as unknown as ReadonlyArray<unknown>);\n }\n\n if (data instanceof Map) {\n return isDeepEqualMaps(data, other as unknown as Map<unknown, unknown>);\n }\n\n if (data instanceof Set) {\n return isDeepEqualSets(data, other as unknown as Set<unknown>);\n }\n\n if (data instanceof Date) {\n return data.getTime() === (other as unknown as Date).getTime();\n }\n\n if (data instanceof RegExp) {\n return data.toString() === (other as unknown as RegExp).toString();\n }\n\n // At this point we only know that the 2 objects have a comparable prototype and are not\n // any of the previous types. They could be plain objects (Object.prototype),\n // they could be classes, they could be other built-ins, or they could be\n // something weird. We assume that comparing values by keys is enough to judge\n // their equality.\n\n if (Object.keys(data).length !== Object.keys(other).length) {\n return false;\n }\n\n for (const [key, value] of Object.entries(data)) {\n if (!(key in other)) {\n return false;\n }\n\n if (\n !isDeepEqualImplementation(\n value,\n // @ts-expect-error [ts7053] - We already checked that `other` has `key`\n other[key],\n )\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isComparablePrototype(data: object, other: object): boolean {\n const dataPrototype = Object.getPrototypeOf(data);\n const otherPrototype = Object.getPrototypeOf(other);\n\n if (dataPrototype === otherPrototype) {\n return true;\n }\n\n if (dataPrototype === null) {\n return otherPrototype === Object.prototype;\n }\n\n return dataPrototype === Object.prototype && otherPrototype === null;\n}\n\nfunction isDeepEqualArrays(\n data: ReadonlyArray<unknown>,\n other: ReadonlyArray<unknown>,\n): boolean {\n if (data.length !== other.length) {\n return false;\n }\n\n for (const [index, item] of data.entries()) {\n if (!isDeepEqualImplementation(item, other[index])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isDeepEqualMaps(\n data: ReadonlyMap<unknown, unknown>,\n other: ReadonlyMap<unknown, unknown>,\n): boolean {\n if (data.size !== other.size) {\n return false;\n }\n\n for (const [key, value] of data.entries()) {\n if (!other.has(key)) {\n return false;\n }\n\n if (!isDeepEqualImplementation(value, other.get(key))) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isDeepEqualSets(\n data: ReadonlySet<unknown>,\n other: ReadonlySet<unknown>,\n): boolean {\n if (data.size !== other.size) {\n return false;\n }\n\n // To ensure we only count each item once we need to \"remember\" which items of\n // the other set we've already matched against. We do this by creating a copy\n // of the other set and removing items from it as we find them in the data\n // set.\n const otherCopy = [...other];\n\n for (const dataItem of data) {\n let isFound = false;\n\n for (const [index, otherItem] of otherCopy.entries()) {\n if (isDeepEqualImplementation(dataItem, otherItem)) {\n isFound = true;\n otherCopy.splice(index, 1);\n break;\n }\n }\n\n if (!isFound) {\n return false;\n }\n }\n\n return true;\n}\n"],"mappings":"mCA8EA,SAAgB,EAAY,GAAG,EAAuC,CACpE,OAAO,EAAM,EAA2B,CAAI,CAC9C,CAEA,SAAS,EAA6B,EAAe,EAAqB,CAKxE,GAJI,IAAS,GAIT,OAAO,GAAG,EAAM,CAAK,EAGvB,MAAO,GAWT,GARI,OAAO,GAAS,UAAY,OAAO,GAAU,UAI7C,IAAS,MAAQ,IAAU,MAI3B,CAAC,EAAsB,EAAM,CAAK,EAQpC,MAAO,GAGT,GAAI,MAAM,QAAQ,CAAI,EACpB,OAAO,EAAkB,EAAM,CAA0C,EAG3E,GAAI,aAAgB,IAClB,OAAO,EAAgB,EAAM,CAAyC,EAGxE,GAAI,aAAgB,IAClB,OAAO,EAAgB,EAAM,CAAgC,EAG/D,GAAI,aAAgB,KAClB,OAAO,EAAK,QAAQ,IAAO,EAA0B,QAAQ,EAG/D,GAAI,aAAgB,OAClB,OAAO,EAAK,SAAS,IAAO,EAA4B,SAAS,EASnE,GAAI,OAAO,KAAK,CAAI,CAAC,CAAC,SAAW,OAAO,KAAK,CAAK,CAAC,CAAC,OAClD,MAAO,GAGT,IAAK,GAAM,CAAC,EAAK,KAAU,OAAO,QAAQ,CAAI,EAK5C,GAJI,EAAE,KAAO,IAKX,CAAC,EACC,EAEA,EAAM,EACR,EAEA,MAAO,GAIX,MAAO,EACT,CAEA,SAAS,EAAsB,EAAc,EAAwB,CACnE,IAAM,EAAgB,OAAO,eAAe,CAAI,EAC1C,EAAiB,OAAO,eAAe,CAAK,EAUlD,OARI,IAAkB,EACb,GAGL,IAAkB,KACb,IAAmB,OAAO,UAG5B,IAAkB,OAAO,WAAa,IAAmB,IAClE,CAEA,SAAS,EACP,EACA,EACS,CACT,GAAI,EAAK,SAAW,EAAM,OACxB,MAAO,GAGT,IAAK,GAAM,CAAC,EAAO,KAAS,EAAK,QAAQ,EACvC,GAAI,CAAC,EAA0B,EAAM,EAAM,EAAM,EAC/C,MAAO,GAIX,MAAO,EACT,CAEA,SAAS,EACP,EACA,EACS,CACT,GAAI,EAAK,OAAS,EAAM,KACtB,MAAO,GAGT,IAAK,GAAM,CAAC,EAAK,KAAU,EAAK,QAAQ,EAKtC,GAJI,CAAC,EAAM,IAAI,CAAG,GAId,CAAC,EAA0B,EAAO,EAAM,IAAI,CAAG,CAAC,EAClD,MAAO,GAIX,MAAO,EACT,CAEA,SAAS,EACP,EACA,EACS,CACT,GAAI,EAAK,OAAS,EAAM,KACtB,MAAO,GAOT,IAAM,EAAY,CAAC,GAAG,CAAK,EAE3B,IAAK,IAAM,KAAY,EAAM,CAC3B,IAAI,EAAU,GAEd,IAAK,GAAM,CAAC,EAAO,KAAc,EAAU,QAAQ,EACjD,GAAI,EAA0B,EAAU,CAAS,EAAG,CAClD,EAAU,GACV,EAAU,OAAO,EAAO,CAAC,EACzB,KACF,CAGF,GAAI,CAAC,EACH,MAAO,EAEX,CAEA,MAAO,EACT"}
|
package/dist/is-defined.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-defined.cjs","names":[],"sources":["../src/is-defined.ts"],"sourcesContent":["/**\n * A function that checks if the passed parameter is defined (`!== undefined`)\n * and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is defined, false otherwise.\n * @signature\n * isDefined(data)\n * @example\n * isDefined('string') //=> true\n * isDefined(null) //=> true\n * isDefined(undefined) //=> false\n * @category Guard\n */\nexport function isDefined<T>(data: T | undefined): data is T {\n return data !== undefined;\n}\n"],"mappings":"mEAcA,SAAgB,EAAa,EAAgC,CAC3D,OAAO,IAAS,IAAA"}
|
|
1
|
+
{"version":3,"file":"is-defined.cjs","names":[],"sources":["../src/is-defined.ts"],"sourcesContent":["/**\n * A function that checks if the passed parameter is defined (`!== undefined`)\n * and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is defined, false otherwise.\n * @signature\n * isDefined(data)\n * @example\n * isDefined('string') //=> true\n * isDefined(null) //=> true\n * isDefined(undefined) //=> false\n * @category Guard\n */\nexport function isDefined<T>(data: T | undefined): data is T {\n return data !== undefined;\n}\n"],"mappings":"mEAcA,SAAgB,EAAa,EAAgC,CAC3D,OAAO,IAAS,IAAA,EAClB"}
|
package/dist/is-defined.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-defined.js","names":[],"sources":["../src/is-defined.ts"],"sourcesContent":["/**\n * A function that checks if the passed parameter is defined (`!== undefined`)\n * and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is defined, false otherwise.\n * @signature\n * isDefined(data)\n * @example\n * isDefined('string') //=> true\n * isDefined(null) //=> true\n * isDefined(undefined) //=> false\n * @category Guard\n */\nexport function isDefined<T>(data: T | undefined): data is T {\n return data !== undefined;\n}\n"],"mappings":"AAcA,SAAgB,EAAa,EAAgC,CAC3D,OAAO,IAAS,IAAA"}
|
|
1
|
+
{"version":3,"file":"is-defined.js","names":[],"sources":["../src/is-defined.ts"],"sourcesContent":["/**\n * A function that checks if the passed parameter is defined (`!== undefined`)\n * and narrows its type accordingly.\n *\n * @param data - The variable to check.\n * @returns True if the passed input is defined, false otherwise.\n * @signature\n * isDefined(data)\n * @example\n * isDefined('string') //=> true\n * isDefined(null) //=> true\n * isDefined(undefined) //=> false\n * @category Guard\n */\nexport function isDefined<T>(data: T | undefined): data is T {\n return data !== undefined;\n}\n"],"mappings":"AAcA,SAAgB,EAAa,EAAgC,CAC3D,OAAO,IAAS,IAAA,EAClB"}
|
package/dist/is-empty.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-empty.cjs","names":[],"sources":["../src/is-empty.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\n\n/**\n * A function that checks if the passed parameter is empty.\n *\n * This function has *limited* utility at the type level because **negating** it\n * does not yield a useful type in most cases because of TypeScript\n * limitations. Additionally, utilities which accept a narrower input type\n * provide better type-safety on their inputs. In most cases, you should use\n * one of the following functions instead:\n * `isEmptyish` - supports a wider range of cases, accepts any input including nullish values, and does a better job at narrowing the result.\n * `hasAtLeast` - when the input is just an array/tuple.\n * `isStrictEqual` - when you just need to check for a specific literal value.\n * `isNullish` - when you just care about `null` and `undefined`.\n * `isTruthy` - when you need to also filter `number` and `boolean`.\n *\n * @param data - The variable to check.\n * @signature\n * isEmpty(data)\n * @example\n * isEmpty(''); //=> true\n * isEmpty([]); //=> true\n * isEmpty({}); //=> true\n *\n * isEmpty('test'); //=> false\n * isEmpty([1, 2, 3]); //=> false\n * isEmpty({ a: \"hello\" }); //=> false\n *\n * isEmpty(undefined); // Deprecated: use `isEmptyish`\n * @category Guard\n */\nexport function isEmpty(data: IterableContainer): data is [];\nexport function isEmpty<T extends object>(\n data: T,\n): data is Record<keyof T, never>;\nexport function isEmpty<T extends string>(\n data: T,\n): data is '' extends T ? '' : never;\n\n// TODO [>2]: remove this overload once we stop supporting `undefined`.\n\n/**\n * @deprecated Use `isEmptyish` instead!\n */\nexport function isEmpty<T extends string | undefined>(\n data: T,\n): data is\n | ('' extends T ? '' : never)\n | (undefined extends T ? undefined : never);\n\nexport function isEmpty(data: object | string | undefined): boolean {\n if (\n data === ''\n // TODO [>2]: remove `undefined` support! (don't forget to update the jsdoc example too!)\n || data === undefined\n ) {\n return true;\n }\n\n if (Array.isArray(data)) {\n return data.length === 0;\n }\n\n return Object.keys(data).length === 0;\n}\n"],"mappings":"mEAkDA,SAAgB,EAAQ,EAA4C,CAalE,OAXE,IAAS,IAEN,IAAS,IAAA,GAEL,GAGL,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"is-empty.cjs","names":[],"sources":["../src/is-empty.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\n\n/**\n * A function that checks if the passed parameter is empty.\n *\n * This function has *limited* utility at the type level because **negating** it\n * does not yield a useful type in most cases because of TypeScript\n * limitations. Additionally, utilities which accept a narrower input type\n * provide better type-safety on their inputs. In most cases, you should use\n * one of the following functions instead:\n * `isEmptyish` - supports a wider range of cases, accepts any input including nullish values, and does a better job at narrowing the result.\n * `hasAtLeast` - when the input is just an array/tuple.\n * `isStrictEqual` - when you just need to check for a specific literal value.\n * `isNullish` - when you just care about `null` and `undefined`.\n * `isTruthy` - when you need to also filter `number` and `boolean`.\n *\n * @param data - The variable to check.\n * @signature\n * isEmpty(data)\n * @example\n * isEmpty(''); //=> true\n * isEmpty([]); //=> true\n * isEmpty({}); //=> true\n *\n * isEmpty('test'); //=> false\n * isEmpty([1, 2, 3]); //=> false\n * isEmpty({ a: \"hello\" }); //=> false\n *\n * isEmpty(undefined); // Deprecated: use `isEmptyish`\n * @category Guard\n */\nexport function isEmpty(data: IterableContainer): data is [];\nexport function isEmpty<T extends object>(\n data: T,\n): data is Record<keyof T, never>;\nexport function isEmpty<T extends string>(\n data: T,\n): data is '' extends T ? '' : never;\n\n// TODO [>2]: remove this overload once we stop supporting `undefined`.\n\n/**\n * @deprecated Use `isEmptyish` instead!\n */\nexport function isEmpty<T extends string | undefined>(\n data: T,\n): data is\n | ('' extends T ? '' : never)\n | (undefined extends T ? undefined : never);\n\nexport function isEmpty(data: object | string | undefined): boolean {\n if (\n data === ''\n // TODO [>2]: remove `undefined` support! (don't forget to update the jsdoc example too!)\n || data === undefined\n ) {\n return true;\n }\n\n if (Array.isArray(data)) {\n return data.length === 0;\n }\n\n return Object.keys(data).length === 0;\n}\n"],"mappings":"mEAkDA,SAAgB,EAAQ,EAA4C,CAalE,OAXE,IAAS,IAEN,IAAS,IAAA,GAEL,GAGL,MAAM,QAAQ,CAAI,EACb,EAAK,SAAW,EAGlB,OAAO,KAAK,CAAI,CAAC,CAAC,SAAW,CACtC"}
|
package/dist/is-empty.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-empty.js","names":[],"sources":["../src/is-empty.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\n\n/**\n * A function that checks if the passed parameter is empty.\n *\n * This function has *limited* utility at the type level because **negating** it\n * does not yield a useful type in most cases because of TypeScript\n * limitations. Additionally, utilities which accept a narrower input type\n * provide better type-safety on their inputs. In most cases, you should use\n * one of the following functions instead:\n * `isEmptyish` - supports a wider range of cases, accepts any input including nullish values, and does a better job at narrowing the result.\n * `hasAtLeast` - when the input is just an array/tuple.\n * `isStrictEqual` - when you just need to check for a specific literal value.\n * `isNullish` - when you just care about `null` and `undefined`.\n * `isTruthy` - when you need to also filter `number` and `boolean`.\n *\n * @param data - The variable to check.\n * @signature\n * isEmpty(data)\n * @example\n * isEmpty(''); //=> true\n * isEmpty([]); //=> true\n * isEmpty({}); //=> true\n *\n * isEmpty('test'); //=> false\n * isEmpty([1, 2, 3]); //=> false\n * isEmpty({ a: \"hello\" }); //=> false\n *\n * isEmpty(undefined); // Deprecated: use `isEmptyish`\n * @category Guard\n */\nexport function isEmpty(data: IterableContainer): data is [];\nexport function isEmpty<T extends object>(\n data: T,\n): data is Record<keyof T, never>;\nexport function isEmpty<T extends string>(\n data: T,\n): data is '' extends T ? '' : never;\n\n// TODO [>2]: remove this overload once we stop supporting `undefined`.\n\n/**\n * @deprecated Use `isEmptyish` instead!\n */\nexport function isEmpty<T extends string | undefined>(\n data: T,\n): data is\n | ('' extends T ? '' : never)\n | (undefined extends T ? undefined : never);\n\nexport function isEmpty(data: object | string | undefined): boolean {\n if (\n data === ''\n // TODO [>2]: remove `undefined` support! (don't forget to update the jsdoc example too!)\n || data === undefined\n ) {\n return true;\n }\n\n if (Array.isArray(data)) {\n return data.length === 0;\n }\n\n return Object.keys(data).length === 0;\n}\n"],"mappings":"AAkDA,SAAgB,EAAQ,EAA4C,CAalE,OAXE,IAAS,IAEN,IAAS,IAAA,GAEL,GAGL,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"is-empty.js","names":[],"sources":["../src/is-empty.ts"],"sourcesContent":["import type { IterableContainer } from './internal/types/iterable-container';\n\n/**\n * A function that checks if the passed parameter is empty.\n *\n * This function has *limited* utility at the type level because **negating** it\n * does not yield a useful type in most cases because of TypeScript\n * limitations. Additionally, utilities which accept a narrower input type\n * provide better type-safety on their inputs. In most cases, you should use\n * one of the following functions instead:\n * `isEmptyish` - supports a wider range of cases, accepts any input including nullish values, and does a better job at narrowing the result.\n * `hasAtLeast` - when the input is just an array/tuple.\n * `isStrictEqual` - when you just need to check for a specific literal value.\n * `isNullish` - when you just care about `null` and `undefined`.\n * `isTruthy` - when you need to also filter `number` and `boolean`.\n *\n * @param data - The variable to check.\n * @signature\n * isEmpty(data)\n * @example\n * isEmpty(''); //=> true\n * isEmpty([]); //=> true\n * isEmpty({}); //=> true\n *\n * isEmpty('test'); //=> false\n * isEmpty([1, 2, 3]); //=> false\n * isEmpty({ a: \"hello\" }); //=> false\n *\n * isEmpty(undefined); // Deprecated: use `isEmptyish`\n * @category Guard\n */\nexport function isEmpty(data: IterableContainer): data is [];\nexport function isEmpty<T extends object>(\n data: T,\n): data is Record<keyof T, never>;\nexport function isEmpty<T extends string>(\n data: T,\n): data is '' extends T ? '' : never;\n\n// TODO [>2]: remove this overload once we stop supporting `undefined`.\n\n/**\n * @deprecated Use `isEmptyish` instead!\n */\nexport function isEmpty<T extends string | undefined>(\n data: T,\n): data is\n | ('' extends T ? '' : never)\n | (undefined extends T ? undefined : never);\n\nexport function isEmpty(data: object | string | undefined): boolean {\n if (\n data === ''\n // TODO [>2]: remove `undefined` support! (don't forget to update the jsdoc example too!)\n || data === undefined\n ) {\n return true;\n }\n\n if (Array.isArray(data)) {\n return data.length === 0;\n }\n\n return Object.keys(data).length === 0;\n}\n"],"mappings":"AAkDA,SAAgB,EAAQ,EAA4C,CAalE,OAXE,IAAS,IAEN,IAAS,IAAA,GAEL,GAGL,MAAM,QAAQ,CAAI,EACb,EAAK,SAAW,EAGlB,OAAO,KAAK,CAAI,CAAC,CAAC,SAAW,CACtC"}
|
package/dist/is-emptyish.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-emptyish.cjs","names":[],"sources":["../src/is-emptyish.ts"],"sourcesContent":["import type {\n
|
|
1
|
+
{"version":3,"file":"is-emptyish.cjs","names":[],"sources":["../src/is-emptyish.ts"],"sourcesContent":["import type {\n HasRequiredKeys,\n IsAny,\n IsEqual,\n IsNever,\n IsNumericLiteral,\n OmitIndexSignature,\n Tagged,\n ValueOf,\n} from 'type-fest';\nimport type { HasWritableKeys } from './internal/types/has-writable-keys';\nimport type { TupleParts } from './internal/types/tuple-parts';\n\n// eslint-disable-next-line ts/no-unused-vars -- we use a non-exported unique symbol to prevent users from faking our return type.\ndeclare const EMPTYISH_BRAND: unique symbol;\n\n// Because our function is a type-predicate and it narrows the input based on\n// the result of our type, we sometimes need a way to \"turn off\" narrowing while\n// still returning the input type. By tagging/branding our return type we stop\n// TypeScript from narrowing it while still allowing it to be used as if it was\n// the input type (because it still extends the type).\ntype Empty<T> = Tagged<T, typeof EMPTYISH_BRAND>;\n\n// The goal of this type is to return the empty \"view\" of the input type. This\n// makes it possible for TypeScript to narrow it precisely.\ntype Emptyish<T>\n // There are effectively 4 types that can be empty:\n = | (T extends string ? '' : never)\n | (T extends object ? EmptyishObjectLike<T> : never)\n | (T extends null ? null : never)\n | (T extends undefined ? undefined : never);\n\n// Because of TypeScript's duck-typing, a lot of sub-types of `object` can\n// extend each other so we need to cascade between the different \"kinds\" of\n// objects.\ntype EmptyishObjectLike<T extends object> = T extends ReadonlyArray<unknown>\n ? EmptyishArray<T>\n : T extends ReadonlyMap<infer Key, unknown>\n ? T extends Map<unknown, unknown>\n ? // Mutable maps should remain mutable so we can't narrow them down.\n Empty<T>\n : // But immutable maps could be rewritten to prevent any mutations.\n ReadonlyMap<Key, never>\n : T extends ReadonlySet<unknown>\n ? T extends Set<unknown>\n ? // Mutable sets should remain mutable so we can't narrow them down.\n Empty<T>\n : // But immutable sets could be rewritten to prevent any mutations.\n ReadonlySet<never>\n : EmptyishObject<T>;\n\ntype EmptyishArray<T extends ReadonlyArray<unknown>> = T extends readonly []\n ? // By returning T we effectively narrow the \"else\" branch to `never`.\n T\n : TupleParts<T>['required'] extends readonly []\n ? TupleParts<T>['suffix'] extends readonly []\n ? T extends Array<unknown>\n ? // A mutable array should remain mutable so we can't narrow it down.\n Empty<T>\n : // But immutable arrays could be rewritten to prevent any mutations.\n readonly []\n : // An array with a required prefix or suffix would never be empty, we\n // can use that fact to narrow the \"if\" branch to `never`.\n never\n : never;\n\ntype EmptyishObject<T extends object> = T extends {\n length: infer Length extends number;\n}\n ? T extends string\n ? // When a string is tagged/branded it also extends `object` and also has\n // a `length` prop so we need to prevent handling it because it's\n // irrelevant here!\n never\n : // Because of how the implementation works, we need to consider any object\n // with a `length` prop as potentially \"empty\".\n EmptyishArbitrary<T, Length>\n : T extends { size: infer Size extends number }\n ? // Because of how the implementation works, we need to consider any object\n // with a `size` prop as potentially \"empty\".\n EmptyishArbitrary<T, Size>\n : IsNever<ValueOf<T>> extends true\n ? // This handles empty objects; by returning T we effectively narrow the\n // \"else\" branch to `never`.\n T\n : HasRequiredKeys<OmitIndexSignature<T>> extends true\n ? // If the object has required keys it can never be empty, we can use\n // that fact to narrow the \"if\" branch to `never`.\n never\n : HasWritableKeys<T> extends true\n ? // A mutable object should remain mutable so we can't narrow it\n // down.\n Empty<T>\n : // But immutable objects could be rewritten to prevent any\n // mutations.\n { readonly [P in keyof T]: never };\n\n// We use certain props to check for emptiness effectively, but that means we\n// will return those values for any object that has them. Because we don't know\n// anything about those objects we need to be careful about narrowing.\ntype EmptyishArbitrary<T, N>\n = IsNumericLiteral<N> extends true\n ? [0] extends [N]\n ? [N] extends [0]\n ? // If the prop is a literal 0 the object is and always will be empty\n // so we can return it to narrow the \"else\" branch as `never`.\n T\n : // If it accepts 0, but might accept other values too we need to\n // consider the object mutable and not narrow it down.\n Empty<T>\n : // If the prop will never be 0 we can say it will never be empty and can\n // return `never` for the \"if\" branch.\n never\n : // If the prop isn't a literal value we don't know enough about the object\n // and should consider it mutable.\n Empty<T>;\n\n// Overly generic types interfere with our already pretty complex return type.\n// To make our lives easier we can filter them out at the function declaration\n// step and we never need to think about them again.\ntype ShouldNotNarrow<T> = unknown extends T\n ? true\n : IsAny<T> extends true\n ? true\n : IsEqual<\n T,\n // eslint-disable-next-line ts/no-empty-object-type\n {}\n > extends true\n ? true\n : false;\n\n/**\n * A function that checks if the input is empty. Empty is defined as anything\n * exposing a numerical `length`, or `size` property that is equal to `0`. This\n * definition covers strings, arrays, Maps, Sets, plain objects, and custom\n * classes. Additionally, `null` and `undefined` are also considered empty.\n *\n * `number`, `bigint`, `boolean`, `symbol`, and `function` will always return\n * `false`. `RegExp`, `Date`, and weak collections will always return `true`.\n * Classes and Errors are treated as plain objects: if they expose any public\n * property they would be considered non-empty, unless they expose a numerical\n * `length` or `size` property, which defines their emptiness regardless of\n * other properties.\n *\n * This function has *limited* utility at the type level because **negating** it\n * does not yield a useful type in most cases because of TypeScript\n * limitations. Additionally, utilities which accept a narrower input type\n * provide better type-safety on their inputs. In most cases, you should use\n * one of the following functions instead:\n * `isEmpty` - provides better type-safety on inputs by accepting a narrower set of cases.\n * `hasAtLeast` - when the input is just an array/tuple.\n * `isStrictEqual` - when you just need to check for a specific literal value.\n * `isNullish` - when you just care about `null` and `undefined`.\n * `isTruthy` - when you need to also filter `number` and `boolean`.\n *\n * @param data - The variable to check.\n * @signature\n * isEmptyish(data)\n * @example\n * isEmptyish(undefined); //=> true\n * isEmptyish(null); //=> true\n * isEmptyish(''); //=> true\n * isEmptyish([]); //=> true\n * isEmptyish({}); //=> true\n * isEmptyish(new Map()); //=> true\n * isEmptyish(new Set()); //=> true\n * isEmptyish({ a: \"hello\", size: 0 }); //=> true\n * isEmptyish(/abc/); //=> true\n * isEmptyish(new Date()); //=> true\n * isEmptyish(new WeakMap()); //=> true\n *\n * isEmptyish('test'); //=> false\n * isEmptyish([1, 2, 3]); //=> false\n * isEmptyish({ a: \"hello\" }); //=> false\n * isEmptyish({ length: 1 }); //=> false\n * isEmptyish(0); //=> false\n * isEmptyish(true); //=> false\n * isEmptyish(() => {}); //=> false\n * @category Guard\n */\nexport function isEmptyish<T>(\n data: ShouldNotNarrow<T> extends true\n ? never\n : T | Readonly<Emptyish<NoInfer<T>>>,\n): data is ShouldNotNarrow<T> extends true\n ? never\n : T extends unknown\n ? Emptyish<NoInfer<T>>\n : never;\nexport function isEmptyish(data: unknown): boolean;\n\nexport function isEmptyish(data: unknown): boolean {\n // eslint-disable-next-line eqeqeq -- Less code to ship...\n if (data == undefined || data === '') {\n // These are the only literal values that are considered emptyish.\n return true;\n }\n\n if (typeof data !== 'object') {\n // There are no non-object types that could be empty at this point...\n return false;\n }\n\n if ('length' in data && typeof data.length === 'number') {\n // Arrays and array-likes.\n return data.length === 0;\n }\n\n if ('size' in data && typeof data.size === 'number') {\n // Maps and Sets.\n return data.size === 0;\n }\n\n // eslint-disable-next-line no-unreachable-loop, no-restricted-syntax -- Instead of taking Object.keys just to check its length, which will be inefficient if the object has a lot of keys, we have a backdoor into an iterator of the object's properties via the `for...in` loop.\n for (const _ in data) {\n return false;\n }\n\n // We can't do a similar optimization for symbol props, so we leave them for\n // the very last check when the object is practically empty. Assuming that\n // even if an object has a symbol prop, it probably doesn't have thousands of\n // them.\n return Object.getOwnPropertySymbols(data).length === 0;\n}\n"],"mappings":"mEAgMA,SAAgB,EAAW,EAAwB,CAEjD,GAAI,GAAQ,MAAa,IAAS,GAEhC,MAAO,GAGT,GAAI,OAAO,GAAS,SAElB,MAAO,GAGT,GAAI,WAAY,GAAQ,OAAO,EAAK,QAAW,SAE7C,OAAO,EAAK,SAAW,EAGzB,GAAI,SAAU,GAAQ,OAAO,EAAK,MAAS,SAEzC,OAAO,EAAK,OAAS,EAIvB,IAAK,IAAM,KAAK,EACd,MAAO,GAOT,OAAO,OAAO,sBAAsB,CAAI,CAAC,CAAC,SAAW,CACvD"}
|