@vinicunca/perkakas 1.0.2 → 1.0.4
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.d.cts +1 -1
- package/dist/add-prop.d.ts +1 -1
- package/dist/add-prop.spec-d.cjs +1 -0
- package/dist/add-prop.spec-d.d.cts +2 -0
- package/dist/add-prop.spec-d.d.ts +2 -0
- package/dist/add-prop.spec-d.js +1 -0
- package/dist/chunk-2ADWP73S.js +1 -0
- package/dist/chunk-2VLHCBHJ.js +1 -0
- package/dist/chunk-3DFX2FQG.cjs +1 -0
- package/dist/chunk-4WU7JGWS.cjs +1 -0
- package/dist/chunk-AACZ5UGG.cjs +1 -0
- package/dist/chunk-AKGWT6GC.js +1 -0
- package/dist/chunk-BT3FI7L7.js +1 -0
- package/dist/{chunk-XQOKSJ5R.cjs → chunk-E6RBEL5Z.cjs} +1 -1
- package/dist/chunk-EPHUNAE5.js +1 -0
- package/dist/chunk-G7BJFBAZ.cjs +1 -0
- package/dist/{chunk-YIUDV3OA.cjs → chunk-HTO3K3VA.cjs} +1 -1
- package/dist/chunk-HU67VIVI.js +1 -0
- package/dist/chunk-IABWIMQT.js +1 -0
- package/dist/chunk-IRH6TGG5.js +1 -0
- package/dist/chunk-J5PNUDDU.js +1 -0
- package/dist/chunk-KAA6IVBL.js +1 -0
- package/dist/chunk-MADDQNAR.cjs +1 -0
- package/dist/chunk-MZWACWOX.js +1 -0
- package/dist/chunk-OJ2QGTFS.js +1 -0
- package/dist/chunk-PFLGL4YP.js +1 -0
- package/dist/chunk-QHGCU3LJ.js +1 -0
- package/dist/chunk-QTQTKNWA.js +1 -0
- package/dist/chunk-RCENCAXY.cjs +1 -0
- package/dist/chunk-RJAVPEJT.cjs +1 -0
- package/dist/chunk-T7S2RC5M.cjs +1 -0
- package/dist/chunk-TRIZIXDA.cjs +1 -0
- package/dist/chunk-U2BXIRBJ.js +1 -0
- package/dist/chunk-ULMOKABQ.cjs +1 -0
- package/dist/chunk-UVAWCZB6.js +1 -0
- package/dist/chunk-VAUOPMAN.cjs +1 -0
- package/dist/chunk-VN2OAM2N.js +1 -0
- package/dist/chunk-VPG3W5JH.cjs +1 -0
- package/dist/chunk-WQDEYM64.js +1 -0
- package/dist/chunk-WRKGH4XX.js +1 -0
- package/dist/chunk-XSYAC5NV.cjs +1 -0
- package/dist/chunk-Y3WI7FPB.cjs +1 -0
- package/dist/chunk-Z5UEQBZP.cjs +1 -0
- package/dist/chunk-ZJGZ2TEC.cjs +1 -0
- package/dist/chunk-ZO4ND36N.cjs +1 -0
- package/dist/chunk.cjs +1 -1
- package/dist/chunk.d.cts +91 -5
- package/dist/chunk.d.ts +91 -5
- package/dist/chunk.js +1 -1
- package/dist/chunk.spec-d.cjs +1 -0
- package/dist/chunk.spec-d.d.cts +2 -0
- package/dist/chunk.spec-d.d.ts +2 -0
- package/dist/chunk.spec-d.js +1 -0
- package/dist/concat.d.cts +1 -1
- package/dist/concat.d.ts +1 -1
- package/dist/conditional.d.cts +1 -1
- package/dist/conditional.d.ts +1 -1
- package/dist/conditional.spec-d.cjs +1 -0
- package/dist/conditional.spec-d.d.cts +2 -0
- package/dist/conditional.spec-d.d.ts +2 -0
- package/dist/conditional.spec-d.js +1 -0
- package/dist/constant.spec-d.cjs +1 -0
- package/dist/constant.spec-d.d.cts +2 -0
- package/dist/constant.spec-d.d.ts +2 -0
- package/dist/constant.spec-d.js +1 -0
- package/dist/{curry-order-rules-BOMf1JS7.d.cts → curry-order-rules-DETxSzle.d.cts} +1 -1
- package/dist/{curry-order-rules-BOMf1JS7.d.ts → curry-order-rules-DETxSzle.d.ts} +1 -1
- package/dist/debounce.spec-d.cjs +1 -0
- package/dist/debounce.spec-d.d.cts +2 -0
- package/dist/debounce.spec-d.d.ts +2 -0
- package/dist/debounce.spec-d.js +1 -0
- package/dist/do-nothing.spec-d.cjs +1 -0
- package/dist/do-nothing.spec-d.d.cts +2 -0
- package/dist/do-nothing.spec-d.d.ts +2 -0
- package/dist/do-nothing.spec-d.js +1 -0
- package/dist/drop-first-by.d.cts +2 -2
- package/dist/drop-first-by.d.ts +2 -2
- package/dist/drop-last-while.cjs +1 -1
- package/dist/drop-last-while.d.cts +5 -2
- package/dist/drop-last-while.d.ts +5 -2
- package/dist/drop-last-while.js +1 -1
- package/dist/drop-last-while.spec-d.cjs +1 -0
- package/dist/drop-last-while.spec-d.d.cts +2 -0
- package/dist/drop-last-while.spec-d.d.ts +2 -0
- package/dist/drop-last-while.spec-d.js +1 -0
- package/dist/drop-last.cjs +1 -1
- package/dist/drop-last.d.cts +5 -2
- package/dist/drop-last.d.ts +5 -2
- package/dist/drop-last.js +1 -1
- package/dist/drop-last.spec-d.cjs +1 -0
- package/dist/drop-last.spec-d.d.cts +2 -0
- package/dist/drop-last.spec-d.d.ts +2 -0
- package/dist/drop-last.spec-d.js +1 -0
- package/dist/drop-while.cjs +1 -1
- package/dist/drop-while.d.cts +5 -2
- package/dist/drop-while.d.ts +5 -2
- package/dist/drop-while.js +1 -1
- package/dist/drop-while.spec-d.cjs +1 -0
- package/dist/drop-while.spec-d.d.cts +2 -0
- package/dist/drop-while.spec-d.d.ts +2 -0
- package/dist/drop-while.spec-d.js +1 -0
- package/dist/drop.cjs +1 -1
- package/dist/drop.d.cts +10 -2
- package/dist/drop.d.ts +10 -2
- package/dist/drop.js +1 -1
- package/dist/drop.spec-d.cjs +1 -0
- package/dist/drop.spec-d.d.cts +2 -0
- package/dist/drop.spec-d.d.ts +2 -0
- package/dist/drop.spec-d.js +1 -0
- package/dist/entries.spec-d.cjs +1 -0
- package/dist/entries.spec-d.d.cts +2 -0
- package/dist/entries.spec-d.d.ts +2 -0
- package/dist/entries.spec-d.js +1 -0
- package/dist/evolve.d.cts +1 -1
- package/dist/evolve.d.ts +1 -1
- package/dist/evolve.spec-d.cjs +1 -0
- package/dist/evolve.spec-d.d.cts +2 -0
- package/dist/evolve.spec-d.d.ts +2 -0
- package/dist/evolve.spec-d.js +1 -0
- package/dist/filter.spec-d.cjs +1 -0
- package/dist/filter.spec-d.d.cts +2 -0
- package/dist/filter.spec-d.d.ts +2 -0
- package/dist/filter.spec-d.js +1 -0
- package/dist/find.spec-d.cjs +1 -0
- package/dist/find.spec-d.d.cts +2 -0
- package/dist/find.spec-d.d.ts +2 -0
- package/dist/find.spec-d.js +1 -0
- package/dist/first-by.cjs +1 -1
- package/dist/first-by.d.cts +2 -2
- package/dist/first-by.d.ts +2 -2
- package/dist/first-by.js +1 -1
- package/dist/first-by.spec-d.cjs +1 -0
- package/dist/first-by.spec-d.d.cts +2 -0
- package/dist/first-by.spec-d.d.ts +2 -0
- package/dist/first-by.spec-d.js +1 -0
- package/dist/first.d.cts +1 -1
- package/dist/first.d.ts +1 -1
- package/dist/first.spec-d.cjs +1 -0
- package/dist/first.spec-d.d.cts +2 -0
- package/dist/first.spec-d.d.ts +2 -0
- package/dist/first.spec-d.js +1 -0
- package/dist/flat.d.cts +1 -1
- package/dist/flat.d.ts +1 -1
- package/dist/flat.spec-d.cjs +1 -0
- package/dist/flat.spec-d.d.cts +2 -0
- package/dist/flat.spec-d.d.ts +2 -0
- package/dist/flat.spec-d.js +1 -0
- package/dist/for-each-obj.d.cts +1 -1
- package/dist/for-each-obj.d.ts +1 -1
- package/dist/for-each-obj.spec-d.cjs +1 -0
- package/dist/for-each-obj.spec-d.d.cts +2 -0
- package/dist/for-each-obj.spec-d.d.ts +2 -0
- package/dist/for-each-obj.spec-d.js +1 -0
- package/dist/for-each.d.cts +1 -1
- package/dist/for-each.d.ts +1 -1
- package/dist/for-each.spec-d.cjs +1 -0
- package/dist/for-each.spec-d.d.cts +2 -0
- package/dist/for-each.spec-d.d.ts +2 -0
- package/dist/for-each.spec-d.js +1 -0
- package/dist/from-entries.d.cts +1 -1
- package/dist/from-entries.d.ts +1 -1
- package/dist/from-entries.spec-d.cjs +1 -0
- package/dist/from-entries.spec-d.d.cts +2 -0
- package/dist/from-entries.spec-d.d.ts +2 -0
- package/dist/from-entries.spec-d.js +1 -0
- package/dist/from-keys.d.cts +1 -1
- package/dist/from-keys.d.ts +1 -1
- package/dist/from-keys.spec-d.cjs +1 -0
- package/dist/from-keys.spec-d.d.cts +2 -0
- package/dist/from-keys.spec-d.d.ts +2 -0
- package/dist/from-keys.spec-d.js +1 -0
- package/dist/group-by.d.cts +1 -1
- package/dist/group-by.d.ts +1 -1
- package/dist/group-by.spec-d.cjs +1 -0
- package/dist/group-by.spec-d.d.cts +2 -0
- package/dist/group-by.spec-d.d.ts +2 -0
- package/dist/group-by.spec-d.js +1 -0
- package/dist/has-at-least.d.cts +1 -1
- package/dist/has-at-least.d.ts +1 -1
- package/dist/has-at-least.spec-d.cjs +1 -0
- package/dist/has-at-least.spec-d.d.cts +2 -0
- package/dist/has-at-least.spec-d.d.ts +2 -0
- package/dist/has-at-least.spec-d.js +1 -0
- package/dist/has-sub-object.d.cts +1 -1
- package/dist/has-sub-object.d.ts +1 -1
- package/dist/has-sub-object.spec-d.cjs +1 -0
- package/dist/has-sub-object.spec-d.d.cts +2 -0
- package/dist/has-sub-object.spec-d.d.ts +2 -0
- package/dist/has-sub-object.spec-d.js +1 -0
- package/dist/identity.spec-d.cjs +1 -0
- package/dist/identity.spec-d.d.cts +2 -0
- package/dist/identity.spec-d.d.ts +2 -0
- package/dist/identity.spec-d.js +1 -0
- package/dist/index-by.d.cts +1 -1
- package/dist/index-by.d.ts +1 -1
- package/dist/index-by.spec-d.cjs +1 -0
- package/dist/index-by.spec-d.d.cts +2 -0
- package/dist/index-by.spec-d.d.ts +2 -0
- package/dist/index-by.spec-d.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/dist/intersection.spec-d.cjs +1 -0
- package/dist/intersection.spec-d.d.cts +2 -0
- package/dist/intersection.spec-d.d.ts +2 -0
- package/dist/intersection.spec-d.js +1 -0
- package/dist/invert.spec-d.cjs +1 -0
- package/dist/invert.spec-d.d.cts +2 -0
- package/dist/invert.spec-d.d.ts +2 -0
- package/dist/invert.spec-d.js +1 -0
- package/dist/is-array.d.cts +1 -1
- package/dist/is-array.d.ts +1 -1
- package/dist/is-array.spec-d.cjs +1 -0
- package/dist/is-array.spec-d.d.cts +2 -0
- package/dist/is-array.spec-d.d.ts +2 -0
- package/dist/is-array.spec-d.js +1 -0
- package/dist/is-big-int.d.cts +1 -1
- package/dist/is-big-int.d.ts +1 -1
- package/dist/is-big-int.spec-d.cjs +1 -0
- package/dist/is-big-int.spec-d.d.cts +2 -0
- package/dist/is-big-int.spec-d.d.ts +2 -0
- package/dist/is-big-int.spec-d.js +1 -0
- package/dist/is-boolean.d.cts +1 -1
- package/dist/is-boolean.d.ts +1 -1
- package/dist/is-boolean.spec-d.cjs +1 -0
- package/dist/is-boolean.spec-d.d.cts +2 -0
- package/dist/is-boolean.spec-d.d.ts +2 -0
- package/dist/is-boolean.spec-d.js +1 -0
- package/dist/is-date.spec-d.cjs +1 -0
- package/dist/is-date.spec-d.d.cts +2 -0
- package/dist/is-date.spec-d.d.ts +2 -0
- package/dist/is-date.spec-d.js +1 -0
- package/dist/is-deep-equal.d.cts +26 -10
- package/dist/is-deep-equal.d.ts +26 -10
- package/dist/is-deep-equal.spec-d.cjs +1 -0
- package/dist/is-deep-equal.spec-d.d.cts +2 -0
- package/dist/is-deep-equal.spec-d.d.ts +2 -0
- package/dist/is-deep-equal.spec-d.js +1 -0
- package/dist/is-defined.spec-d.cjs +1 -0
- package/dist/is-defined.spec-d.d.cts +2 -0
- package/dist/is-defined.spec-d.d.ts +2 -0
- package/dist/is-defined.spec-d.js +1 -0
- package/dist/is-empty.cjs +1 -1
- package/dist/is-empty.d.cts +1 -1
- package/dist/is-empty.d.ts +1 -1
- package/dist/is-empty.js +1 -1
- package/dist/is-empty.spec-d.cjs +1 -0
- package/dist/is-empty.spec-d.d.cts +2 -0
- package/dist/is-empty.spec-d.d.ts +2 -0
- package/dist/is-empty.spec-d.js +1 -0
- package/dist/is-error.spec-d.cjs +1 -0
- package/dist/is-error.spec-d.d.cts +2 -0
- package/dist/is-error.spec-d.d.ts +2 -0
- package/dist/is-error.spec-d.js +1 -0
- package/dist/is-function.spec-d.cjs +1 -0
- package/dist/is-function.spec-d.d.cts +2 -0
- package/dist/is-function.spec-d.d.ts +2 -0
- package/dist/is-function.spec-d.js +1 -0
- package/dist/is-included-in.d.cts +1 -1
- package/dist/is-included-in.d.ts +1 -1
- package/dist/is-included-in.spec-d.cjs +1 -0
- package/dist/is-included-in.spec-d.d.cts +2 -0
- package/dist/is-included-in.spec-d.d.ts +2 -0
- package/dist/is-included-in.spec-d.js +1 -0
- package/dist/is-non-null.spec-d.cjs +1 -0
- package/dist/is-non-null.spec-d.d.cts +2 -0
- package/dist/is-non-null.spec-d.d.ts +2 -0
- package/dist/is-non-null.spec-d.js +1 -0
- package/dist/is-non-nullish.spec-d.cjs +1 -0
- package/dist/is-non-nullish.spec-d.d.cts +2 -0
- package/dist/is-non-nullish.spec-d.d.ts +2 -0
- package/dist/is-non-nullish.spec-d.js +1 -0
- package/dist/is-not.spec-d.cjs +1 -0
- package/dist/is-not.spec-d.d.cts +2 -0
- package/dist/is-not.spec-d.d.ts +2 -0
- package/dist/is-not.spec-d.js +1 -0
- package/dist/is-nullish.d.cts +1 -1
- package/dist/is-nullish.d.ts +1 -1
- package/dist/is-nullish.spec-d.cjs +1 -0
- package/dist/is-nullish.spec-d.d.cts +2 -0
- package/dist/is-nullish.spec-d.d.ts +2 -0
- package/dist/is-nullish.spec-d.js +1 -0
- package/dist/is-number.d.cts +1 -1
- package/dist/is-number.d.ts +1 -1
- package/dist/is-number.spec-d.cjs +1 -0
- package/dist/is-number.spec-d.d.cts +2 -0
- package/dist/is-number.spec-d.d.ts +2 -0
- package/dist/is-number.spec-d.js +1 -0
- package/dist/is-object-type.d.cts +1 -1
- package/dist/is-object-type.d.ts +1 -1
- package/dist/is-object-type.spec-d.cjs +1 -0
- package/dist/is-object-type.spec-d.d.cts +2 -0
- package/dist/is-object-type.spec-d.d.ts +2 -0
- package/dist/is-object-type.spec-d.js +1 -0
- package/dist/is-plain-object.d.cts +1 -1
- package/dist/is-plain-object.d.ts +1 -1
- package/dist/is-plain-object.spec-d.cjs +1 -0
- package/dist/is-plain-object.spec-d.d.cts +2 -0
- package/dist/is-plain-object.spec-d.d.ts +2 -0
- package/dist/is-plain-object.spec-d.js +1 -0
- package/dist/is-promise.spec-d.cjs +1 -0
- package/dist/is-promise.spec-d.d.cts +2 -0
- package/dist/is-promise.spec-d.d.ts +2 -0
- package/dist/is-promise.spec-d.js +1 -0
- package/dist/is-shallow-equal.cjs +1 -0
- package/dist/is-shallow-equal.d.cts +69 -0
- package/dist/is-shallow-equal.d.ts +69 -0
- package/dist/is-shallow-equal.js +1 -0
- package/dist/is-shallow-equal.spec-d.cjs +1 -0
- package/dist/is-shallow-equal.spec-d.d.cts +2 -0
- package/dist/is-shallow-equal.spec-d.d.ts +2 -0
- package/dist/is-shallow-equal.spec-d.js +1 -0
- package/dist/is-strict-equal.cjs +1 -0
- package/dist/is-strict-equal.d.cts +65 -0
- package/dist/is-strict-equal.d.ts +65 -0
- package/dist/is-strict-equal.js +1 -0
- package/dist/is-strict-equal.spec-d.cjs +1 -0
- package/dist/is-strict-equal.spec-d.d.cts +2 -0
- package/dist/is-strict-equal.spec-d.d.ts +2 -0
- package/dist/is-strict-equal.spec-d.js +1 -0
- package/dist/is-string.d.cts +1 -1
- package/dist/is-string.d.ts +1 -1
- package/dist/is-string.spec-d.cjs +1 -0
- package/dist/is-string.spec-d.d.cts +2 -0
- package/dist/is-string.spec-d.d.ts +2 -0
- package/dist/is-string.spec-d.js +1 -0
- package/dist/is-symbol.d.cts +1 -1
- package/dist/is-symbol.d.ts +1 -1
- package/dist/is-symbol.spec-d.cjs +1 -0
- package/dist/is-symbol.spec-d.d.cts +2 -0
- package/dist/is-symbol.spec-d.d.ts +2 -0
- package/dist/is-symbol.spec-d.js +1 -0
- package/dist/is-truthy.spec-d.cjs +1 -0
- package/dist/is-truthy.spec-d.d.cts +2 -0
- package/dist/is-truthy.spec-d.d.ts +2 -0
- package/dist/is-truthy.spec-d.js +1 -0
- package/dist/join.spec-d.cjs +1 -0
- package/dist/join.spec-d.d.cts +2 -0
- package/dist/join.spec-d.d.ts +2 -0
- package/dist/join.spec-d.js +1 -0
- package/dist/keys.d.cts +1 -1
- package/dist/keys.d.ts +1 -1
- package/dist/keys.spec-d.cjs +1 -0
- package/dist/keys.spec-d.d.cts +2 -0
- package/dist/keys.spec-d.d.ts +2 -0
- package/dist/keys.spec-d.js +1 -0
- package/dist/last.d.cts +1 -1
- package/dist/last.d.ts +1 -1
- package/dist/last.spec-d.cjs +1 -0
- package/dist/last.spec-d.d.cts +2 -0
- package/dist/last.spec-d.d.ts +2 -0
- package/dist/last.spec-d.js +1 -0
- package/dist/map-keys.d.cts +1 -1
- package/dist/map-keys.d.ts +1 -1
- package/dist/map-keys.spec-d.cjs +1 -0
- package/dist/map-keys.spec-d.d.cts +2 -0
- package/dist/map-keys.spec-d.d.ts +2 -0
- package/dist/map-keys.spec-d.js +1 -0
- package/dist/map-values.d.cts +1 -1
- package/dist/map-values.d.ts +1 -1
- package/dist/map-values.spec-d.cjs +1 -0
- package/dist/map-values.spec-d.d.cts +2 -0
- package/dist/map-values.spec-d.d.ts +2 -0
- package/dist/map-values.spec-d.js +1 -0
- package/dist/map-with-feedback.d.cts +1 -1
- package/dist/map-with-feedback.d.ts +1 -1
- package/dist/map-with-feedback.spec-d.cjs +1 -0
- package/dist/map-with-feedback.spec-d.d.cts +2 -0
- package/dist/map-with-feedback.spec-d.d.ts +2 -0
- package/dist/map-with-feedback.spec-d.js +1 -0
- package/dist/map.d.cts +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.spec-d.cjs +1 -0
- package/dist/map.spec-d.d.cts +2 -0
- package/dist/map.spec-d.d.ts +2 -0
- package/dist/map.spec-d.js +1 -0
- package/dist/merge-deep.spec-d.cjs +1 -0
- package/dist/merge-deep.spec-d.d.cts +2 -0
- package/dist/merge-deep.spec-d.d.ts +2 -0
- package/dist/merge-deep.spec-d.js +1 -0
- package/dist/merge.spec-d.cjs +1 -0
- package/dist/merge.spec-d.d.cts +2 -0
- package/dist/merge.spec-d.d.ts +2 -0
- package/dist/merge.spec-d.js +1 -0
- package/dist/nth-by.d.cts +2 -2
- package/dist/nth-by.d.ts +2 -2
- package/dist/nth-by.spec-d.cjs +1 -0
- package/dist/nth-by.spec-d.d.cts +2 -0
- package/dist/nth-by.spec-d.d.ts +2 -0
- package/dist/nth-by.spec-d.js +1 -0
- package/dist/omit-by.d.cts +1 -1
- package/dist/omit-by.d.ts +1 -1
- package/dist/omit-by.spec-d.cjs +1 -0
- package/dist/omit-by.spec-d.d.cts +2 -0
- package/dist/omit-by.spec-d.d.ts +2 -0
- package/dist/omit-by.spec-d.js +1 -0
- package/dist/omit.spec-d.cjs +1 -0
- package/dist/omit.spec-d.d.cts +2 -0
- package/dist/omit.spec-d.d.ts +2 -0
- package/dist/omit.spec-d.js +1 -0
- package/dist/only.d.cts +1 -1
- package/dist/only.d.ts +1 -1
- package/dist/only.spec-d.cjs +1 -0
- package/dist/only.spec-d.d.cts +2 -0
- package/dist/only.spec-d.d.ts +2 -0
- package/dist/only.spec-d.js +1 -0
- package/dist/partition.spec-d.cjs +1 -0
- package/dist/partition.spec-d.d.cts +2 -0
- package/dist/partition.spec-d.d.ts +2 -0
- package/dist/partition.spec-d.js +1 -0
- package/dist/pick-by.d.cts +1 -1
- package/dist/pick-by.d.ts +1 -1
- package/dist/pick-by.spec-d.cjs +1 -0
- package/dist/pick-by.spec-d.d.cts +2 -0
- package/dist/pick-by.spec-d.d.ts +2 -0
- package/dist/pick-by.spec-d.js +1 -0
- package/dist/pick.spec-d.cjs +1 -0
- package/dist/pick.spec-d.d.cts +2 -0
- package/dist/pick.spec-d.d.ts +2 -0
- package/dist/pick.spec-d.js +1 -0
- package/dist/product.d.cts +1 -1
- package/dist/product.d.ts +1 -1
- package/dist/product.spec-d.cjs +1 -0
- package/dist/product.spec-d.d.cts +2 -0
- package/dist/product.spec-d.d.ts +2 -0
- package/dist/product.spec-d.js +1 -0
- package/dist/prop.spec-d.cjs +1 -0
- package/dist/prop.spec-d.d.cts +2 -0
- package/dist/prop.spec-d.d.ts +2 -0
- package/dist/prop.spec-d.js +1 -0
- package/dist/pull-object.d.cts +1 -1
- package/dist/pull-object.d.ts +1 -1
- package/dist/pull-object.spec-d.cjs +1 -0
- package/dist/pull-object.spec-d.d.cts +2 -0
- package/dist/pull-object.spec-d.d.ts +2 -0
- package/dist/pull-object.spec-d.js +1 -0
- package/dist/rank-by.d.cts +2 -2
- package/dist/rank-by.d.ts +2 -2
- package/dist/reverse.spec-d.cjs +1 -0
- package/dist/reverse.spec-d.d.cts +2 -0
- package/dist/reverse.spec-d.d.ts +2 -0
- package/dist/reverse.spec-d.js +1 -0
- package/dist/sample.d.cts +1 -1
- package/dist/sample.d.ts +1 -1
- package/dist/sample.spec-d.cjs +1 -0
- package/dist/sample.spec-d.d.cts +2 -0
- package/dist/sample.spec-d.d.ts +2 -0
- package/dist/sample.spec-d.js +1 -0
- package/dist/set-path.cjs +1 -1
- package/dist/set-path.d.cts +4 -4
- package/dist/set-path.d.ts +4 -4
- package/dist/set-path.js +1 -1
- package/dist/set-path.spec-d.cjs +1 -0
- package/dist/set-path.spec-d.d.cts +2 -0
- package/dist/set-path.spec-d.d.ts +2 -0
- package/dist/set-path.spec-d.js +1 -0
- package/dist/set.d.cts +1 -1
- package/dist/set.d.ts +1 -1
- package/dist/set.spec-d.cjs +1 -0
- package/dist/set.spec-d.d.cts +2 -0
- package/dist/set.spec-d.d.ts +2 -0
- package/dist/set.spec-d.js +1 -0
- package/dist/shuffle.cjs +1 -1
- package/dist/shuffle.d.cts +5 -2
- package/dist/shuffle.d.ts +5 -2
- package/dist/shuffle.js +1 -1
- package/dist/shuffle.spec-d.cjs +1 -0
- package/dist/shuffle.spec-d.d.cts +2 -0
- package/dist/shuffle.spec-d.d.ts +2 -0
- package/dist/shuffle.spec-d.js +1 -0
- package/dist/sort-by.d.cts +2 -2
- package/dist/sort-by.d.ts +2 -2
- package/dist/sort-by.spec-d.cjs +1 -0
- package/dist/sort-by.spec-d.d.cts +2 -0
- package/dist/sort-by.spec-d.d.ts +2 -0
- package/dist/sort-by.spec-d.js +1 -0
- package/dist/sort.d.cts +1 -1
- package/dist/sort.d.ts +1 -1
- package/dist/sort.spec-d.cjs +1 -0
- package/dist/sort.spec-d.d.cts +2 -0
- package/dist/sort.spec-d.d.ts +2 -0
- package/dist/sort.spec-d.js +1 -0
- package/dist/splice.spec-d.cjs +1 -0
- package/dist/splice.spec-d.d.cts +2 -0
- package/dist/splice.spec-d.d.ts +2 -0
- package/dist/splice.spec-d.js +1 -0
- package/dist/split.spec-d.cjs +1 -0
- package/dist/split.spec-d.d.cts +2 -0
- package/dist/split.spec-d.d.ts +2 -0
- package/dist/split.spec-d.js +1 -0
- package/dist/string-to-path.spec-d.cjs +1 -0
- package/dist/string-to-path.spec-d.d.cts +2 -0
- package/dist/string-to-path.spec-d.d.ts +2 -0
- package/dist/string-to-path.spec-d.js +1 -0
- package/dist/sum.d.cts +1 -1
- package/dist/sum.d.ts +1 -1
- package/dist/sum.spec-d.cjs +1 -0
- package/dist/sum.spec-d.d.cts +2 -0
- package/dist/sum.spec-d.d.ts +2 -0
- package/dist/sum.spec-d.js +1 -0
- package/dist/swap-indices.d.cts +1 -1
- package/dist/swap-indices.d.ts +1 -1
- package/dist/swap-props.spec-d.cjs +1 -0
- package/dist/swap-props.spec-d.d.cts +2 -0
- package/dist/swap-props.spec-d.d.ts +2 -0
- package/dist/swap-props.spec-d.js +1 -0
- package/dist/take-first-by.d.cts +2 -2
- package/dist/take-first-by.d.ts +2 -2
- package/dist/take-last-while.cjs +1 -1
- package/dist/take-last-while.d.cts +5 -2
- package/dist/take-last-while.d.ts +5 -2
- package/dist/take-last-while.js +1 -1
- package/dist/take-last-while.spec-d-.cjs +1 -0
- package/dist/take-last-while.spec-d-.d.cts +2 -0
- package/dist/take-last-while.spec-d-.d.ts +2 -0
- package/dist/take-last-while.spec-d-.js +1 -0
- package/dist/take-last.cjs +1 -1
- package/dist/take-last.d.cts +5 -2
- package/dist/take-last.d.ts +5 -2
- package/dist/take-last.js +1 -1
- package/dist/take-last.spec-d.cjs +1 -0
- package/dist/take-last.spec-d.d.cts +2 -0
- package/dist/take-last.spec-d.d.ts +2 -0
- package/dist/take-last.spec-d.js +1 -0
- package/dist/take-while.cjs +1 -1
- package/dist/take-while.d.cts +5 -2
- package/dist/take-while.d.ts +5 -2
- package/dist/take-while.js +1 -1
- package/dist/take-white.spec-d.cjs +1 -0
- package/dist/take-white.spec-d.d.cts +2 -0
- package/dist/take-white.spec-d.d.ts +2 -0
- package/dist/take-white.spec-d.js +1 -0
- package/dist/take.cjs +1 -1
- package/dist/take.d.cts +5 -2
- package/dist/take.d.ts +5 -2
- package/dist/take.js +1 -1
- package/dist/take.spec-d.cjs +1 -0
- package/dist/take.spec-d.d.cts +2 -0
- package/dist/take.spec-d.d.ts +2 -0
- package/dist/take.spec-d.js +1 -0
- package/dist/tap.spec-d.cjs +1 -0
- package/dist/tap.spec-d.d.cts +2 -0
- package/dist/tap.spec-d.d.ts +2 -0
- package/dist/tap.spec-d.js +1 -0
- package/dist/times.cjs +1 -1
- package/dist/times.d.cts +21 -5
- package/dist/times.d.ts +21 -5
- package/dist/times.js +1 -1
- package/dist/times.spec-d.cjs +1 -0
- package/dist/times.spec-d.d.cts +2 -0
- package/dist/times.spec-d.d.ts +2 -0
- package/dist/times.spec-d.js +1 -0
- package/dist/{types-BMu1PIvo.d.cts → types-BE3YOWVA.d.cts} +45 -2
- package/dist/{types-BMu1PIvo.d.ts → types-BE3YOWVA.d.ts} +45 -2
- package/dist/unique-by.cjs +1 -1
- package/dist/unique-by.d.cts +5 -2
- package/dist/unique-by.d.ts +5 -2
- package/dist/unique-by.js +1 -1
- package/dist/unique-with.cjs +1 -1
- package/dist/unique-with.d.cts +5 -2
- package/dist/unique-with.d.ts +5 -2
- package/dist/unique-with.js +1 -1
- package/dist/unique.cjs +1 -1
- package/dist/unique.d.cts +6 -3
- package/dist/unique.d.ts +6 -3
- package/dist/unique.js +1 -1
- package/dist/values.d.cts +1 -1
- package/dist/values.d.ts +1 -1
- package/dist/values.spec-d.cjs +1 -0
- package/dist/values.spec-d.d.cts +2 -0
- package/dist/values.spec-d.d.ts +2 -0
- package/dist/values.spec-d.js +1 -0
- package/dist/zip-with.d.cts +1 -1
- package/dist/zip-with.d.ts +1 -1
- package/dist/zip-with.spec-d.cjs +1 -0
- package/dist/zip-with.spec-d.d.cts +2 -0
- package/dist/zip-with.spec-d.d.ts +2 -0
- package/dist/zip-with.spec-d.js +1 -0
- package/dist/zip.d.cts +1 -1
- package/dist/zip.d.ts +1 -1
- package/dist/zip.spec-d.cjs +1 -0
- package/dist/zip.spec-d.d.cts +2 -0
- package/dist/zip.spec-d.d.ts +2 -0
- package/dist/zip.spec-d.js +1 -0
- package/package.json +17 -16
- package/dist/chunk-3UUZWCRS.cjs +0 -1
- package/dist/chunk-4XRKXTOK.js +0 -1
- package/dist/chunk-65DHT5Z7.cjs +0 -1
- package/dist/chunk-66KQORMS.js +0 -1
- package/dist/chunk-AE5HI6VG.cjs +0 -1
- package/dist/chunk-CIF6WEFP.js +0 -1
- package/dist/chunk-COBRSP66.js +0 -1
- package/dist/chunk-CXRG2GSY.js +0 -1
- package/dist/chunk-DUKQ2ODK.js +0 -1
- package/dist/chunk-DWPHE3F2.cjs +0 -1
- package/dist/chunk-EDKMZBZ3.cjs +0 -1
- package/dist/chunk-HUWRVMPE.js +0 -1
- package/dist/chunk-LIKMH7XD.js +0 -1
- package/dist/chunk-LOPUNSWJ.js +0 -1
- package/dist/chunk-MENOHSYF.js +0 -1
- package/dist/chunk-NNK6R67E.cjs +0 -1
- package/dist/chunk-NNU5DU4F.cjs +0 -1
- package/dist/chunk-NQR6HZYF.js +0 -1
- package/dist/chunk-P7OXTPPH.cjs +0 -1
- package/dist/chunk-QTCQZ7LU.js +0 -1
- package/dist/chunk-RSJJRJTH.cjs +0 -1
- package/dist/chunk-TR5T6KUC.js +0 -1
- package/dist/chunk-U5EQP4BO.cjs +0 -1
- package/dist/chunk-UH3TDC4T.cjs +0 -1
- package/dist/chunk-VNLOBA2B.cjs +0 -1
- package/dist/chunk-X6AB3I7Z.cjs +0 -1
- package/dist/chunk-YQKPA3BB.js +0 -1
- package/dist/chunk-YWSZXRUY.js +0 -1
- package/dist/chunk-Z7EBGO2B.js +0 -1
- package/dist/chunk-ZCFTW5HO.cjs +0 -1
- package/dist/chunk-ZW3IUWYO.js +0 -1
- /package/dist/{chunk-XJRGE7WL.cjs → chunk-DHNCWVVT.cjs} +0 -0
package/dist/take-while.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-VN2OAM2N.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as takeWhile};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZO4ND36Ncjs = require('./chunk-ZO4ND36N.cjs');var _chunkI6VXEY44cjs = require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');var _chunkWLNQOMKLcjs = require('./chunk-WLNQOMKL.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');describe("data-first",()=>{test("empty array",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [1],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [1],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [1,"a"],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [1,"a",!0],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=_chunkZO4ND36Ncjs.a.call(void 0, [],_chunkWLNQOMKLcjs.a.call(void 0, !0));expectTypeOf(e).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1,"a"],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [1,"a",!0],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZO4ND36Ncjs.a.call(void 0, _chunkWLNQOMKLcjs.a.call(void 0, !0)));expectTypeOf(e).toEqualTypeOf()}),describe("predicate is typed correctly",()=>{test("empty array",()=>{_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZO4ND36Ncjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("regular array",()=>{_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZO4ND36Ncjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("regular array with union type",()=>{_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZO4ND36Ncjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("prefix array",()=>{_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkZO4ND36Ncjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("suffix array",()=>{_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkZO4ND36Ncjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("array with suffix and prefix",()=>{_chunkI6VXEY44cjs.a.call(void 0, [1,"a"],_chunkZO4ND36Ncjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("tuple",()=>{_chunkI6VXEY44cjs.a.call(void 0, [1,"a",!0],_chunkZO4ND36Ncjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("union of arrays",()=>{_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZO4ND36Ncjs.a.call(void 0, (e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-VN2OAM2N.js";import{a as t}from"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import{a}from"./chunk-T5XG33UI.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";describe("data-first",()=>{test("empty array",()=>{let e=r([],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=r([],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=r([],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=r([1],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=r([1],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=r([1,"a"],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=r([1,"a",!0],a(!0));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=r([],a(!0));expectTypeOf(e).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let e=t([],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("regular array",()=>{let e=t([],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("regular array with union type",()=>{let e=t([],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("prefix array",()=>{let e=t([1],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("suffix array",()=>{let e=t([1],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let e=t([1,"a"],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("tuple",()=>{let e=t([1,"a",!0],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),test("union of arrays",()=>{let e=t([],r(a(!0)));expectTypeOf(e).toEqualTypeOf()}),describe("predicate is typed correctly",()=>{test("empty array",()=>{t([],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("regular array",()=>{t([],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("regular array with union type",()=>{t([],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("prefix array",()=>{t([1],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("suffix array",()=>{t([1],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("array with suffix and prefix",()=>{t([1,"a"],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("tuple",()=>{t([1,"a",!0],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))}),test("union of arrays",()=>{t([],r((e,u,y)=>(expectTypeOf(e).toEqualTypeOf(),expectTypeOf(u).toEqualTypeOf(),expectTypeOf(y).toEqualTypeOf(),!0)))})})});
|
package/dist/take.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZ5UEQBZPcjs = require('./chunk-Z5UEQBZP.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.take = _chunkZ5UEQBZPcjs.a;
|
package/dist/take.d.cts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { I as IterableContainer } from './types-BE3YOWVA.cjs';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Returns the first `n` elements of `array`.
|
|
3
6
|
*
|
|
@@ -11,7 +14,7 @@
|
|
|
11
14
|
* @lazy
|
|
12
15
|
* @category Array
|
|
13
16
|
*/
|
|
14
|
-
declare function take<T>(array:
|
|
17
|
+
declare function take<T extends IterableContainer>(array: T, n: number): Array<T[number]>;
|
|
15
18
|
/**
|
|
16
19
|
* Returns the first `n` elements of `array`.
|
|
17
20
|
*
|
|
@@ -24,6 +27,6 @@ declare function take<T>(array: ReadonlyArray<T>, n: number): Array<T>;
|
|
|
24
27
|
* @lazy
|
|
25
28
|
* @category Array
|
|
26
29
|
*/
|
|
27
|
-
declare function take
|
|
30
|
+
declare function take(n: number): <T extends IterableContainer>(array: T) => Array<T[number]>;
|
|
28
31
|
|
|
29
32
|
export { take };
|
package/dist/take.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { I as IterableContainer } from './types-BE3YOWVA.js';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Returns the first `n` elements of `array`.
|
|
3
6
|
*
|
|
@@ -11,7 +14,7 @@
|
|
|
11
14
|
* @lazy
|
|
12
15
|
* @category Array
|
|
13
16
|
*/
|
|
14
|
-
declare function take<T>(array:
|
|
17
|
+
declare function take<T extends IterableContainer>(array: T, n: number): Array<T[number]>;
|
|
15
18
|
/**
|
|
16
19
|
* Returns the first `n` elements of `array`.
|
|
17
20
|
*
|
|
@@ -24,6 +27,6 @@ declare function take<T>(array: ReadonlyArray<T>, n: number): Array<T>;
|
|
|
24
27
|
* @lazy
|
|
25
28
|
* @category Array
|
|
26
29
|
*/
|
|
27
|
-
declare function take
|
|
30
|
+
declare function take(n: number): <T extends IterableContainer>(array: T) => Array<T[number]>;
|
|
28
31
|
|
|
29
32
|
export { take };
|
package/dist/take.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-EPHUNAE5.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as take};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkZ5UEQBZPcjs = require('./chunk-Z5UEQBZP.cjs');var _chunkI6VXEY44cjs = require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');describe("data-first",()=>{test("empty array",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [1],2);expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [1],2);expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [1,"a"],2);expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [1,"a",!0],2);expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=_chunkZ5UEQBZPcjs.a.call(void 0, [],2);expectTypeOf(r).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1,"a"],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [1,"a",!0],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=_chunkI6VXEY44cjs.a.call(void 0, [],_chunkZ5UEQBZPcjs.a.call(void 0, 2));expectTypeOf(r).toEqualTypeOf()})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-EPHUNAE5.js";import{a as t}from"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";describe("data-first",()=>{test("empty array",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=e([1],2);expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=e([1],2);expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=e([1,"a"],2);expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=e([1,"a",!0],2);expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=e([],2);expectTypeOf(r).toEqualTypeOf()})});describe("data-last",()=>{test("empty array",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()}),test("regular array",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()}),test("regular array with union type",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()}),test("prefix array",()=>{let r=t([1],e(2));expectTypeOf(r).toEqualTypeOf()}),test("suffix array",()=>{let r=t([1],e(2));expectTypeOf(r).toEqualTypeOf()}),test("array with suffix and prefix",()=>{let r=t([1,"a"],e(2));expectTypeOf(r).toEqualTypeOf()}),test("tuple",()=>{let r=t([1,"a",!0],e(2));expectTypeOf(r).toEqualTypeOf()}),test("union of arrays",()=>{let r=t([],e(2));expectTypeOf(r).toEqualTypeOf()})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkYWO7TFODcjs = require('./chunk-YWO7TFOD.cjs');var _chunkKLQZU5J4cjs = require('./chunk-KLQZU5J4.cjs');var _chunkWW7P3TAUcjs = require('./chunk-WW7P3TAU.cjs');var _chunk7IYJC2PMcjs = require('./chunk-7IYJC2PM.cjs');var _chunkI6VXEY44cjs = require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');it("should work in the middle of pipe sequence",()=>{_chunkI6VXEY44cjs.a.call(void 0, [-1,2],_chunk7IYJC2PMcjs.a.call(void 0, e=>e>0),_chunkYWO7TFODcjs.a.call(void 0, e=>{expectTypeOf(e).toEqualTypeOf()}),_chunkWW7P3TAUcjs.a.call(void 0, _chunkKLQZU5J4cjs.a.call(void 0, 2)))});it("should infer types after tapping function reference with parameter type any",()=>{_chunkI6VXEY44cjs.a.call(void 0, [-1,2],_chunk7IYJC2PMcjs.a.call(void 0, e=>e>0),_chunkYWO7TFODcjs.a.call(void 0, i),_chunkWW7P3TAUcjs.a.call(void 0, e=>(expectTypeOf(e).toEqualTypeOf(),e*2)))});function i(e){return e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-ENIRKKU6.js";import{a as n}from"./chunk-MBYBX5B3.js";import{a as t}from"./chunk-QRDGUNHT.js";import{a as p}from"./chunk-BGPRJNRQ.js";import{a as r}from"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";it("should work in the middle of pipe sequence",()=>{r([-1,2],p(e=>e>0),o(e=>{expectTypeOf(e).toEqualTypeOf()}),t(n(2)))});it("should infer types after tapping function reference with parameter type any",()=>{r([-1,2],p(e=>e>0),o(i),t(e=>(expectTypeOf(e).toEqualTypeOf(),e*2)))});function i(e){return e}
|
package/dist/times.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXSYAC5NVcjs = require('./chunk-XSYAC5NV.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');exports.times = _chunkXSYAC5NVcjs.a;
|
package/dist/times.d.cts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import { GreaterThan } from 'type-fest';
|
|
2
|
+
|
|
3
|
+
type MAX_LITERAL_SIZE = 46;
|
|
4
|
+
type TimesArray<T, N extends number, Iteration extends ReadonlyArray<unknown> = []> = number extends N ? Array<T> : `${N}` extends `-${number}` ? [
|
|
5
|
+
] : `${N}` extends `${infer K extends number}.${number}` ? TimesArray<T, K, Iteration> : GreaterThan<N, MAX_LITERAL_SIZE> extends true ? [
|
|
6
|
+
...TimesArray<T, MAX_LITERAL_SIZE, Iteration>,
|
|
7
|
+
...Array<T>
|
|
8
|
+
] : N extends Iteration['length'] ? [
|
|
9
|
+
] : [
|
|
10
|
+
T,
|
|
11
|
+
...TimesArray<T, N, [unknown, ...Iteration]>
|
|
12
|
+
];
|
|
1
13
|
/**
|
|
2
14
|
* Calls an input function `n` times, returning an array containing the results
|
|
3
15
|
* of those function calls.
|
|
@@ -5,8 +17,10 @@
|
|
|
5
17
|
* `fn` is passed one argument: The current value of `n`, which begins at `0`
|
|
6
18
|
* and is gradually incremented to `n - 1`.
|
|
7
19
|
*
|
|
8
|
-
* @param count - A value between `0` and `n - 1`. Increments after each
|
|
9
|
-
*
|
|
20
|
+
* @param count - A value between `0` and `n - 1`. Increments after each
|
|
21
|
+
* function call.
|
|
22
|
+
* @param fn - The function to invoke. Passed one argument, the current value of
|
|
23
|
+
* `n`.
|
|
10
24
|
* @signature
|
|
11
25
|
* P.times(count, fn)
|
|
12
26
|
* @example
|
|
@@ -15,7 +29,7 @@
|
|
|
15
29
|
* @dataFirst
|
|
16
30
|
* @category Array
|
|
17
31
|
*/
|
|
18
|
-
declare function times<T>(count:
|
|
32
|
+
declare function times<T, N extends number>(count: N, fn: (index: number) => T): TimesArray<T, N>;
|
|
19
33
|
/**
|
|
20
34
|
* Calls an input function `n` times, returning an array containing the results
|
|
21
35
|
* of those function calls.
|
|
@@ -23,7 +37,9 @@ declare function times<T>(count: number, fn: (n: number) => T): Array<T>;
|
|
|
23
37
|
* `fn` is passed one argument: The current value of `n`, which begins at `0`
|
|
24
38
|
* and is gradually incremented to `n - 1`.
|
|
25
39
|
*
|
|
26
|
-
* @param fn - The function to invoke. Passed one argument, the current value of
|
|
40
|
+
* @param fn - The function to invoke. Passed one argument, the current value of
|
|
41
|
+
* `n`.
|
|
42
|
+
* @returns An array containing the return values of all calls to `fn`.
|
|
27
43
|
*
|
|
28
44
|
* @signature
|
|
29
45
|
* P.times(count, fn)
|
|
@@ -33,6 +49,6 @@ declare function times<T>(count: number, fn: (n: number) => T): Array<T>;
|
|
|
33
49
|
* @dataLast
|
|
34
50
|
* @category Array
|
|
35
51
|
*/
|
|
36
|
-
declare function times<T>(fn: (
|
|
52
|
+
declare function times<T>(fn: (index: number) => T): <N extends number>(count: N) => TimesArray<T, N>;
|
|
37
53
|
|
|
38
54
|
export { times };
|
package/dist/times.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import { GreaterThan } from 'type-fest';
|
|
2
|
+
|
|
3
|
+
type MAX_LITERAL_SIZE = 46;
|
|
4
|
+
type TimesArray<T, N extends number, Iteration extends ReadonlyArray<unknown> = []> = number extends N ? Array<T> : `${N}` extends `-${number}` ? [
|
|
5
|
+
] : `${N}` extends `${infer K extends number}.${number}` ? TimesArray<T, K, Iteration> : GreaterThan<N, MAX_LITERAL_SIZE> extends true ? [
|
|
6
|
+
...TimesArray<T, MAX_LITERAL_SIZE, Iteration>,
|
|
7
|
+
...Array<T>
|
|
8
|
+
] : N extends Iteration['length'] ? [
|
|
9
|
+
] : [
|
|
10
|
+
T,
|
|
11
|
+
...TimesArray<T, N, [unknown, ...Iteration]>
|
|
12
|
+
];
|
|
1
13
|
/**
|
|
2
14
|
* Calls an input function `n` times, returning an array containing the results
|
|
3
15
|
* of those function calls.
|
|
@@ -5,8 +17,10 @@
|
|
|
5
17
|
* `fn` is passed one argument: The current value of `n`, which begins at `0`
|
|
6
18
|
* and is gradually incremented to `n - 1`.
|
|
7
19
|
*
|
|
8
|
-
* @param count - A value between `0` and `n - 1`. Increments after each
|
|
9
|
-
*
|
|
20
|
+
* @param count - A value between `0` and `n - 1`. Increments after each
|
|
21
|
+
* function call.
|
|
22
|
+
* @param fn - The function to invoke. Passed one argument, the current value of
|
|
23
|
+
* `n`.
|
|
10
24
|
* @signature
|
|
11
25
|
* P.times(count, fn)
|
|
12
26
|
* @example
|
|
@@ -15,7 +29,7 @@
|
|
|
15
29
|
* @dataFirst
|
|
16
30
|
* @category Array
|
|
17
31
|
*/
|
|
18
|
-
declare function times<T>(count:
|
|
32
|
+
declare function times<T, N extends number>(count: N, fn: (index: number) => T): TimesArray<T, N>;
|
|
19
33
|
/**
|
|
20
34
|
* Calls an input function `n` times, returning an array containing the results
|
|
21
35
|
* of those function calls.
|
|
@@ -23,7 +37,9 @@ declare function times<T>(count: number, fn: (n: number) => T): Array<T>;
|
|
|
23
37
|
* `fn` is passed one argument: The current value of `n`, which begins at `0`
|
|
24
38
|
* and is gradually incremented to `n - 1`.
|
|
25
39
|
*
|
|
26
|
-
* @param fn - The function to invoke. Passed one argument, the current value of
|
|
40
|
+
* @param fn - The function to invoke. Passed one argument, the current value of
|
|
41
|
+
* `n`.
|
|
42
|
+
* @returns An array containing the return values of all calls to `fn`.
|
|
27
43
|
*
|
|
28
44
|
* @signature
|
|
29
45
|
* P.times(count, fn)
|
|
@@ -33,6 +49,6 @@ declare function times<T>(count: number, fn: (n: number) => T): Array<T>;
|
|
|
33
49
|
* @dataLast
|
|
34
50
|
* @category Array
|
|
35
51
|
*/
|
|
36
|
-
declare function times<T>(fn: (
|
|
52
|
+
declare function times<T>(fn: (index: number) => T): <N extends number>(count: N) => TimesArray<T, N>;
|
|
37
53
|
|
|
38
54
|
export { times };
|
package/dist/times.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-MZWACWOX.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";export{a as times};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunkXSYAC5NVcjs = require('./chunk-XSYAC5NV.cjs');var _chunkMLLA7SGZcjs = require('./chunk-MLLA7SGZ.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');it("works with 0",()=>{let e=_chunkXSYAC5NVcjs.a.call(void 0, 0,_chunkMLLA7SGZcjs.a.call(void 0, ));expectTypeOf(e).toEqualTypeOf()});it("works with non-literals",()=>{let e=_chunkXSYAC5NVcjs.a.call(void 0, 10,_chunkMLLA7SGZcjs.a.call(void 0, ));expectTypeOf(e).toEqualTypeOf()});it("works with positive integer literals",()=>{let e=_chunkXSYAC5NVcjs.a.call(void 0, 10,_chunkMLLA7SGZcjs.a.call(void 0, ));expectTypeOf(e).toEqualTypeOf()});it("works with negative integers",()=>{let e=_chunkXSYAC5NVcjs.a.call(void 0, -10,_chunkMLLA7SGZcjs.a.call(void 0, ));expectTypeOf(e).toEqualTypeOf()});it("works with non-integer positive literals",()=>{let e=_chunkXSYAC5NVcjs.a.call(void 0, 10.5,_chunkMLLA7SGZcjs.a.call(void 0, ));expectTypeOf(e).toEqualTypeOf()});it("works with non-integer negative literals",()=>{let e=_chunkXSYAC5NVcjs.a.call(void 0, -10.5,_chunkMLLA7SGZcjs.a.call(void 0, ));expectTypeOf(e).toEqualTypeOf()});it("works with literal unions",()=>{let e=_chunkXSYAC5NVcjs.a.call(void 0, 1,_chunkMLLA7SGZcjs.a.call(void 0, ));expectTypeOf(e).toEqualTypeOf()});it("could be 'disabled' with large literals",()=>{let e=_chunkXSYAC5NVcjs.a.call(void 0, 1e4,_chunkMLLA7SGZcjs.a.call(void 0, ));expectTypeOf(e).toMatchTypeOf(),expectTypeOf(e[0]).toEqualTypeOf(),expectTypeOf(e[45]).toEqualTypeOf(),expectTypeOf(e[56]).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-MZWACWOX.js";import{a as t}from"./chunk-WUAU3LTQ.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";it("works with 0",()=>{let e=r(0,t());expectTypeOf(e).toEqualTypeOf()});it("works with non-literals",()=>{let e=r(10,t());expectTypeOf(e).toEqualTypeOf()});it("works with positive integer literals",()=>{let e=r(10,t());expectTypeOf(e).toEqualTypeOf()});it("works with negative integers",()=>{let e=r(-10,t());expectTypeOf(e).toEqualTypeOf()});it("works with non-integer positive literals",()=>{let e=r(10.5,t());expectTypeOf(e).toEqualTypeOf()});it("works with non-integer negative literals",()=>{let e=r(-10.5,t());expectTypeOf(e).toEqualTypeOf()});it("works with literal unions",()=>{let e=r(1,t());expectTypeOf(e).toEqualTypeOf()});it("could be 'disabled' with large literals",()=>{let e=r(1e4,t());expectTypeOf(e).toMatchTypeOf(),expectTypeOf(e[0]).toEqualTypeOf(),expectTypeOf(e[45]).toEqualTypeOf(),expectTypeOf(e[56]).toEqualTypeOf()});
|
|
@@ -19,7 +19,7 @@ type Mapped<T extends IterableContainer, K> = {
|
|
|
19
19
|
* We would've named this `ArrayLike`, but that's already used by typescript...
|
|
20
20
|
* @see This was inspired by the type-definition of Promise.all (https://github.com/microsoft/TypeScript/blob/1df5717b120cddd325deab8b0f2b2c3eecaf2b01/src/lib/es2015.promise.d.ts#L21)
|
|
21
21
|
*/
|
|
22
|
-
type IterableContainer<T = unknown> =
|
|
22
|
+
type IterableContainer<T = unknown> = readonly [] | ReadonlyArray<T>;
|
|
23
23
|
/**
|
|
24
24
|
* Check if a type is guaranteed to be a bounded record: a record with a finite
|
|
25
25
|
* set of keys.
|
|
@@ -111,5 +111,48 @@ type InternalIsUnion<T, U = T> = (IsNever<T> extends true ? false : T extends an
|
|
|
111
111
|
* type Result = GuardType<TypeGuardFn>; // `string`
|
|
112
112
|
*/
|
|
113
113
|
type GuardType<T, Fallback = never> = T extends (x: any, ...rest: any) => x is infer U ? U : Fallback;
|
|
114
|
+
/**
|
|
115
|
+
* An array with *exactly* N elements in it.
|
|
116
|
+
*
|
|
117
|
+
* Only literal N values are supported. For very large N the type might result
|
|
118
|
+
* in a recurse depth error. For negative N the type would result in an infinite
|
|
119
|
+
* recursion. None of these have protections because this is an internal type!
|
|
120
|
+
*/
|
|
121
|
+
type NTuple<T, N extends number, Result extends Array<unknown> = []> = Result['length'] extends N ? Result : NTuple<T, N, [...Result, T]>;
|
|
122
|
+
/**
|
|
123
|
+
* Takes an array and returns the types that make up it's parts. The suffix is
|
|
124
|
+
* anything before the rest parameter (if any), the prefix is anything after the
|
|
125
|
+
* rest parameter (if any), and the item is the type of the rest parameter.
|
|
126
|
+
*
|
|
127
|
+
* The output could be used to reconstruct the input: `[
|
|
128
|
+
* ...TupleParts<T>["prefix"],
|
|
129
|
+
* ...Array<TupleParts<T>["item"]>,
|
|
130
|
+
* ...TupleParts<T>["suffix"],
|
|
131
|
+
* ]`.
|
|
132
|
+
*/
|
|
133
|
+
type TupleParts<T, Prefix extends Array<unknown> = [], Suffix extends Array<unknown> = []> = T extends readonly [infer Head, ...infer Tail] ? TupleParts<Tail, [...Prefix, Head], Suffix> : T extends readonly [...infer Head, infer Tail] ? TupleParts<Head, Prefix, [Tail, ...Suffix]> : T extends ReadonlyArray<infer Item> ? {
|
|
134
|
+
prefix: Prefix;
|
|
135
|
+
item: Item;
|
|
136
|
+
suffix: Suffix;
|
|
137
|
+
} : never;
|
|
138
|
+
/**
|
|
139
|
+
* The result of running a function that would dedupe an array (`unique`,
|
|
140
|
+
* `uniqueBy`, and `uniqueWith`).
|
|
141
|
+
*
|
|
142
|
+
* There are certain traits of the output which are unique to a deduped array
|
|
143
|
+
* that allow us to create a better type; see comments inline.
|
|
144
|
+
*
|
|
145
|
+
* !Note: We can build better types for each of the unique functions
|
|
146
|
+
* _separately_ by taking advantage of _other_ characteristics that are unique
|
|
147
|
+
* to each one (e.g. in `unique` we know that each item that has a disjoint type
|
|
148
|
+
* to all previous items would be part of the output, even when it isn't the
|
|
149
|
+
* first), but to make this utility the most useful we kept it simple and
|
|
150
|
+
* generic for now.
|
|
151
|
+
*/
|
|
152
|
+
type Deduped<T extends IterableContainer> = T extends readonly [] ? [
|
|
153
|
+
] : T extends readonly [infer Head, ...infer Rest] ? [
|
|
154
|
+
Head,
|
|
155
|
+
...Array<Rest[number]>
|
|
156
|
+
] : T extends readonly [...Array<unknown>, unknown] ? NonEmptyArray<T[number]> : Array<T[number]>;
|
|
114
157
|
|
|
115
|
-
export type { Branded as B, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M,
|
|
158
|
+
export type { Branded as B, Deduped as D, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M, NTuple as N, ReconstructedRecord as R, TupleParts as T, UpsertProp as U, NonEmptyArray as a, EnumerableStringKeyOf as b, ExactRecord as c, NarrowedTo as d, IsUnion as e, IfBoundedRecord as f, ReorderedArray as g };
|
|
@@ -19,7 +19,7 @@ type Mapped<T extends IterableContainer, K> = {
|
|
|
19
19
|
* We would've named this `ArrayLike`, but that's already used by typescript...
|
|
20
20
|
* @see This was inspired by the type-definition of Promise.all (https://github.com/microsoft/TypeScript/blob/1df5717b120cddd325deab8b0f2b2c3eecaf2b01/src/lib/es2015.promise.d.ts#L21)
|
|
21
21
|
*/
|
|
22
|
-
type IterableContainer<T = unknown> =
|
|
22
|
+
type IterableContainer<T = unknown> = readonly [] | ReadonlyArray<T>;
|
|
23
23
|
/**
|
|
24
24
|
* Check if a type is guaranteed to be a bounded record: a record with a finite
|
|
25
25
|
* set of keys.
|
|
@@ -111,5 +111,48 @@ type InternalIsUnion<T, U = T> = (IsNever<T> extends true ? false : T extends an
|
|
|
111
111
|
* type Result = GuardType<TypeGuardFn>; // `string`
|
|
112
112
|
*/
|
|
113
113
|
type GuardType<T, Fallback = never> = T extends (x: any, ...rest: any) => x is infer U ? U : Fallback;
|
|
114
|
+
/**
|
|
115
|
+
* An array with *exactly* N elements in it.
|
|
116
|
+
*
|
|
117
|
+
* Only literal N values are supported. For very large N the type might result
|
|
118
|
+
* in a recurse depth error. For negative N the type would result in an infinite
|
|
119
|
+
* recursion. None of these have protections because this is an internal type!
|
|
120
|
+
*/
|
|
121
|
+
type NTuple<T, N extends number, Result extends Array<unknown> = []> = Result['length'] extends N ? Result : NTuple<T, N, [...Result, T]>;
|
|
122
|
+
/**
|
|
123
|
+
* Takes an array and returns the types that make up it's parts. The suffix is
|
|
124
|
+
* anything before the rest parameter (if any), the prefix is anything after the
|
|
125
|
+
* rest parameter (if any), and the item is the type of the rest parameter.
|
|
126
|
+
*
|
|
127
|
+
* The output could be used to reconstruct the input: `[
|
|
128
|
+
* ...TupleParts<T>["prefix"],
|
|
129
|
+
* ...Array<TupleParts<T>["item"]>,
|
|
130
|
+
* ...TupleParts<T>["suffix"],
|
|
131
|
+
* ]`.
|
|
132
|
+
*/
|
|
133
|
+
type TupleParts<T, Prefix extends Array<unknown> = [], Suffix extends Array<unknown> = []> = T extends readonly [infer Head, ...infer Tail] ? TupleParts<Tail, [...Prefix, Head], Suffix> : T extends readonly [...infer Head, infer Tail] ? TupleParts<Head, Prefix, [Tail, ...Suffix]> : T extends ReadonlyArray<infer Item> ? {
|
|
134
|
+
prefix: Prefix;
|
|
135
|
+
item: Item;
|
|
136
|
+
suffix: Suffix;
|
|
137
|
+
} : never;
|
|
138
|
+
/**
|
|
139
|
+
* The result of running a function that would dedupe an array (`unique`,
|
|
140
|
+
* `uniqueBy`, and `uniqueWith`).
|
|
141
|
+
*
|
|
142
|
+
* There are certain traits of the output which are unique to a deduped array
|
|
143
|
+
* that allow us to create a better type; see comments inline.
|
|
144
|
+
*
|
|
145
|
+
* !Note: We can build better types for each of the unique functions
|
|
146
|
+
* _separately_ by taking advantage of _other_ characteristics that are unique
|
|
147
|
+
* to each one (e.g. in `unique` we know that each item that has a disjoint type
|
|
148
|
+
* to all previous items would be part of the output, even when it isn't the
|
|
149
|
+
* first), but to make this utility the most useful we kept it simple and
|
|
150
|
+
* generic for now.
|
|
151
|
+
*/
|
|
152
|
+
type Deduped<T extends IterableContainer> = T extends readonly [] ? [
|
|
153
|
+
] : T extends readonly [infer Head, ...infer Rest] ? [
|
|
154
|
+
Head,
|
|
155
|
+
...Array<Rest[number]>
|
|
156
|
+
] : T extends readonly [...Array<unknown>, unknown] ? NonEmptyArray<T[number]> : Array<T[number]>;
|
|
114
157
|
|
|
115
|
-
export type { Branded as B, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M,
|
|
158
|
+
export type { Branded as B, Deduped as D, EnumerableStringKeyedValueOf as E, GuardType as G, IterableContainer as I, Mapped as M, NTuple as N, ReconstructedRecord as R, TupleParts as T, UpsertProp as U, NonEmptyArray as a, EnumerableStringKeyOf as b, ExactRecord as c, NarrowedTo as d, IsUnion as e, IfBoundedRecord as f, ReorderedArray as g };
|
package/dist/unique-by.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMADDQNARcjs = require('./chunk-MADDQNAR.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');exports.uniqueBy = _chunkMADDQNARcjs.a;
|
package/dist/unique-by.d.cts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.cjs';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Returns a new array containing only one copy of each element in the original
|
|
3
6
|
* list transformed by a function. Elements are compared by reference using Set.
|
|
@@ -15,7 +18,7 @@
|
|
|
15
18
|
* @lazy
|
|
16
19
|
* @category Array
|
|
17
20
|
*/
|
|
18
|
-
declare function uniqueBy<T, K>(data:
|
|
21
|
+
declare function uniqueBy<T extends IterableContainer, K>(data: T, keyFunction: (item: T[number], index: number, data: T) => K): Deduped<T>;
|
|
19
22
|
/**
|
|
20
23
|
* Returns a new array containing only one copy of each element in the original
|
|
21
24
|
* list transformed by a function. Elements are compared by reference using Set.
|
|
@@ -33,6 +36,6 @@ declare function uniqueBy<T, K>(data: ReadonlyArray<T>, keyFunction: (item: T, i
|
|
|
33
36
|
* @lazy
|
|
34
37
|
* @category Array
|
|
35
38
|
*/
|
|
36
|
-
declare function uniqueBy<T, K>(keyFunction: (item: T, index: number, data:
|
|
39
|
+
declare function uniqueBy<T extends IterableContainer, K>(keyFunction: (item: T[number], index: number, data: T) => K): (data: T) => Deduped<T>;
|
|
37
40
|
|
|
38
41
|
export { uniqueBy };
|
package/dist/unique-by.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.js';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Returns a new array containing only one copy of each element in the original
|
|
3
6
|
* list transformed by a function. Elements are compared by reference using Set.
|
|
@@ -15,7 +18,7 @@
|
|
|
15
18
|
* @lazy
|
|
16
19
|
* @category Array
|
|
17
20
|
*/
|
|
18
|
-
declare function uniqueBy<T, K>(data:
|
|
21
|
+
declare function uniqueBy<T extends IterableContainer, K>(data: T, keyFunction: (item: T[number], index: number, data: T) => K): Deduped<T>;
|
|
19
22
|
/**
|
|
20
23
|
* Returns a new array containing only one copy of each element in the original
|
|
21
24
|
* list transformed by a function. Elements are compared by reference using Set.
|
|
@@ -33,6 +36,6 @@ declare function uniqueBy<T, K>(data: ReadonlyArray<T>, keyFunction: (item: T, i
|
|
|
33
36
|
* @lazy
|
|
34
37
|
* @category Array
|
|
35
38
|
*/
|
|
36
|
-
declare function uniqueBy<T, K>(keyFunction: (item: T, index: number, data:
|
|
39
|
+
declare function uniqueBy<T extends IterableContainer, K>(keyFunction: (item: T[number], index: number, data: T) => K): (data: T) => Deduped<T>;
|
|
37
40
|
|
|
38
41
|
export { uniqueBy };
|
package/dist/unique-by.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-WRKGH4XX.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";export{a as uniqueBy};
|
package/dist/unique-with.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RBEL5Zcjs = require('./chunk-E6RBEL5Z.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');exports.uniqueWith = _chunkE6RBEL5Zcjs.a;
|
package/dist/unique-with.d.cts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.cjs';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
type IsEquals<T> = (a: T, b: T) => boolean;
|
|
2
5
|
/**
|
|
3
6
|
* Returns a new array containing only one copy of each element in the original
|
|
@@ -16,7 +19,7 @@ type IsEquals<T> = (a: T, b: T) => boolean;
|
|
|
16
19
|
* @lazy
|
|
17
20
|
* @category Array
|
|
18
21
|
*/
|
|
19
|
-
declare function uniqueWith<T>(data:
|
|
22
|
+
declare function uniqueWith<T extends IterableContainer>(data: T, isEquals: IsEquals<T[number]>): Deduped<T>;
|
|
20
23
|
/**
|
|
21
24
|
* Returns a new array containing only one copy of each element in the original
|
|
22
25
|
* list. Elements are compared by custom comparator isEquals.
|
|
@@ -36,6 +39,6 @@ declare function uniqueWith<T>(data: ReadonlyArray<T>, isEquals: IsEquals<T>): A
|
|
|
36
39
|
* @lazy
|
|
37
40
|
* @category Array
|
|
38
41
|
*/
|
|
39
|
-
declare function uniqueWith<T>(isEquals: IsEquals<T>): (data:
|
|
42
|
+
declare function uniqueWith<T extends IterableContainer>(isEquals: IsEquals<T[number]>): (data: T) => Deduped<T>;
|
|
40
43
|
|
|
41
44
|
export { uniqueWith };
|
package/dist/unique-with.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.js';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
type IsEquals<T> = (a: T, b: T) => boolean;
|
|
2
5
|
/**
|
|
3
6
|
* Returns a new array containing only one copy of each element in the original
|
|
@@ -16,7 +19,7 @@ type IsEquals<T> = (a: T, b: T) => boolean;
|
|
|
16
19
|
* @lazy
|
|
17
20
|
* @category Array
|
|
18
21
|
*/
|
|
19
|
-
declare function uniqueWith<T>(data:
|
|
22
|
+
declare function uniqueWith<T extends IterableContainer>(data: T, isEquals: IsEquals<T[number]>): Deduped<T>;
|
|
20
23
|
/**
|
|
21
24
|
* Returns a new array containing only one copy of each element in the original
|
|
22
25
|
* list. Elements are compared by custom comparator isEquals.
|
|
@@ -36,6 +39,6 @@ declare function uniqueWith<T>(data: ReadonlyArray<T>, isEquals: IsEquals<T>): A
|
|
|
36
39
|
* @lazy
|
|
37
40
|
* @category Array
|
|
38
41
|
*/
|
|
39
|
-
declare function uniqueWith<T>(isEquals: IsEquals<T>): (data:
|
|
42
|
+
declare function uniqueWith<T extends IterableContainer>(isEquals: IsEquals<T[number]>): (data: T) => Deduped<T>;
|
|
40
43
|
|
|
41
44
|
export { uniqueWith };
|
package/dist/unique-with.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-AKGWT6GC.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";export{a as uniqueWith};
|
package/dist/unique.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHTO3K3VAcjs = require('./chunk-HTO3K3VA.cjs');require('./chunk-NLX7PGPI.cjs');require('./chunk-I6VXEY44.cjs');require('./chunk-3X6SAJDQ.cjs');exports.unique = _chunkHTO3K3VAcjs.a;
|
package/dist/unique.d.cts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.cjs';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Returns a new array containing only one copy of each element in the original
|
|
3
6
|
* list. Elements are compared by reference using Set.
|
|
4
7
|
*
|
|
5
|
-
* @param
|
|
8
|
+
* @param data - The array to filter.
|
|
6
9
|
* @signature
|
|
7
10
|
* P.unique(array)
|
|
8
11
|
* @example
|
|
@@ -11,7 +14,7 @@
|
|
|
11
14
|
* @lazy
|
|
12
15
|
* @category Array
|
|
13
16
|
*/
|
|
14
|
-
declare function unique<T>(
|
|
17
|
+
declare function unique<T extends IterableContainer>(data: T): Deduped<T>;
|
|
15
18
|
/**
|
|
16
19
|
* Returns a new array containing only one copy of each element in the original
|
|
17
20
|
* list. Elements are compared by reference using Set.
|
|
@@ -28,6 +31,6 @@ declare function unique<T>(array: ReadonlyArray<T>): Array<T>;
|
|
|
28
31
|
* @lazy
|
|
29
32
|
* @category Array
|
|
30
33
|
*/
|
|
31
|
-
declare function unique
|
|
34
|
+
declare function unique(): <T extends IterableContainer>(data: T) => Deduped<T>;
|
|
32
35
|
|
|
33
36
|
export { unique };
|
package/dist/unique.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { I as IterableContainer, D as Deduped } from './types-BE3YOWVA.js';
|
|
2
|
+
import 'type-fest';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Returns a new array containing only one copy of each element in the original
|
|
3
6
|
* list. Elements are compared by reference using Set.
|
|
4
7
|
*
|
|
5
|
-
* @param
|
|
8
|
+
* @param data - The array to filter.
|
|
6
9
|
* @signature
|
|
7
10
|
* P.unique(array)
|
|
8
11
|
* @example
|
|
@@ -11,7 +14,7 @@
|
|
|
11
14
|
* @lazy
|
|
12
15
|
* @category Array
|
|
13
16
|
*/
|
|
14
|
-
declare function unique<T>(
|
|
17
|
+
declare function unique<T extends IterableContainer>(data: T): Deduped<T>;
|
|
15
18
|
/**
|
|
16
19
|
* Returns a new array containing only one copy of each element in the original
|
|
17
20
|
* list. Elements are compared by reference using Set.
|
|
@@ -28,6 +31,6 @@ declare function unique<T>(array: ReadonlyArray<T>): Array<T>;
|
|
|
28
31
|
* @lazy
|
|
29
32
|
* @category Array
|
|
30
33
|
*/
|
|
31
|
-
declare function unique
|
|
34
|
+
declare function unique(): <T extends IterableContainer>(data: T) => Deduped<T>;
|
|
32
35
|
|
|
33
36
|
export { unique };
|
package/dist/unique.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-WQDEYM64.js";import"./chunk-C6L5NLLB.js";import"./chunk-6ALZHU2N.js";import"./chunk-MYLYERXO.js";export{a as unique};
|
package/dist/values.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-
|
|
1
|
+
import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-BE3YOWVA.cjs';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
type Values<T extends object> = T extends IterableContainer ? Array<T[number]> : Array<EnumerableStringKeyedValueOf<T>>;
|
package/dist/values.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-
|
|
1
|
+
import { I as IterableContainer, E as EnumerableStringKeyedValueOf } from './types-BE3YOWVA.js';
|
|
2
2
|
import 'type-fest';
|
|
3
3
|
|
|
4
4
|
type Values<T extends object> = T extends IterableContainer ? Array<T[number]> : Array<EnumerableStringKeyedValueOf<T>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _chunk47KOI7MWcjs = require('./chunk-47KOI7MW.cjs');var _chunkNULDWRPDcjs = require('./chunk-NULDWRPD.cjs');require('./chunk-Y74ER22O.cjs');require('./chunk-7T4AVFYJ.cjs');it("should correctly types indexed types",()=>{let e=_chunk47KOI7MWcjs.a.call(void 0, {a:"b"});expectTypeOf(e).toEqualTypeOf()});it("should correctly type functions",()=>{let e=_chunk47KOI7MWcjs.a.call(void 0, _chunkNULDWRPDcjs.a.call(void 0, ));expectTypeOf(e).toEqualTypeOf()});it("should correctly type arrays",()=>{let e=_chunk47KOI7MWcjs.a.call(void 0, [1,2,3]);expectTypeOf(e).toEqualTypeOf()});it("should correctly type const arrays",()=>{let e=_chunk47KOI7MWcjs.a.call(void 0, [1,2,3]);expectTypeOf(e).toEqualTypeOf()});it("should correctly type objects",()=>{let e=_chunk47KOI7MWcjs.a.call(void 0, {a:!0});expectTypeOf(e).toEqualTypeOf()});it("should correctly type Records",()=>{let e=_chunk47KOI7MWcjs.a.call(void 0, {a:!0});expectTypeOf(e).toEqualTypeOf()});it("should correctly type union of Records",()=>{let e=_chunk47KOI7MWcjs.a.call(void 0, {a:"cat"});expectTypeOf(e).toEqualTypeOf()});it("should correctly type typed objects",()=>{let e=_chunk47KOI7MWcjs.a.call(void 0, {type:"cat",age:7});expectTypeOf(e).toEqualTypeOf()});it("should skip symbol keys",()=>{let e=_chunk47KOI7MWcjs.a.call(void 0, {[Symbol("a")]:!0,a:"b",123:456});expectTypeOf(e).toEqualTypeOf()});it("should return a useful type when all keys are symbols",()=>{let e=_chunk47KOI7MWcjs.a.call(void 0, {[Symbol("a")]:!0,[Symbol("b")]:"c"});expectTypeOf(e).toEqualTypeOf()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-22S2LZ25.js";import{a as r}from"./chunk-PHKKU45J.js";import"./chunk-JFXZ246Y.js";import"./chunk-KQGY2DBY.js";it("should correctly types indexed types",()=>{let e=t({a:"b"});expectTypeOf(e).toEqualTypeOf()});it("should correctly type functions",()=>{let e=t(r());expectTypeOf(e).toEqualTypeOf()});it("should correctly type arrays",()=>{let e=t([1,2,3]);expectTypeOf(e).toEqualTypeOf()});it("should correctly type const arrays",()=>{let e=t([1,2,3]);expectTypeOf(e).toEqualTypeOf()});it("should correctly type objects",()=>{let e=t({a:!0});expectTypeOf(e).toEqualTypeOf()});it("should correctly type Records",()=>{let e=t({a:!0});expectTypeOf(e).toEqualTypeOf()});it("should correctly type union of Records",()=>{let e=t({a:"cat"});expectTypeOf(e).toEqualTypeOf()});it("should correctly type typed objects",()=>{let e=t({type:"cat",age:7});expectTypeOf(e).toEqualTypeOf()});it("should skip symbol keys",()=>{let e=t({[Symbol("a")]:!0,a:"b",123:456});expectTypeOf(e).toEqualTypeOf()});it("should return a useful type when all keys are symbols",()=>{let e=t({[Symbol("a")]:!0,[Symbol("b")]:"c"});expectTypeOf(e).toEqualTypeOf()});
|