@vinicunca/perkakas 1.6.0 → 1.7.1
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.d.cts +1 -1
- package/dist/add-prop.d.ts +1 -1
- package/dist/add-prop.js +1 -1
- package/dist/add.cjs +1 -1
- package/dist/add.js +1 -1
- package/dist/all-pass.cjs +1 -1
- package/dist/all-pass.js +1 -1
- package/dist/any-pass.cjs +1 -1
- package/dist/any-pass.js +1 -1
- package/dist/{array-required-prefix-BW08fIbb.d.cts → array-required-prefix-Ck4lHkbA.d.cts} +3 -5
- package/dist/{array-required-prefix-a3sgCkd2.d.ts → array-required-prefix-DXv_WnmG.d.ts} +3 -5
- package/dist/{bounded-partial-CJjczH6j.d.ts → bounded-partial-B15MLSAS.d.ts} +2 -2
- package/dist/{bounded-partial-wqR8ceNQ.d.cts → bounded-partial-BhnecV3P.d.cts} +2 -2
- package/dist/ceil.cjs +1 -1
- package/dist/ceil.js +1 -1
- package/dist/chunk-3DOG24FJ.cjs +1 -0
- package/dist/chunk-4BTTPOEU.cjs +1 -0
- package/dist/chunk-4Y6KJJOW.js +1 -0
- package/dist/chunk-4Y6VRHEP.js +1 -0
- package/dist/{chunk-BDBX4ZMW.cjs → chunk-76VE5EC6.cjs} +1 -1
- package/dist/{chunk-TNA73S2T.cjs → chunk-7C7R7JNX.cjs} +1 -1
- package/dist/{chunk-WONMP5WS.js → chunk-7V7IBWP5.js} +1 -1
- package/dist/chunk-ALP5JUXX.cjs +1 -0
- package/dist/chunk-BKBHW2XJ.js +1 -0
- package/dist/chunk-BSNCALDT.cjs +1 -0
- package/dist/{chunk-UGWBDJPI.cjs → chunk-D4TUHKBA.cjs} +1 -1
- package/dist/chunk-DXA7AZUA.js +1 -0
- package/dist/chunk-EK7ODJWE.js +1 -0
- package/dist/chunk-FIO5FNV2.js +1 -0
- package/dist/chunk-GRKRFDIL.js +1 -0
- package/dist/chunk-HHNHTPVO.cjs +1 -0
- package/dist/chunk-I5B54QDJ.cjs +438 -0
- package/dist/chunk-JYWIRZ2Z.js +1 -0
- package/dist/chunk-MBGSSEZN.cjs +1 -0
- package/dist/{chunk-GFXNX2W7.js → chunk-MPWQN3WY.js} +1 -1
- package/dist/chunk-NHTBBY2L.js +1 -0
- package/dist/chunk-NQUTCPKD.js +1 -0
- package/dist/chunk-OKBFQ7B6.js +1 -0
- package/dist/chunk-QGF2XNZS.cjs +1 -0
- package/dist/chunk-QPMGUF2V.cjs +1 -0
- package/dist/chunk-RMOD5JNB.cjs +1 -0
- package/dist/{chunk-5NW4GR2Q.cjs → chunk-RTFVY5D4.cjs} +1 -1
- package/dist/chunk-RZBBV6PK.js +1 -0
- package/dist/chunk-SG2YWG6U.cjs +1 -0
- package/dist/chunk-SXNRBENP.cjs +1 -0
- package/dist/chunk-TSP3FU72.cjs +1 -0
- package/dist/chunk-TWCEO47X.cjs +1 -0
- package/dist/{chunk-L4FN2W5Q.cjs → chunk-TXPRX236.cjs} +1 -1
- package/dist/{chunk-3K7SNX4D.cjs → chunk-UURK6I3D.cjs} +1 -1
- package/dist/chunk-VVGDSDKI.js +438 -0
- package/dist/chunk-XCG2UC6T.js +1 -0
- package/dist/{chunk-673TXH2U.js → chunk-YRVN4PYH.js} +1 -1
- package/dist/chunk-YWIXN5BR.js +1 -0
- package/dist/{chunk-EDZFEURO.js → chunk-Z5YZYBC2.js} +1 -1
- package/dist/chunk-ZMG3NQDL.js +1 -0
- package/dist/chunk.cjs +1 -1
- package/dist/chunk.d.cts +9 -32
- package/dist/chunk.d.ts +9 -32
- package/dist/chunk.js +1 -1
- package/dist/clamp.cjs +1 -1
- package/dist/clamp.js +1 -1
- package/dist/clone.cjs +1 -1
- package/dist/clone.js +1 -1
- package/dist/concat.cjs +1 -1
- package/dist/concat.js +1 -1
- package/dist/conditional.cjs +1 -1
- package/dist/conditional.d.cts +133 -43
- package/dist/conditional.d.ts +133 -43
- package/dist/conditional.js +1 -1
- package/dist/constant.cjs +1 -1
- package/dist/constant.d.cts +1 -1
- package/dist/constant.d.ts +1 -1
- package/dist/constant.js +1 -1
- package/dist/count-by.cjs +1 -1
- package/dist/count-by.d.cts +2 -2
- package/dist/count-by.d.ts +2 -2
- package/dist/count-by.js +1 -1
- package/dist/curry.cjs +1 -1
- package/dist/curry.js +1 -1
- package/dist/debounce.cjs +1 -1
- package/dist/debounce.js +1 -1
- package/dist/difference-with.cjs +1 -1
- package/dist/difference-with.js +1 -1
- package/dist/difference.cjs +1 -1
- package/dist/difference.js +1 -1
- package/dist/divide.cjs +1 -1
- package/dist/divide.js +1 -1
- package/dist/do-nothing.cjs +1 -1
- package/dist/do-nothing.js +1 -1
- package/dist/drop-first-by.cjs +1 -1
- package/dist/drop-first-by.d.cts +1 -1
- package/dist/drop-first-by.d.ts +1 -1
- package/dist/drop-first-by.js +1 -1
- package/dist/drop-last-while.cjs +1 -1
- package/dist/drop-last-while.js +1 -1
- package/dist/drop-last.cjs +1 -1
- package/dist/drop-last.js +1 -1
- package/dist/drop-while.cjs +1 -1
- package/dist/drop-while.js +1 -1
- package/dist/drop.cjs +1 -1
- package/dist/drop.d.cts +2 -1
- package/dist/drop.d.ts +2 -1
- package/dist/drop.js +1 -1
- package/dist/entries.cjs +1 -1
- package/dist/entries.d.cts +8 -5
- package/dist/entries.d.ts +8 -5
- package/dist/entries.js +1 -1
- package/dist/{enumerable-string-key-of-BQ4aR5ep.d.ts → enumerable-string-key-of-C4gsorXe.d.ts} +3 -1
- package/dist/{enumerable-string-key-of-BQ4aR5ep.d.cts → enumerable-string-key-of-D8w_3Yg8.d.cts} +3 -1
- package/dist/enumerable-string-keyed-value-of-BU9R_cEk.d.cts +9 -0
- package/dist/enumerable-string-keyed-value-of-BU9R_cEk.d.ts +9 -0
- package/dist/evolve.cjs +1 -1
- package/dist/evolve.js +1 -1
- package/dist/filter.cjs +1 -1
- package/dist/filter.d.cts +4 -4
- package/dist/filter.d.ts +4 -4
- package/dist/filter.js +1 -1
- package/dist/{filtered-array-DX6NNaBq.d.cts → filtered-array-BCjySbC6.d.cts} +1 -1
- package/dist/{filtered-array-BNHX1Nwj.d.ts → filtered-array-JKATL39M.d.ts} +1 -1
- package/dist/find-index.cjs +1 -1
- package/dist/find-index.js +1 -1
- package/dist/find-last-index.cjs +1 -1
- package/dist/find-last-index.js +1 -1
- package/dist/find-last.cjs +1 -1
- package/dist/find-last.js +1 -1
- package/dist/find.cjs +1 -1
- package/dist/find.js +1 -1
- package/dist/first-by.cjs +1 -1
- package/dist/first-by.d.cts +1 -1
- package/dist/first-by.d.ts +1 -1
- package/dist/first-by.js +1 -1
- package/dist/first.cjs +1 -1
- package/dist/first.js +1 -1
- package/dist/flat-map.cjs +1 -1
- package/dist/flat-map.js +1 -1
- package/dist/flat.cjs +1 -1
- package/dist/flat.d.cts +2 -5
- package/dist/flat.d.ts +2 -5
- package/dist/flat.js +1 -1
- package/dist/floor.cjs +1 -1
- package/dist/floor.js +1 -1
- package/dist/for-each-obj.cjs +1 -1
- package/dist/for-each-obj.d.cts +3 -2
- package/dist/for-each-obj.d.ts +3 -2
- package/dist/for-each-obj.js +1 -1
- package/dist/for-each.cjs +1 -1
- package/dist/for-each.js +1 -1
- package/dist/from-entries.cjs +1 -1
- package/dist/from-entries.d.cts +4 -2
- package/dist/from-entries.d.ts +4 -2
- package/dist/from-entries.js +1 -1
- package/dist/from-keys.cjs +1 -1
- package/dist/from-keys.d.cts +2 -2
- package/dist/from-keys.d.ts +2 -2
- package/dist/from-keys.js +1 -1
- package/dist/funnel.cjs +1 -1
- package/dist/funnel.d.cts +7 -7
- package/dist/funnel.d.ts +7 -7
- package/dist/funnel.js +1 -1
- package/dist/funnel.lodash-debounce-with-cached-value.test.cjs +1 -1
- package/dist/funnel.lodash-debounce-with-cached-value.test.js +1 -1
- package/dist/funnel.lodash-debounce.test.cjs +1 -1
- package/dist/funnel.lodash-debounce.test.js +1 -1
- package/dist/funnel.lodash-throttle-with-cached-value.test.cjs +1 -1
- package/dist/funnel.lodash-throttle-with-cached-value.test.js +1 -1
- package/dist/funnel.lodash-throttle.test.cjs +1 -1
- package/dist/funnel.lodash-throttle.test.js +1 -1
- package/dist/funnel.perkakas-debounce.test.cjs +1 -0
- package/dist/funnel.perkakas-debounce.test.js +1 -0
- package/dist/funnel.reference-batch.test.cjs +1 -1
- package/dist/funnel.reference-batch.test.js +1 -1
- package/dist/funnel.test-d.cjs +1 -1
- package/dist/funnel.test-d.js +1 -1
- package/dist/funnel.test.cjs +1 -1
- package/dist/funnel.test.js +1 -1
- package/dist/group-by-prop.cjs +1 -1
- package/dist/group-by-prop.d.cts +6 -5
- package/dist/group-by-prop.d.ts +6 -5
- package/dist/group-by-prop.js +1 -1
- package/dist/group-by.cjs +1 -1
- package/dist/group-by.d.cts +2 -2
- package/dist/group-by.d.ts +2 -2
- package/dist/group-by.js +1 -1
- package/dist/has-at-least.cjs +1 -1
- package/dist/has-at-least.d.cts +3 -2
- package/dist/has-at-least.d.ts +3 -2
- package/dist/has-at-least.js +1 -1
- package/dist/has-sub-object.cjs +1 -1
- package/dist/has-sub-object.js +1 -1
- package/dist/human-readable-file-size.cjs +1 -1
- package/dist/human-readable-file-size.js +1 -1
- package/dist/identity.cjs +1 -1
- package/dist/identity.js +1 -1
- package/dist/index-by.cjs +1 -1
- package/dist/index-by.d.cts +2 -2
- package/dist/index-by.d.ts +2 -2
- package/dist/index-by.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +12 -10
- package/dist/index.d.ts +12 -10
- package/dist/index.js +1 -1
- package/dist/intersection-with.cjs +1 -1
- package/dist/intersection-with.js +1 -1
- package/dist/intersection.cjs +1 -1
- package/dist/intersection.js +1 -1
- package/dist/invert.cjs +1 -1
- package/dist/invert.d.cts +2 -1
- package/dist/invert.d.ts +2 -1
- package/dist/invert.js +1 -1
- package/dist/is-array.cjs +1 -1
- package/dist/is-array.js +1 -1
- package/dist/is-big-int.cjs +1 -1
- package/dist/is-big-int.js +1 -1
- package/dist/is-boolean.cjs +1 -1
- package/dist/is-boolean.js +1 -1
- package/dist/is-bounded-record-C9WAwfA8.d.cts +30 -0
- package/dist/is-bounded-record-C9WAwfA8.d.ts +30 -0
- package/dist/is-date.cjs +1 -1
- package/dist/is-date.js +1 -1
- package/dist/is-deep-equal.cjs +1 -1
- package/dist/is-deep-equal.js +1 -1
- package/dist/is-defined.cjs +1 -1
- package/dist/is-defined.js +1 -1
- package/dist/is-empty.cjs +1 -1
- package/dist/is-empty.js +1 -1
- package/dist/is-error.cjs +1 -1
- package/dist/is-error.js +1 -1
- package/dist/is-function.cjs +1 -1
- package/dist/is-function.js +1 -1
- package/dist/is-included-in.cjs +1 -1
- package/dist/is-included-in.js +1 -1
- package/dist/is-non-null.cjs +1 -1
- package/dist/is-non-null.js +1 -1
- package/dist/is-non-nullish.cjs +1 -1
- package/dist/is-non-nullish.js +1 -1
- package/dist/is-not.cjs +1 -1
- package/dist/is-not.js +1 -1
- package/dist/is-nullish.cjs +1 -1
- package/dist/is-nullish.js +1 -1
- package/dist/is-number.cjs +1 -1
- package/dist/is-number.js +1 -1
- package/dist/is-object-type.cjs +1 -1
- package/dist/is-object-type.js +1 -1
- package/dist/is-plain-object.cjs +1 -1
- package/dist/is-plain-object.js +1 -1
- package/dist/is-promise.cjs +1 -1
- package/dist/is-promise.js +1 -1
- package/dist/is-shallow-equal.cjs +1 -1
- package/dist/is-shallow-equal.js +1 -1
- package/dist/is-strict-equal.cjs +1 -1
- package/dist/is-strict-equal.js +1 -1
- package/dist/is-string.cjs +1 -1
- package/dist/is-string.js +1 -1
- package/dist/is-symbol.cjs +1 -1
- package/dist/is-symbol.js +1 -1
- package/dist/is-truthy.cjs +1 -1
- package/dist/is-truthy.js +1 -1
- package/dist/join.cjs +1 -1
- package/dist/join.js +1 -1
- package/dist/key-codes.cjs +1 -1
- package/dist/key-codes.js +1 -1
- package/dist/keys.cjs +1 -1
- package/dist/keys.d.cts +4 -3
- package/dist/keys.d.ts +4 -3
- package/dist/keys.js +1 -1
- package/dist/last.cjs +1 -1
- package/dist/last.js +1 -1
- package/dist/length.cjs +1 -1
- package/dist/length.js +1 -1
- package/dist/magic-string.es-2ADFIHOO.cjs +13 -0
- package/dist/magic-string.es-PNCTE22R.js +13 -0
- package/dist/map-keys.cjs +1 -1
- package/dist/map-keys.d.cts +5 -4
- package/dist/map-keys.d.ts +5 -4
- package/dist/map-keys.js +1 -1
- package/dist/map-to-obj.cjs +1 -1
- package/dist/map-to-obj.d.cts +30 -12
- package/dist/map-to-obj.d.ts +30 -12
- package/dist/map-to-obj.js +1 -1
- package/dist/map-values.cjs +1 -1
- package/dist/map-values.d.cts +4 -3
- package/dist/map-values.d.ts +4 -3
- package/dist/map-values.js +1 -1
- package/dist/map-with-feedback.cjs +1 -1
- package/dist/map-with-feedback.js +1 -1
- package/dist/map.cjs +1 -1
- package/dist/map.js +1 -1
- package/dist/mean-by.cjs +1 -1
- package/dist/mean-by.js +1 -1
- package/dist/merge-all.cjs +1 -1
- package/dist/merge-all.d.cts +2 -1
- package/dist/merge-all.d.ts +2 -1
- package/dist/merge-all.js +1 -1
- package/dist/merge-deep.cjs +1 -1
- package/dist/merge-deep.js +1 -1
- package/dist/merge.cjs +1 -1
- package/dist/merge.js +1 -1
- package/dist/multiply.cjs +1 -1
- package/dist/multiply.js +1 -1
- package/dist/n-tuple-5jljrt4c.d.cts +10 -0
- package/dist/n-tuple-5jljrt4c.d.ts +10 -0
- package/dist/nth-by.cjs +1 -1
- package/dist/nth-by.d.cts +1 -1
- package/dist/nth-by.d.ts +1 -1
- package/dist/nth-by.js +1 -1
- package/dist/obj-of.cjs +1 -1
- package/dist/obj-of.js +1 -1
- package/dist/omit-by.cjs +1 -1
- package/dist/omit-by.d.cts +6 -6
- package/dist/omit-by.d.ts +6 -6
- package/dist/omit-by.js +1 -1
- package/dist/omit.cjs +1 -1
- package/dist/omit.js +1 -1
- package/dist/once.cjs +1 -1
- package/dist/once.js +1 -1
- package/dist/only.cjs +1 -1
- package/dist/only.js +1 -1
- package/dist/partition.cjs +1 -1
- package/dist/partition.js +1 -1
- package/dist/path-or.cjs +1 -1
- package/dist/path-or.d.cts +10 -0
- package/dist/path-or.d.ts +10 -0
- package/dist/path-or.js +1 -1
- package/dist/perkakas-type-error-8wPb8T2y.d.cts +17 -0
- package/dist/perkakas-type-error-8wPb8T2y.d.ts +17 -0
- package/dist/pick-by.cjs +1 -1
- package/dist/pick-by.d.cts +10 -11
- package/dist/pick-by.d.ts +10 -11
- package/dist/pick-by.js +1 -1
- package/dist/pick.cjs +1 -1
- package/dist/pick.d.cts +51 -7
- package/dist/pick.d.ts +51 -7
- package/dist/pick.js +1 -1
- package/dist/pipe.cjs +1 -1
- package/dist/pipe.js +1 -1
- package/dist/piped.cjs +1 -1
- package/dist/piped.js +1 -1
- package/dist/product.cjs +1 -1
- package/dist/product.js +1 -1
- package/dist/prop.cjs +1 -1
- package/dist/prop.d.cts +118 -13
- package/dist/prop.d.ts +118 -13
- package/dist/prop.js +1 -1
- package/dist/pull-object.cjs +1 -1
- package/dist/pull-object.d.cts +2 -2
- package/dist/pull-object.d.ts +2 -2
- package/dist/pull-object.js +1 -1
- package/dist/random-integer.cjs +1 -1
- package/dist/random-integer.js +1 -1
- package/dist/random-string.cjs +1 -1
- package/dist/random-string.js +1 -1
- package/dist/range.cjs +1 -1
- package/dist/range.js +1 -1
- package/dist/rank-by.cjs +1 -1
- package/dist/rank-by.d.cts +1 -1
- package/dist/rank-by.d.ts +1 -1
- package/dist/rank-by.js +1 -1
- package/dist/reduce.cjs +1 -1
- package/dist/reduce.js +1 -1
- package/dist/reverse.cjs +1 -1
- package/dist/reverse.js +1 -1
- package/dist/round.cjs +1 -1
- package/dist/round.js +1 -1
- package/dist/sample.cjs +1 -1
- package/dist/sample.d.cts +32 -8
- package/dist/sample.d.ts +32 -8
- package/dist/sample.js +1 -1
- package/dist/set-path.cjs +1 -1
- package/dist/set-path.d.cts +18 -7
- package/dist/set-path.d.ts +18 -7
- package/dist/set-path.js +1 -1
- package/dist/set.cjs +1 -1
- package/dist/set.d.cts +1 -1
- package/dist/set.d.ts +1 -1
- package/dist/set.js +1 -1
- package/dist/shuffle.cjs +1 -1
- package/dist/shuffle.js +1 -1
- package/dist/sleep.cjs +1 -1
- package/dist/sleep.js +1 -1
- package/dist/slice-string.cjs +1 -1
- package/dist/slice-string.js +1 -1
- package/dist/slugify.cjs +1 -1
- package/dist/slugify.js +1 -1
- package/dist/sort-by.cjs +1 -1
- package/dist/sort-by.js +1 -1
- package/dist/sort.cjs +1 -1
- package/dist/sort.js +1 -1
- package/dist/sorted-index-by.cjs +1 -1
- package/dist/sorted-index-by.js +1 -1
- package/dist/sorted-index-with.cjs +1 -1
- package/dist/sorted-index-with.js +1 -1
- package/dist/sorted-index.cjs +1 -1
- package/dist/sorted-index.js +1 -1
- package/dist/sorted-last-index-by.cjs +1 -1
- package/dist/sorted-last-index-by.js +1 -1
- package/dist/sorted-last-index.cjs +1 -1
- package/dist/sorted-last-index.js +1 -1
- package/dist/splice.cjs +1 -1
- package/dist/splice.js +1 -1
- package/dist/split-at.cjs +1 -1
- package/dist/split-at.js +1 -1
- package/dist/split-when.cjs +1 -1
- package/dist/split-when.js +1 -1
- package/dist/split.cjs +1 -1
- package/dist/split.js +1 -1
- package/dist/string-to-path.cjs +1 -1
- package/dist/string-to-path.d.cts +32 -11
- package/dist/string-to-path.d.ts +32 -11
- package/dist/string-to-path.js +1 -1
- package/dist/subtract.cjs +1 -1
- package/dist/subtract.js +1 -1
- package/dist/sum-by.cjs +1 -1
- package/dist/sum-by.js +1 -1
- package/dist/sum.cjs +1 -1
- package/dist/sum.js +1 -1
- package/dist/swap-indices.cjs +1 -1
- package/dist/swap-indices.js +1 -1
- package/dist/swap-props.cjs +1 -1
- package/dist/swap-props.js +1 -1
- package/dist/take-first-by.cjs +1 -1
- package/dist/take-first-by.d.cts +1 -1
- package/dist/take-first-by.d.ts +1 -1
- package/dist/take-first-by.js +1 -1
- package/dist/take-last-while.cjs +1 -1
- package/dist/take-last-while.js +1 -1
- package/dist/take-last.cjs +1 -1
- package/dist/take-last.js +1 -1
- package/dist/take-while.cjs +1 -1
- package/dist/take-while.js +1 -1
- package/dist/take.cjs +1 -1
- package/dist/take.js +1 -1
- package/dist/tap.cjs +1 -1
- package/dist/tap.js +1 -1
- package/dist/times.cjs +1 -1
- package/dist/times.d.cts +1 -9
- package/dist/times.d.ts +1 -9
- package/dist/times.js +1 -1
- package/dist/to-camel-case.cjs +1 -1
- package/dist/to-camel-case.js +1 -1
- package/dist/to-capital-case.cjs +1 -1
- package/dist/to-capital-case.js +1 -1
- package/dist/to-constant-case.cjs +1 -1
- package/dist/to-constant-case.js +1 -1
- package/dist/to-kebab-case.cjs +1 -1
- package/dist/to-kebab-case.js +1 -1
- package/dist/to-no-case.cjs +1 -1
- package/dist/to-no-case.js +1 -1
- package/dist/to-pascal-case.cjs +1 -1
- package/dist/to-pascal-case.js +1 -1
- package/dist/to-pascal-snake-case.cjs +1 -1
- package/dist/to-pascal-snake-case.js +1 -1
- package/dist/to-sentence-case.cjs +1 -1
- package/dist/to-sentence-case.js +1 -1
- package/dist/to-snake-case.cjs +1 -1
- package/dist/to-snake-case.js +1 -1
- package/dist/to-string-DO8zw6jS.d.cts +11 -0
- package/dist/to-string-DO8zw6jS.d.ts +11 -0
- package/dist/to-train-case.cjs +1 -1
- package/dist/to-train-case.js +1 -1
- package/dist/{tuple-parts-CrwnkDKX.d.ts → tuple-parts-BTivqbtT.d.ts} +4 -18
- package/dist/{tuple-parts-DAqFAJP8.d.cts → tuple-parts-v6av7LMU.d.cts} +4 -18
- package/dist/unique-by.cjs +1 -1
- package/dist/unique-by.js +1 -1
- package/dist/unique-with.cjs +1 -1
- package/dist/unique-with.js +1 -1
- package/dist/unique.cjs +1 -1
- package/dist/unique.js +1 -1
- package/dist/{upsert-prop-tIHFi_F_.d.cts → upsert-prop-Cc3jEW9l.d.cts} +1 -2
- package/dist/{upsert-prop-D0N8486l.d.ts → upsert-prop-CdUtD50i.d.ts} +1 -2
- package/dist/values.cjs +1 -1
- package/dist/values.d.cts +1 -1
- package/dist/values.d.ts +1 -1
- package/dist/values.js +1 -1
- package/dist/zip-with.cjs +1 -1
- package/dist/zip-with.js +1 -1
- package/dist/zip.cjs +1 -1
- package/dist/zip.js +1 -1
- package/package.json +12 -12
- package/dist/chunk-2MHE6M7V.cjs +0 -1
- package/dist/chunk-5SAUYUEK.js +0 -1
- package/dist/chunk-6HSB3NFW.js +0 -1
- package/dist/chunk-6L5XEBJG.js +0 -1
- package/dist/chunk-A2PAJNYA.js +0 -1
- package/dist/chunk-AWXJSK4F.js +0 -1
- package/dist/chunk-CZLV6ZLZ.js +0 -1
- package/dist/chunk-F3JXHUP4.cjs +0 -1
- package/dist/chunk-FMUPPQZE.js +0 -1
- package/dist/chunk-FP3LV577.js +0 -1
- package/dist/chunk-GFQXVPLP.cjs +0 -1
- package/dist/chunk-GOUUMCT7.cjs +0 -1
- package/dist/chunk-HRK4GMT2.cjs +0 -1
- package/dist/chunk-ICYGL2YZ.js +0 -1
- package/dist/chunk-J3ZXNDMT.cjs +0 -1
- package/dist/chunk-MBC7VZHY.js +0 -1
- package/dist/chunk-NEIICTWC.js +0 -1
- package/dist/chunk-NQGMUM3E.cjs +0 -1
- package/dist/chunk-OBWPUDD3.cjs +0 -1
- package/dist/chunk-SOPOELNU.cjs +0 -1
- package/dist/chunk-SQZULO7V.js +0 -1
- package/dist/chunk-UDSRBKNR.js +0 -1
- package/dist/chunk-VRZNQSZN.cjs +0 -1
- package/dist/chunk-WYM2JV5T.cjs +0 -1
- package/dist/chunk-XEAAXO7F.js +0 -1
- package/dist/chunk-XU4TDKMD.cjs +0 -1
- package/dist/enumerable-string-keyed-value-of-CLzltniW.d.cts +0 -15
- package/dist/enumerable-string-keyed-value-of-CLzltniW.d.ts +0 -15
- package/dist/funnel.remeda-debounce.test.cjs +0 -1
- package/dist/funnel.remeda-debounce.test.js +0 -1
- package/dist/if-bounded-record-Drd4UbBU.d.cts +0 -29
- package/dist/if-bounded-record-Drd4UbBU.d.ts +0 -29
- package/dist/reconstructed-record-DchLaSO8.d.cts +0 -10
- package/dist/reconstructed-record-DuxOLlMs.d.ts +0 -10
- /package/dist/{funnel.remeda-debounce.test.d.cts → funnel.perkakas-debounce.test.d.cts} +0 -0
- /package/dist/{funnel.remeda-debounce.test.d.ts → funnel.perkakas-debounce.test.d.ts} +0 -0
package/dist/prop.d.cts
CHANGED
|
@@ -1,29 +1,134 @@
|
|
|
1
|
+
import { IsNumericLiteral, ArrayIndices, KeysOfUnion } from 'type-fest';
|
|
2
|
+
import { C as ClampedIntegerSubtract } from './clamped-integer-subtract-DZ7rsJE4.cjs';
|
|
3
|
+
import { I as IntRangeInclusive } from './int-range-inclusive-Cn-qsrAN.cjs';
|
|
4
|
+
import { I as IterableContainer } from './iterable-container-BTpDVdNc.cjs';
|
|
5
|
+
import { T as TupleParts } from './tuple-parts-v6av7LMU.cjs';
|
|
6
|
+
import './perkakas-type-error-8wPb8T2y.cjs';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The type for the I'th element in the tuple T. This type corrects some of the
|
|
10
|
+
* issues with TypeScript's built-in tuple accessor inference `T[I]` for arrays
|
|
11
|
+
* and tuples with fixed suffixes, and for primitive indices where we don't know
|
|
12
|
+
* if the index is out of bounds.
|
|
13
|
+
*/
|
|
14
|
+
type ArrayAt<T extends IterableContainer, I extends keyof T> = IsNumericLiteral<I> extends true ? I extends unknown ? [
|
|
15
|
+
...TupleParts<T>['required'],
|
|
16
|
+
...TupleParts<T>['optional']
|
|
17
|
+
] extends infer Prefix extends ReadonlyArray<unknown> ? HasIndex<Prefix, I> extends true ? T[I] : TupleParts<T>['item'] | (ClampedIntegerSubtract<I, Prefix['length']> extends infer SuffixIndex extends number ? HasIndex<TupleParts<T>['suffix'], SuffixIndex> extends true ? TupleParts<T>['suffix'][IntRangeInclusive<0, SuffixIndex>] : TupleParts<T>['suffix'][number] | undefined : never) : never : never : T[number] | undefined;
|
|
18
|
+
type HasIndex<T extends ReadonlyArray<unknown>, I> = I extends ArrayIndices<T> ? true : false;
|
|
19
|
+
|
|
20
|
+
type NoInfer<T> = T extends infer U ? U : never;
|
|
21
|
+
|
|
22
|
+
type KeysDeep<T, Path extends ReadonlyArray<unknown>> = KeysOfUnion<PropDeep<T, Path>>;
|
|
23
|
+
type PropDeep<T, Path extends ReadonlyArray<unknown>> = Path extends readonly [
|
|
24
|
+
infer Key,
|
|
25
|
+
...infer Rest
|
|
26
|
+
] ? PropDeep<Prop<T, Key>, Rest> : T;
|
|
27
|
+
type Prop<T, Key> = T extends unknown ? Key extends keyof T ? T extends ReadonlyArray<unknown> ? ArrayAt<T, Key> : T[Key] : undefined : never;
|
|
28
|
+
type NonPropertyKey = object | null | undefined;
|
|
1
29
|
/**
|
|
2
|
-
* Gets the value of the given property.
|
|
30
|
+
* Gets the value of the given property from an object. Nested properties can
|
|
31
|
+
* be accessed by providing a variadic array of keys that define the path from
|
|
32
|
+
* the root to the desired property. Arrays can be accessed by using numeric
|
|
33
|
+
* keys. Unions and optional properties are handled gracefully by returning
|
|
34
|
+
* `undefined` early for any non-existing property on the path. Paths are
|
|
35
|
+
* validated against the object type to provide stronger type safety, better
|
|
36
|
+
* compile-time errors, and to enable autocompletion in IDEs.
|
|
3
37
|
*
|
|
4
|
-
* @param data - The object
|
|
5
|
-
* @param key - The key
|
|
38
|
+
* @param data - The object or array to access.
|
|
39
|
+
* @param key - The key(s) for the property to extract.
|
|
6
40
|
* @signature
|
|
7
|
-
* P.prop(data,
|
|
41
|
+
* P.prop(data, ...keys);
|
|
8
42
|
* @example
|
|
9
|
-
* P.prop({ foo:
|
|
43
|
+
* P.prop({ foo: { bar: 'baz' } }, 'foo'); //=> { bar: 'baz' }
|
|
44
|
+
* P.prop({ foo: { bar: 'baz' } }, 'foo', 'bar'); //=> 'baz'
|
|
45
|
+
* P.prop(["cat", "dog"], 1); //=> 'dog'
|
|
10
46
|
* @dataFirst
|
|
11
47
|
* @category Object
|
|
12
48
|
*/
|
|
13
|
-
declare function prop<T,
|
|
49
|
+
declare function prop<T extends NonPropertyKey, Key extends KeysDeep<T, []>>(data: T, key: Key): NoInfer<Prop<T, Key>>;
|
|
50
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>>(data: T, key0: Key0, key1: Key1): NoInfer<PropDeep<T, [Key0, Key1]>>;
|
|
51
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>>(data: T, key0: Key0, key1: Key1, key2: Key2): NoInfer<PropDeep<T, [Key0, Key1, Key2]>>;
|
|
52
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3]>>;
|
|
53
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4]>>;
|
|
54
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>;
|
|
55
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>;
|
|
56
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>;
|
|
57
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>, Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7, key8: Key8): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]>>;
|
|
58
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>, Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>, Key9 extends KeysDeep<T, [
|
|
59
|
+
Key0,
|
|
60
|
+
Key1,
|
|
61
|
+
Key2,
|
|
62
|
+
Key3,
|
|
63
|
+
Key4,
|
|
64
|
+
Key5,
|
|
65
|
+
Key6,
|
|
66
|
+
Key7,
|
|
67
|
+
Key8
|
|
68
|
+
]>, AdditionalKeys extends ReadonlyArray<PropertyKey> = []>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7, key8: Key8, key9: Key9, ...additionalKeys: AdditionalKeys): NoInfer<PropDeep<T, [
|
|
69
|
+
Key0,
|
|
70
|
+
Key1,
|
|
71
|
+
Key2,
|
|
72
|
+
Key3,
|
|
73
|
+
Key4,
|
|
74
|
+
Key5,
|
|
75
|
+
Key6,
|
|
76
|
+
Key7,
|
|
77
|
+
Key8,
|
|
78
|
+
Key9,
|
|
79
|
+
...AdditionalKeys
|
|
80
|
+
]>>;
|
|
14
81
|
/**
|
|
15
|
-
* Gets the value of the given property.
|
|
82
|
+
* Gets the value of the given property from an object. Nested properties can
|
|
83
|
+
* be accessed by providing a variadic array of keys that define the path from
|
|
84
|
+
* the root to the desired property. Arrays can be accessed by using numeric
|
|
85
|
+
* keys. Unions and optional properties are handled gracefully by returning
|
|
86
|
+
* `undefined` early for any non-existing property on the path. Paths are
|
|
87
|
+
* validated against the object type to provide stronger type safety, better
|
|
88
|
+
* compile-time errors, and to enable autocompletion in IDEs.
|
|
16
89
|
*
|
|
17
|
-
* @param key - The key
|
|
90
|
+
* @param key - The key(s) for the property to extract.
|
|
18
91
|
* @signature
|
|
19
|
-
* P.prop(
|
|
92
|
+
* P.prop(...keys)(data);
|
|
20
93
|
* @example
|
|
21
|
-
*
|
|
94
|
+
* P.pipe({ foo: { bar: 'baz' } }, P.prop('foo')); //=> { bar: 'baz' }
|
|
95
|
+
* P.pipe({ foo: { bar: 'baz' } }, P.prop('foo', 'bar')); //=> 'baz'
|
|
96
|
+
* P.pipe(["cat", "dog"], P.prop(1)); //=> 'dog'
|
|
22
97
|
* @dataLast
|
|
23
98
|
* @category Object
|
|
24
99
|
*/
|
|
25
|
-
declare function prop<T,
|
|
100
|
+
declare function prop<T extends NonPropertyKey, Key extends KeysOfUnion<T>>(key: Key): (data: T) => NoInfer<Prop<T, Key>>;
|
|
101
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>>(key0: Key0, key1: Key1): (data: T) => NoInfer<PropDeep<T, [Key0, Key1]>>;
|
|
102
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>>(key0: Key0, key1: Key1, key2: Key2): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2]>>;
|
|
103
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3]>>;
|
|
104
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4]>>;
|
|
105
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>;
|
|
106
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>;
|
|
107
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>;
|
|
108
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>, Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7, key8: Key8): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]>>;
|
|
109
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>, Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>, Key9 extends KeysDeep<T, [
|
|
110
|
+
Key0,
|
|
111
|
+
Key1,
|
|
112
|
+
Key2,
|
|
113
|
+
Key3,
|
|
114
|
+
Key4,
|
|
115
|
+
Key5,
|
|
116
|
+
Key6,
|
|
117
|
+
Key7,
|
|
118
|
+
Key8
|
|
119
|
+
]>, AdditionalKeys extends ReadonlyArray<PropertyKey> = []>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7, key8: Key8, key9: Key9, ...additionalKeys: AdditionalKeys): (data: T) => NoInfer<PropDeep<T, [
|
|
120
|
+
Key0,
|
|
121
|
+
Key1,
|
|
122
|
+
Key2,
|
|
123
|
+
Key3,
|
|
124
|
+
Key4,
|
|
125
|
+
Key5,
|
|
126
|
+
Key6,
|
|
127
|
+
Key7,
|
|
128
|
+
Key8,
|
|
129
|
+
Key9,
|
|
130
|
+
...AdditionalKeys
|
|
131
|
+
]>>;
|
|
26
132
|
declare function prop<K extends PropertyKey>(key: K): <T extends Partial<Record<K, unknown>>>(data: T) => T[K];
|
|
27
|
-
declare function propImplementation<T, K extends keyof T>(data: T, key: K): T[K];
|
|
28
133
|
|
|
29
|
-
export { prop
|
|
134
|
+
export { prop };
|
package/dist/prop.d.ts
CHANGED
|
@@ -1,29 +1,134 @@
|
|
|
1
|
+
import { IsNumericLiteral, ArrayIndices, KeysOfUnion } from 'type-fest';
|
|
2
|
+
import { C as ClampedIntegerSubtract } from './clamped-integer-subtract-DZ7rsJE4.js';
|
|
3
|
+
import { I as IntRangeInclusive } from './int-range-inclusive-Cn-qsrAN.js';
|
|
4
|
+
import { I as IterableContainer } from './iterable-container-BTpDVdNc.js';
|
|
5
|
+
import { T as TupleParts } from './tuple-parts-BTivqbtT.js';
|
|
6
|
+
import './perkakas-type-error-8wPb8T2y.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The type for the I'th element in the tuple T. This type corrects some of the
|
|
10
|
+
* issues with TypeScript's built-in tuple accessor inference `T[I]` for arrays
|
|
11
|
+
* and tuples with fixed suffixes, and for primitive indices where we don't know
|
|
12
|
+
* if the index is out of bounds.
|
|
13
|
+
*/
|
|
14
|
+
type ArrayAt<T extends IterableContainer, I extends keyof T> = IsNumericLiteral<I> extends true ? I extends unknown ? [
|
|
15
|
+
...TupleParts<T>['required'],
|
|
16
|
+
...TupleParts<T>['optional']
|
|
17
|
+
] extends infer Prefix extends ReadonlyArray<unknown> ? HasIndex<Prefix, I> extends true ? T[I] : TupleParts<T>['item'] | (ClampedIntegerSubtract<I, Prefix['length']> extends infer SuffixIndex extends number ? HasIndex<TupleParts<T>['suffix'], SuffixIndex> extends true ? TupleParts<T>['suffix'][IntRangeInclusive<0, SuffixIndex>] : TupleParts<T>['suffix'][number] | undefined : never) : never : never : T[number] | undefined;
|
|
18
|
+
type HasIndex<T extends ReadonlyArray<unknown>, I> = I extends ArrayIndices<T> ? true : false;
|
|
19
|
+
|
|
20
|
+
type NoInfer<T> = T extends infer U ? U : never;
|
|
21
|
+
|
|
22
|
+
type KeysDeep<T, Path extends ReadonlyArray<unknown>> = KeysOfUnion<PropDeep<T, Path>>;
|
|
23
|
+
type PropDeep<T, Path extends ReadonlyArray<unknown>> = Path extends readonly [
|
|
24
|
+
infer Key,
|
|
25
|
+
...infer Rest
|
|
26
|
+
] ? PropDeep<Prop<T, Key>, Rest> : T;
|
|
27
|
+
type Prop<T, Key> = T extends unknown ? Key extends keyof T ? T extends ReadonlyArray<unknown> ? ArrayAt<T, Key> : T[Key] : undefined : never;
|
|
28
|
+
type NonPropertyKey = object | null | undefined;
|
|
1
29
|
/**
|
|
2
|
-
* Gets the value of the given property.
|
|
30
|
+
* Gets the value of the given property from an object. Nested properties can
|
|
31
|
+
* be accessed by providing a variadic array of keys that define the path from
|
|
32
|
+
* the root to the desired property. Arrays can be accessed by using numeric
|
|
33
|
+
* keys. Unions and optional properties are handled gracefully by returning
|
|
34
|
+
* `undefined` early for any non-existing property on the path. Paths are
|
|
35
|
+
* validated against the object type to provide stronger type safety, better
|
|
36
|
+
* compile-time errors, and to enable autocompletion in IDEs.
|
|
3
37
|
*
|
|
4
|
-
* @param data - The object
|
|
5
|
-
* @param key - The key
|
|
38
|
+
* @param data - The object or array to access.
|
|
39
|
+
* @param key - The key(s) for the property to extract.
|
|
6
40
|
* @signature
|
|
7
|
-
* P.prop(data,
|
|
41
|
+
* P.prop(data, ...keys);
|
|
8
42
|
* @example
|
|
9
|
-
* P.prop({ foo:
|
|
43
|
+
* P.prop({ foo: { bar: 'baz' } }, 'foo'); //=> { bar: 'baz' }
|
|
44
|
+
* P.prop({ foo: { bar: 'baz' } }, 'foo', 'bar'); //=> 'baz'
|
|
45
|
+
* P.prop(["cat", "dog"], 1); //=> 'dog'
|
|
10
46
|
* @dataFirst
|
|
11
47
|
* @category Object
|
|
12
48
|
*/
|
|
13
|
-
declare function prop<T,
|
|
49
|
+
declare function prop<T extends NonPropertyKey, Key extends KeysDeep<T, []>>(data: T, key: Key): NoInfer<Prop<T, Key>>;
|
|
50
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>>(data: T, key0: Key0, key1: Key1): NoInfer<PropDeep<T, [Key0, Key1]>>;
|
|
51
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>>(data: T, key0: Key0, key1: Key1, key2: Key2): NoInfer<PropDeep<T, [Key0, Key1, Key2]>>;
|
|
52
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3]>>;
|
|
53
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4]>>;
|
|
54
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>;
|
|
55
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>;
|
|
56
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>;
|
|
57
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>, Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7, key8: Key8): NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]>>;
|
|
58
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>, Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>, Key9 extends KeysDeep<T, [
|
|
59
|
+
Key0,
|
|
60
|
+
Key1,
|
|
61
|
+
Key2,
|
|
62
|
+
Key3,
|
|
63
|
+
Key4,
|
|
64
|
+
Key5,
|
|
65
|
+
Key6,
|
|
66
|
+
Key7,
|
|
67
|
+
Key8
|
|
68
|
+
]>, AdditionalKeys extends ReadonlyArray<PropertyKey> = []>(data: T, key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7, key8: Key8, key9: Key9, ...additionalKeys: AdditionalKeys): NoInfer<PropDeep<T, [
|
|
69
|
+
Key0,
|
|
70
|
+
Key1,
|
|
71
|
+
Key2,
|
|
72
|
+
Key3,
|
|
73
|
+
Key4,
|
|
74
|
+
Key5,
|
|
75
|
+
Key6,
|
|
76
|
+
Key7,
|
|
77
|
+
Key8,
|
|
78
|
+
Key9,
|
|
79
|
+
...AdditionalKeys
|
|
80
|
+
]>>;
|
|
14
81
|
/**
|
|
15
|
-
* Gets the value of the given property.
|
|
82
|
+
* Gets the value of the given property from an object. Nested properties can
|
|
83
|
+
* be accessed by providing a variadic array of keys that define the path from
|
|
84
|
+
* the root to the desired property. Arrays can be accessed by using numeric
|
|
85
|
+
* keys. Unions and optional properties are handled gracefully by returning
|
|
86
|
+
* `undefined` early for any non-existing property on the path. Paths are
|
|
87
|
+
* validated against the object type to provide stronger type safety, better
|
|
88
|
+
* compile-time errors, and to enable autocompletion in IDEs.
|
|
16
89
|
*
|
|
17
|
-
* @param key - The key
|
|
90
|
+
* @param key - The key(s) for the property to extract.
|
|
18
91
|
* @signature
|
|
19
|
-
* P.prop(
|
|
92
|
+
* P.prop(...keys)(data);
|
|
20
93
|
* @example
|
|
21
|
-
*
|
|
94
|
+
* P.pipe({ foo: { bar: 'baz' } }, P.prop('foo')); //=> { bar: 'baz' }
|
|
95
|
+
* P.pipe({ foo: { bar: 'baz' } }, P.prop('foo', 'bar')); //=> 'baz'
|
|
96
|
+
* P.pipe(["cat", "dog"], P.prop(1)); //=> 'dog'
|
|
22
97
|
* @dataLast
|
|
23
98
|
* @category Object
|
|
24
99
|
*/
|
|
25
|
-
declare function prop<T,
|
|
100
|
+
declare function prop<T extends NonPropertyKey, Key extends KeysOfUnion<T>>(key: Key): (data: T) => NoInfer<Prop<T, Key>>;
|
|
101
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>>(key0: Key0, key1: Key1): (data: T) => NoInfer<PropDeep<T, [Key0, Key1]>>;
|
|
102
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>>(key0: Key0, key1: Key1, key2: Key2): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2]>>;
|
|
103
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3]>>;
|
|
104
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4]>>;
|
|
105
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>;
|
|
106
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>;
|
|
107
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>;
|
|
108
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>, Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7, key8: Key8): (data: T) => NoInfer<PropDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8]>>;
|
|
109
|
+
declare function prop<T extends NonPropertyKey, Key0 extends KeysDeep<T, []>, Key1 extends KeysDeep<T, [Key0]>, Key2 extends KeysDeep<T, [Key0, Key1]>, Key3 extends KeysDeep<T, [Key0, Key1, Key2]>, Key4 extends KeysDeep<T, [Key0, Key1, Key2, Key3]>, Key5 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4]>, Key6 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5]>, Key7 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6]>, Key8 extends KeysDeep<T, [Key0, Key1, Key2, Key3, Key4, Key5, Key6, Key7]>, Key9 extends KeysDeep<T, [
|
|
110
|
+
Key0,
|
|
111
|
+
Key1,
|
|
112
|
+
Key2,
|
|
113
|
+
Key3,
|
|
114
|
+
Key4,
|
|
115
|
+
Key5,
|
|
116
|
+
Key6,
|
|
117
|
+
Key7,
|
|
118
|
+
Key8
|
|
119
|
+
]>, AdditionalKeys extends ReadonlyArray<PropertyKey> = []>(key0: Key0, key1: Key1, key2: Key2, key3: Key3, key4: Key4, key5: Key5, key6: Key6, key7: Key7, key8: Key8, key9: Key9, ...additionalKeys: AdditionalKeys): (data: T) => NoInfer<PropDeep<T, [
|
|
120
|
+
Key0,
|
|
121
|
+
Key1,
|
|
122
|
+
Key2,
|
|
123
|
+
Key3,
|
|
124
|
+
Key4,
|
|
125
|
+
Key5,
|
|
126
|
+
Key6,
|
|
127
|
+
Key7,
|
|
128
|
+
Key8,
|
|
129
|
+
Key9,
|
|
130
|
+
...AdditionalKeys
|
|
131
|
+
]>>;
|
|
26
132
|
declare function prop<K extends PropertyKey>(key: K): <T extends Partial<Record<K, unknown>>>(data: T) => T[K];
|
|
27
|
-
declare function propImplementation<T, K extends keyof T>(data: T, key: K): T[K];
|
|
28
133
|
|
|
29
|
-
export { prop
|
|
134
|
+
export { prop };
|
package/dist/prop.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"./chunk-RZBBV6PK.js";import"./chunk-EK7ODJWE.js";export{a as prop};
|
package/dist/pull-object.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFGMSPUSFcjs = require('./chunk-FGMSPUSF.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');exports.pullObject = _chunkFGMSPUSFcjs.a;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFGMSPUSFcjs = require('./chunk-FGMSPUSF.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');require('./chunk-MBGSSEZN.cjs');exports.pullObject = _chunkFGMSPUSFcjs.a;
|
package/dist/pull-object.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BoundedPartial } from './bounded-partial-
|
|
1
|
+
import { B as BoundedPartial } from './bounded-partial-BhnecV3P.cjs';
|
|
2
2
|
import { I as IterableContainer } from './iterable-container-BTpDVdNc.cjs';
|
|
3
|
-
import './
|
|
3
|
+
import './is-bounded-record-C9WAwfA8.cjs';
|
|
4
4
|
import 'type-fest';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/pull-object.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BoundedPartial } from './bounded-partial-
|
|
1
|
+
import { B as BoundedPartial } from './bounded-partial-B15MLSAS.js';
|
|
2
2
|
import { I as IterableContainer } from './iterable-container-BTpDVdNc.js';
|
|
3
|
-
import './
|
|
3
|
+
import './is-bounded-record-C9WAwfA8.js';
|
|
4
4
|
import 'type-fest';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/pull-object.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-B6SBIS6W.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";export{a as pullObject};
|
|
1
|
+
import{a}from"./chunk-B6SBIS6W.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";import"./chunk-EK7ODJWE.js";export{a as pullObject};
|
package/dist/random-integer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSJMGQLYScjs = require('./chunk-SJMGQLYS.cjs');exports.randomInteger = _chunkSJMGQLYScjs.a;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSJMGQLYScjs = require('./chunk-SJMGQLYS.cjs');require('./chunk-MBGSSEZN.cjs');exports.randomInteger = _chunkSJMGQLYScjs.a;
|
package/dist/random-integer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-I2Z6A55T.js";export{a as randomInteger};
|
|
1
|
+
import{a}from"./chunk-I2Z6A55T.js";import"./chunk-EK7ODJWE.js";export{a as randomInteger};
|
package/dist/random-string.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk63GGX2BScjs = require('./chunk-63GGX2BS.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');exports.randomString = _chunk63GGX2BScjs.a;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk63GGX2BScjs = require('./chunk-63GGX2BS.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');require('./chunk-MBGSSEZN.cjs');exports.randomString = _chunk63GGX2BScjs.a;
|
package/dist/random-string.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-U6ZJSHFS.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";export{a as randomString};
|
|
1
|
+
import{a}from"./chunk-U6ZJSHFS.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";import"./chunk-EK7ODJWE.js";export{a as randomString};
|
package/dist/range.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAPO7U7HGcjs = require('./chunk-APO7U7HG.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');exports.range = _chunkAPO7U7HGcjs.a;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAPO7U7HGcjs = require('./chunk-APO7U7HG.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');require('./chunk-MBGSSEZN.cjs');exports.range = _chunkAPO7U7HGcjs.a;
|
package/dist/range.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-XWQ3IM2J.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";export{a as range};
|
|
1
|
+
import{a}from"./chunk-XWQ3IM2J.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";import"./chunk-EK7ODJWE.js";export{a as range};
|
package/dist/rank-by.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZLNSRDW7cjs = require('./chunk-ZLNSRDW7.cjs');require('./chunk-EROXO3T4.cjs');exports.rankBy = _chunkZLNSRDW7cjs.a;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZLNSRDW7cjs = require('./chunk-ZLNSRDW7.cjs');require('./chunk-EROXO3T4.cjs');require('./chunk-MBGSSEZN.cjs');exports.rankBy = _chunkZLNSRDW7cjs.a;
|
package/dist/rank-by.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NonEmptyArray } from './non-empty-array-C9Od1wmF.cjs';
|
|
2
1
|
import { O as OrderRule } from './curry-order-rules-BKXCPBNx.cjs';
|
|
2
|
+
import { N as NonEmptyArray } from './non-empty-array-C9Od1wmF.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Calculates the rank of an item in an array based on `rules`. The rank is the position where the item would appear in the sorted array. This function provides an efficient way to determine the rank in *O(n)* time, compared to *O(nlogn)* for the equivalent `sortedIndex(sortBy(data, ...rules), item)`.
|
package/dist/rank-by.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NonEmptyArray } from './non-empty-array-C9Od1wmF.js';
|
|
2
1
|
import { O as OrderRule } from './curry-order-rules-BKXCPBNx.js';
|
|
2
|
+
import { N as NonEmptyArray } from './non-empty-array-C9Od1wmF.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Calculates the rank of an item in an array based on `rules`. The rank is the position where the item would appear in the sorted array. This function provides an efficient way to determine the rank in *O(n)* time, compared to *O(nlogn)* for the equivalent `sortedIndex(sortBy(data, ...rules), item)`.
|
package/dist/rank-by.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-G57ZPKMR.js";import"./chunk-7KBK2RWQ.js";export{a as rankBy};
|
|
1
|
+
import{a}from"./chunk-G57ZPKMR.js";import"./chunk-7KBK2RWQ.js";import"./chunk-EK7ODJWE.js";export{a as rankBy};
|
package/dist/reduce.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkH6WDSTL3cjs = require('./chunk-H6WDSTL3.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');exports.reduce = _chunkH6WDSTL3cjs.a;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkH6WDSTL3cjs = require('./chunk-H6WDSTL3.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');require('./chunk-MBGSSEZN.cjs');exports.reduce = _chunkH6WDSTL3cjs.a;
|
package/dist/reduce.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-IZWZPKOA.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";export{a as reduce};
|
|
1
|
+
import{a}from"./chunk-IZWZPKOA.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";import"./chunk-EK7ODJWE.js";export{a as reduce};
|
package/dist/reverse.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVAU7HZPOcjs = require('./chunk-VAU7HZPO.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');exports.reverse = _chunkVAU7HZPOcjs.a;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVAU7HZPOcjs = require('./chunk-VAU7HZPO.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');require('./chunk-MBGSSEZN.cjs');exports.reverse = _chunkVAU7HZPOcjs.a;
|
package/dist/reverse.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-JNQXGRDN.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";export{a as reverse};
|
|
1
|
+
import{a}from"./chunk-JNQXGRDN.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";import"./chunk-EK7ODJWE.js";export{a as reverse};
|
package/dist/round.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIRWDTBZTcjs = require('./chunk-IRWDTBZT.cjs');require('./chunk-M22GUUVY.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');exports.round = _chunkIRWDTBZTcjs.a;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIRWDTBZTcjs = require('./chunk-IRWDTBZT.cjs');require('./chunk-M22GUUVY.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');require('./chunk-MBGSSEZN.cjs');exports.round = _chunkIRWDTBZTcjs.a;
|
package/dist/round.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-P4HDHWKF.js";import"./chunk-PEJ74NWA.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";export{a as round};
|
|
1
|
+
import{a}from"./chunk-P4HDHWKF.js";import"./chunk-PEJ74NWA.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";import"./chunk-EK7ODJWE.js";export{a as round};
|
package/dist/sample.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkALP5JUXXcjs = require('./chunk-ALP5JUXX.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');require('./chunk-MBGSSEZN.cjs');exports.sample = _chunkALP5JUXXcjs.a;
|
package/dist/sample.d.cts
CHANGED
|
@@ -1,11 +1,35 @@
|
|
|
1
|
+
import { Or, IsEqual, IsNever, NonNegativeInteger, FixedLengthArray, Writable } from 'type-fest';
|
|
2
|
+
import { C as CoercedArray } from './coerced-array-DRz3tqda.cjs';
|
|
1
3
|
import { I as IterableContainer } from './iterable-container-BTpDVdNc.cjs';
|
|
4
|
+
import { N as NTuple } from './n-tuple-5jljrt4c.cjs';
|
|
5
|
+
import { P as PartialArray } from './partial-array-Vnf1fBtl.cjs';
|
|
6
|
+
import { T as TupleParts } from './tuple-parts-v6av7LMU.cjs';
|
|
7
|
+
import './perkakas-type-error-8wPb8T2y.cjs';
|
|
2
8
|
|
|
3
|
-
type Sampled<T extends IterableContainer, N extends number> =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
type Sampled<T extends IterableContainer, N extends number> = Or<IsEqual<N, 0>, IsEqual<T['length'], 0>> extends true ? [] : IsNever<NonNegativeInteger<N>> extends true ? SampledPrimitive<T> : IsLongerThan<T, N> extends true ? SampledLiteral<T, N> : Writable<T>;
|
|
10
|
+
/**
|
|
11
|
+
* When N is not a non-negative integer **literal** we can't use it in our
|
|
12
|
+
* reconstructing logic so we fallback to a simpler definition of the output of
|
|
13
|
+
* sample, which is any sub-tuple shape of T, of **any length**.
|
|
14
|
+
*/
|
|
15
|
+
type SampledPrimitive<T extends IterableContainer> = [
|
|
16
|
+
...FixedSubTuples<TupleParts<T>['required']>,
|
|
17
|
+
...PartialArray<FixedSubTuples<TupleParts<T>['optional']>>,
|
|
18
|
+
...CoercedArray<TupleParts<T>['item']>,
|
|
19
|
+
...FixedSubTuples<TupleParts<T>['suffix']>
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Knowing N is a non-negative literal integer we can construct all sub-tuples
|
|
23
|
+
* of T that are exactly N elements long.
|
|
24
|
+
*/
|
|
25
|
+
type SampledLiteral<T extends IterableContainer, N extends number> = Extract<FixedSubTuples<[
|
|
26
|
+
...TupleParts<T>['required'],
|
|
27
|
+
...(IsNever<TupleParts<T>['item']> extends true ? [] : NTuple<TupleParts<T>['item'], N>),
|
|
28
|
+
...TupleParts<T>['suffix']
|
|
29
|
+
]>, FixedLengthArray<unknown, N>> | SubSampled<TupleParts<T>['required'], TupleParts<T>['item'], TupleParts<T>['suffix'], N>;
|
|
30
|
+
type SubSampled<Prefix extends ReadonlyArray<unknown>, Item, Suffix extends ReadonlyArray<unknown>, N extends number> = IsLongerThan<[...Prefix, ...Suffix], N> extends true ? never : [...Prefix, ...Suffix]['length'] extends N ? never : [...Prefix, ...Suffix] | SubSampled<[...Prefix, Item], Item, Suffix, N>;
|
|
31
|
+
type IsLongerThan<T extends ReadonlyArray<unknown>, N extends number> = IsEqual<T[N], undefined> extends true ? false : true;
|
|
32
|
+
type FixedSubTuples<T> = T extends readonly [infer Head, ...infer Rest] ? FixedSubTuples<Rest> | [Head, ...FixedSubTuples<Rest>] : [];
|
|
9
33
|
/**
|
|
10
34
|
* Returns a random subset of size `sampleSize` from `array`.
|
|
11
35
|
*
|
|
@@ -27,7 +51,7 @@ type SampledLiteral<T extends IterableContainer, N extends number, Iteration ext
|
|
|
27
51
|
* @dataFirst
|
|
28
52
|
* @category Array
|
|
29
53
|
*/
|
|
30
|
-
declare function sample<T extends IterableContainer, N extends number = number>(data: T, sampleSize: N): Sampled<T, N>;
|
|
54
|
+
declare function sample<const T extends IterableContainer, N extends number = number>(data: T, sampleSize: N): Sampled<T, N>;
|
|
31
55
|
/**
|
|
32
56
|
* Returns a random subset of size `sampleSize` from `array`.
|
|
33
57
|
*
|
|
@@ -48,6 +72,6 @@ declare function sample<T extends IterableContainer, N extends number = number>(
|
|
|
48
72
|
* @dataLast
|
|
49
73
|
* @category Array
|
|
50
74
|
*/
|
|
51
|
-
declare function sample<T extends IterableContainer, N extends number = number>(sampleSize: N): (data: T) => Sampled<T, N>;
|
|
75
|
+
declare function sample<const T extends IterableContainer, N extends number = number>(sampleSize: N): (data: T) => Sampled<T, N>;
|
|
52
76
|
|
|
53
77
|
export { sample };
|
package/dist/sample.d.ts
CHANGED
|
@@ -1,11 +1,35 @@
|
|
|
1
|
+
import { Or, IsEqual, IsNever, NonNegativeInteger, FixedLengthArray, Writable } from 'type-fest';
|
|
2
|
+
import { C as CoercedArray } from './coerced-array-DRz3tqda.js';
|
|
1
3
|
import { I as IterableContainer } from './iterable-container-BTpDVdNc.js';
|
|
4
|
+
import { N as NTuple } from './n-tuple-5jljrt4c.js';
|
|
5
|
+
import { P as PartialArray } from './partial-array-Vnf1fBtl.js';
|
|
6
|
+
import { T as TupleParts } from './tuple-parts-BTivqbtT.js';
|
|
7
|
+
import './perkakas-type-error-8wPb8T2y.js';
|
|
2
8
|
|
|
3
|
-
type Sampled<T extends IterableContainer, N extends number> =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
type Sampled<T extends IterableContainer, N extends number> = Or<IsEqual<N, 0>, IsEqual<T['length'], 0>> extends true ? [] : IsNever<NonNegativeInteger<N>> extends true ? SampledPrimitive<T> : IsLongerThan<T, N> extends true ? SampledLiteral<T, N> : Writable<T>;
|
|
10
|
+
/**
|
|
11
|
+
* When N is not a non-negative integer **literal** we can't use it in our
|
|
12
|
+
* reconstructing logic so we fallback to a simpler definition of the output of
|
|
13
|
+
* sample, which is any sub-tuple shape of T, of **any length**.
|
|
14
|
+
*/
|
|
15
|
+
type SampledPrimitive<T extends IterableContainer> = [
|
|
16
|
+
...FixedSubTuples<TupleParts<T>['required']>,
|
|
17
|
+
...PartialArray<FixedSubTuples<TupleParts<T>['optional']>>,
|
|
18
|
+
...CoercedArray<TupleParts<T>['item']>,
|
|
19
|
+
...FixedSubTuples<TupleParts<T>['suffix']>
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Knowing N is a non-negative literal integer we can construct all sub-tuples
|
|
23
|
+
* of T that are exactly N elements long.
|
|
24
|
+
*/
|
|
25
|
+
type SampledLiteral<T extends IterableContainer, N extends number> = Extract<FixedSubTuples<[
|
|
26
|
+
...TupleParts<T>['required'],
|
|
27
|
+
...(IsNever<TupleParts<T>['item']> extends true ? [] : NTuple<TupleParts<T>['item'], N>),
|
|
28
|
+
...TupleParts<T>['suffix']
|
|
29
|
+
]>, FixedLengthArray<unknown, N>> | SubSampled<TupleParts<T>['required'], TupleParts<T>['item'], TupleParts<T>['suffix'], N>;
|
|
30
|
+
type SubSampled<Prefix extends ReadonlyArray<unknown>, Item, Suffix extends ReadonlyArray<unknown>, N extends number> = IsLongerThan<[...Prefix, ...Suffix], N> extends true ? never : [...Prefix, ...Suffix]['length'] extends N ? never : [...Prefix, ...Suffix] | SubSampled<[...Prefix, Item], Item, Suffix, N>;
|
|
31
|
+
type IsLongerThan<T extends ReadonlyArray<unknown>, N extends number> = IsEqual<T[N], undefined> extends true ? false : true;
|
|
32
|
+
type FixedSubTuples<T> = T extends readonly [infer Head, ...infer Rest] ? FixedSubTuples<Rest> | [Head, ...FixedSubTuples<Rest>] : [];
|
|
9
33
|
/**
|
|
10
34
|
* Returns a random subset of size `sampleSize` from `array`.
|
|
11
35
|
*
|
|
@@ -27,7 +51,7 @@ type SampledLiteral<T extends IterableContainer, N extends number, Iteration ext
|
|
|
27
51
|
* @dataFirst
|
|
28
52
|
* @category Array
|
|
29
53
|
*/
|
|
30
|
-
declare function sample<T extends IterableContainer, N extends number = number>(data: T, sampleSize: N): Sampled<T, N>;
|
|
54
|
+
declare function sample<const T extends IterableContainer, N extends number = number>(data: T, sampleSize: N): Sampled<T, N>;
|
|
31
55
|
/**
|
|
32
56
|
* Returns a random subset of size `sampleSize` from `array`.
|
|
33
57
|
*
|
|
@@ -48,6 +72,6 @@ declare function sample<T extends IterableContainer, N extends number = number>(
|
|
|
48
72
|
* @dataLast
|
|
49
73
|
* @category Array
|
|
50
74
|
*/
|
|
51
|
-
declare function sample<T extends IterableContainer, N extends number = number>(sampleSize: N): (data: T) => Sampled<T, N>;
|
|
75
|
+
declare function sample<const T extends IterableContainer, N extends number = number>(sampleSize: N): (data: T) => Sampled<T, N>;
|
|
52
76
|
|
|
53
77
|
export { sample };
|
package/dist/sample.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-4Y6VRHEP.js";import"./chunk-J6WPJH72.js";import"./chunk-KGPDVVVV.js";import"./chunk-EK7ODJWE.js";export{a as sample};
|
package/dist/set-path.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSG2YWG6Ucjs = require('./chunk-SG2YWG6U.cjs');require('./chunk-XR72I63W.cjs');require('./chunk-GZJMERDJ.cjs');require('./chunk-MBGSSEZN.cjs');exports.setPath = _chunkSG2YWG6Ucjs.a;
|