es-toolkit 1.0.3-dev.37 → 1.0.3
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/array/chunk.d.ts +1 -3
- package/dist/array/chunk.spec.d.ts +1 -0
- package/dist/array/difference.d.ts +1 -3
- package/dist/array/difference.spec.d.ts +1 -0
- package/dist/array/differenceBy.d.ts +1 -3
- package/dist/array/differenceBy.spec.d.ts +1 -0
- package/dist/array/differenceWith.d.ts +1 -3
- package/dist/array/differenceWith.spec.d.ts +1 -0
- package/dist/array/drop.d.ts +1 -3
- package/dist/array/drop.spec.d.ts +1 -0
- package/dist/array/dropRight.d.ts +1 -3
- package/dist/array/dropRight.spec.d.ts +1 -0
- package/dist/array/dropRightWhile.d.ts +1 -3
- package/dist/array/dropRightWhile.spec.d.ts +1 -0
- package/dist/array/dropWhile.d.ts +1 -3
- package/dist/array/dropWhile.spec.d.ts +1 -0
- package/dist/array/groupBy.d.ts +1 -3
- package/dist/array/groupBy.spec.d.ts +1 -0
- package/dist/array/index.d.ts +30 -30
- package/dist/array/index.js +842 -199
- package/dist/array/intersection.d.ts +1 -3
- package/dist/array/intersection.spec.d.ts +1 -0
- package/dist/array/intersectionBy.d.ts +1 -3
- package/dist/array/intersectionBy.spec.d.ts +1 -0
- package/dist/array/intersectionWith.d.ts +1 -3
- package/dist/array/intersectionWith.spec.d.ts +1 -0
- package/dist/array/partition.d.ts +1 -3
- package/dist/array/partition.spec.d.ts +1 -0
- package/dist/array/sample.d.ts +1 -3
- package/dist/array/sample.spec.d.ts +1 -0
- package/dist/array/shuffle.d.ts +1 -3
- package/dist/array/shuffle.spec.d.ts +1 -0
- package/dist/array/take.d.ts +1 -3
- package/dist/array/take.spec.d.ts +1 -0
- package/dist/array/takeRight.d.ts +1 -3
- package/dist/array/takeRight.spec.d.ts +1 -0
- package/dist/array/takeRightWhile.d.ts +1 -3
- package/dist/array/takeRightWhile.spec.d.ts +1 -0
- package/dist/array/takeWhile.d.ts +1 -3
- package/dist/array/takeWhile.spec.d.ts +1 -0
- package/dist/array/union.d.ts +1 -3
- package/dist/array/union.spec.d.ts +1 -0
- package/dist/array/unionBy.d.ts +1 -3
- package/dist/array/unionBy.spec.d.ts +1 -0
- package/dist/array/unionWith.d.ts +1 -3
- package/dist/array/unionWith.spec.d.ts +1 -0
- package/dist/array/uniq.d.ts +1 -3
- package/dist/array/uniq.spec.d.ts +1 -0
- package/dist/array/uniqBy.d.ts +1 -3
- package/dist/array/uniqBy.spec.d.ts +1 -0
- package/dist/array/uniqWith.d.ts +1 -3
- package/dist/array/uniqWith.spec.d.ts +1 -0
- package/dist/array/xor.d.ts +1 -3
- package/dist/array/xor.spec.d.ts +1 -0
- package/dist/array/xorBy.d.ts +1 -3
- package/dist/array/xorBy.spec.d.ts +1 -0
- package/dist/array/xorWith.d.ts +1 -3
- package/dist/array/xorWith.spec.d.ts +1 -0
- package/dist/array/zip.d.ts +4 -6
- package/dist/array/zip.spec.d.ts +1 -0
- package/dist/array/zipWith.d.ts +4 -6
- package/dist/array/zipWith.spec.d.ts +1 -0
- package/dist/function/debounce.d.ts +1 -3
- package/dist/function/debounce.spec.d.ts +1 -0
- package/dist/function/index.d.ts +3 -3
- package/dist/function/index.js +78 -47
- package/dist/function/once.d.ts +1 -3
- package/dist/function/once.spec.d.ts +1 -0
- package/dist/function/throttle.d.ts +1 -3
- package/dist/function/throttle.spec.d.ts +1 -0
- package/dist/index.d.ts +6 -45
- package/dist/index.js +1271 -288
- package/dist/math/clamp.d.ts +2 -4
- package/dist/math/clamp.spec.d.ts +1 -0
- package/dist/math/index.d.ts +3 -3
- package/dist/math/index.js +132 -41
- package/dist/math/round.d.ts +1 -3
- package/dist/math/round.spec.d.ts +1 -0
- package/dist/math/sum.d.ts +1 -3
- package/dist/math/sum.spec.d.ts +1 -0
- package/dist/object/index.d.ts +4 -4
- package/dist/object/index.js +256 -62
- package/dist/object/omit.d.ts +1 -3
- package/dist/object/omit.spec.d.ts +1 -0
- package/dist/object/omitBy.d.ts +1 -3
- package/dist/object/omitBy.spec.d.ts +1 -0
- package/dist/object/pick.d.ts +1 -3
- package/dist/object/pick.spec.d.ts +1 -0
- package/dist/object/pickBy.d.ts +1 -3
- package/dist/object/pickBy.spec.d.ts +1 -0
- package/dist/predicate/index.d.ts +4 -4
- package/dist/predicate/index.js +84 -42
- package/dist/predicate/isNil.d.ts +1 -3
- package/dist/predicate/isNil.spec.d.ts +1 -0
- package/dist/predicate/isNotNil.d.ts +1 -3
- package/dist/predicate/isNotNil.spec.d.ts +1 -0
- package/dist/predicate/isNull.d.ts +1 -3
- package/dist/predicate/isNull.spec.d.ts +1 -0
- package/dist/predicate/isUndefined.d.ts +1 -3
- package/dist/predicate/isUndefined.spec.d.ts +1 -0
- package/dist/promise/delay.d.ts +1 -3
- package/dist/promise/delay.spec.d.ts +1 -0
- package/dist/promise/index.d.ts +1 -1
- package/dist/promise/index.js +23 -31
- package/esm/_virtual/_rollupPluginBabelHelpers.mjs +163 -0
- package/esm/array/_virtual/_rollupPluginBabelHelpers.mjs +78 -0
- package/{dist/array/chunk.d.mts → esm/array/chunk.mjs} +13 -1
- package/{dist/array/difference.d.mts → esm/array/difference.mjs} +12 -8
- package/{dist/array/differenceBy.d.mts → esm/array/differenceBy.mjs} +17 -10
- package/{dist/array/differenceWith.d.mts → esm/array/differenceWith.mjs} +12 -6
- package/{dist/array/drop.d.mts → esm/array/drop.mjs} +6 -4
- package/{dist/array/dropRight.d.mts → esm/array/dropRight.mjs} +5 -3
- package/{dist/array/dropRightWhile.d.mts → esm/array/dropRightWhile.mjs} +11 -5
- package/{dist/array/dropWhile.d.mts → esm/array/dropWhile.mjs} +10 -5
- package/{dist/array/groupBy.d.mts → esm/array/groupBy.mjs} +26 -5
- package/{dist/array/intersection.d.mts → esm/array/intersection.mjs} +8 -4
- package/{dist/array/intersectionBy.d.mts → esm/array/intersectionBy.mjs} +12 -5
- package/{dist/array/intersectionWith.d.mts → esm/array/intersectionWith.mjs} +12 -6
- package/{dist/array/partition.d.mts → esm/array/partition.mjs} +30 -8
- package/{dist/array/sample.d.mts → esm/array/sample.mjs} +5 -2
- package/{dist/array/shuffle.d.mts → esm/array/shuffle.mjs} +13 -2
- package/{dist/array/take.d.mts → esm/array/take.mjs} +7 -5
- package/{dist/array/takeRight.d.mts → esm/array/takeRight.mjs} +10 -5
- package/{dist/array/takeRightWhile.d.mts → esm/array/takeRightWhile.mjs} +12 -5
- package/{dist/array/takeWhile.d.mts → esm/array/takeWhile.mjs} +21 -1
- package/{dist/array/union.d.mts → esm/array/union.mjs} +7 -3
- package/{dist/array/unionBy.d.mts → esm/array/unionBy.mjs} +16 -4
- package/{dist/array/unionWith.d.mts → esm/array/unionWith.mjs} +8 -4
- package/esm/array/uniq.mjs +37 -0
- package/{dist/array/uniqBy.d.mts → esm/array/uniqBy.mjs} +7 -1
- package/esm/array/uniqWith.mjs +39 -0
- package/{dist/array/xor.d.mts → esm/array/xor.mjs} +10 -4
- package/{dist/array/xorBy.d.mts → esm/array/xorBy.mjs} +13 -5
- package/{dist/array/xorWith.d.mts → esm/array/xorWith.mjs} +13 -5
- package/esm/array/zip.mjs +52 -0
- package/{dist/array/zipWith.d.mts → esm/array/zipWith.mjs} +26 -6
- package/{dist/function/debounce.d.mts → esm/function/debounce.mjs} +18 -5
- package/{dist/function/once.d.mts → esm/function/once.mjs} +14 -2
- package/{dist/function/throttle.d.mts → esm/function/throttle.mjs} +13 -3
- package/esm/math/_virtual/_rollupPluginBabelHelpers.mjs +66 -0
- package/{dist/math/clamp.d.mts → esm/math/clamp.mjs} +7 -2
- package/{dist/math/round.d.mts → esm/math/round.mjs} +7 -3
- package/esm/math/sum.mjs +33 -0
- package/esm/object/_virtual/_rollupPluginBabelHelpers.mjs +151 -0
- package/{dist/object/omit.d.mts → esm/object/omit.mjs} +19 -2
- package/{dist/object/omitBy.d.mts → esm/object/omitBy.mjs} +18 -4
- package/{dist/object/pick.d.mts → esm/object/pick.mjs} +19 -2
- package/{dist/object/pickBy.d.mts → esm/object/pickBy.mjs} +18 -4
- package/{dist/predicate/isNil.d.mts → esm/predicate/isNil.mjs} +6 -4
- package/{dist/predicate/isNotNil.d.mts → esm/predicate/isNotNil.mjs} +4 -2
- package/{dist/predicate/isNull.d.mts → esm/predicate/isNull.mjs} +6 -4
- package/{dist/predicate/isUndefined.d.mts → esm/predicate/isUndefined.mjs} +6 -4
- package/{dist/promise/delay.d.mts → esm/promise/delay.mjs} +8 -4
- package/package.json +48 -118
- package/dist/array/chunk.js +0 -43
- package/dist/array/chunk.js.map +0 -1
- package/dist/array/chunk.mjs +0 -8
- package/dist/array/chunk.mjs.map +0 -1
- package/dist/array/difference.js +0 -35
- package/dist/array/difference.js.map +0 -1
- package/dist/array/difference.mjs +0 -8
- package/dist/array/difference.mjs.map +0 -1
- package/dist/array/differenceBy.js +0 -36
- package/dist/array/differenceBy.js.map +0 -1
- package/dist/array/differenceBy.mjs +0 -8
- package/dist/array/differenceBy.mjs.map +0 -1
- package/dist/array/differenceWith.js +0 -37
- package/dist/array/differenceWith.js.map +0 -1
- package/dist/array/differenceWith.mjs +0 -8
- package/dist/array/differenceWith.mjs.map +0 -1
- package/dist/array/drop.js +0 -33
- package/dist/array/drop.js.map +0 -1
- package/dist/array/drop.mjs +0 -8
- package/dist/array/drop.mjs.map +0 -1
- package/dist/array/dropRight.js +0 -33
- package/dist/array/dropRight.js.map +0 -1
- package/dist/array/dropRight.mjs +0 -8
- package/dist/array/dropRight.mjs.map +0 -1
- package/dist/array/dropRightWhile.js +0 -43
- package/dist/array/dropRightWhile.js.map +0 -1
- package/dist/array/dropRightWhile.mjs +0 -9
- package/dist/array/dropRightWhile.mjs.map +0 -1
- package/dist/array/dropWhile.js +0 -34
- package/dist/array/dropWhile.js.map +0 -1
- package/dist/array/dropWhile.mjs +0 -8
- package/dist/array/dropWhile.mjs.map +0 -1
- package/dist/array/groupBy.js +0 -41
- package/dist/array/groupBy.js.map +0 -1
- package/dist/array/groupBy.mjs +0 -8
- package/dist/array/groupBy.mjs.map +0 -1
- package/dist/array/index.js.map +0 -1
- package/dist/array/index.mjs +0 -125
- package/dist/array/index.mjs.map +0 -1
- package/dist/array/intersection.js +0 -35
- package/dist/array/intersection.js.map +0 -1
- package/dist/array/intersection.mjs +0 -8
- package/dist/array/intersection.mjs.map +0 -1
- package/dist/array/intersectionBy.js +0 -36
- package/dist/array/intersectionBy.js.map +0 -1
- package/dist/array/intersectionBy.mjs +0 -8
- package/dist/array/intersectionBy.mjs.map +0 -1
- package/dist/array/intersectionWith.js +0 -37
- package/dist/array/intersectionWith.js.map +0 -1
- package/dist/array/intersectionWith.mjs +0 -8
- package/dist/array/intersectionWith.mjs.map +0 -1
- package/dist/array/partition.js +0 -42
- package/dist/array/partition.js.map +0 -1
- package/dist/array/partition.mjs +0 -8
- package/dist/array/partition.mjs.map +0 -1
- package/dist/array/sample.js +0 -34
- package/dist/array/sample.js.map +0 -1
- package/dist/array/sample.mjs +0 -8
- package/dist/array/sample.mjs.map +0 -1
- package/dist/array/shuffle.js +0 -37
- package/dist/array/shuffle.js.map +0 -1
- package/dist/array/shuffle.mjs +0 -8
- package/dist/array/shuffle.mjs.map +0 -1
- package/dist/array/take.js +0 -33
- package/dist/array/take.js.map +0 -1
- package/dist/array/take.mjs +0 -8
- package/dist/array/take.mjs.map +0 -1
- package/dist/array/takeRight.js +0 -36
- package/dist/array/takeRight.js.map +0 -1
- package/dist/array/takeRight.mjs +0 -8
- package/dist/array/takeRight.mjs.map +0 -1
- package/dist/array/takeRightWhile.js +0 -38
- package/dist/array/takeRightWhile.js.map +0 -1
- package/dist/array/takeRightWhile.mjs +0 -8
- package/dist/array/takeRightWhile.mjs.map +0 -1
- package/dist/array/takeWhile.js +0 -40
- package/dist/array/takeWhile.js.map +0 -1
- package/dist/array/takeWhile.mjs +0 -8
- package/dist/array/takeWhile.mjs.map +0 -1
- package/dist/array/union.js +0 -47
- package/dist/array/union.js.map +0 -1
- package/dist/array/union.mjs +0 -9
- package/dist/array/union.mjs.map +0 -1
- package/dist/array/unionBy.js +0 -40
- package/dist/array/unionBy.js.map +0 -1
- package/dist/array/unionBy.mjs +0 -8
- package/dist/array/unionBy.mjs.map +0 -1
- package/dist/array/unionWith.js +0 -47
- package/dist/array/unionWith.js.map +0 -1
- package/dist/array/unionWith.mjs +0 -9
- package/dist/array/unionWith.mjs.map +0 -1
- package/dist/array/uniq.d.mts +0 -17
- package/dist/array/uniq.js +0 -40
- package/dist/array/uniq.js.map +0 -1
- package/dist/array/uniq.mjs +0 -8
- package/dist/array/uniq.mjs.map +0 -1
- package/dist/array/uniqBy.js +0 -47
- package/dist/array/uniqBy.js.map +0 -1
- package/dist/array/uniqBy.mjs +0 -9
- package/dist/array/uniqBy.mjs.map +0 -1
- package/dist/array/uniqWith.d.mts +0 -14
- package/dist/array/uniqWith.js +0 -40
- package/dist/array/uniqWith.js.map +0 -1
- package/dist/array/uniqWith.mjs +0 -8
- package/dist/array/uniqWith.mjs.map +0 -1
- package/dist/array/xor.js +0 -66
- package/dist/array/xor.js.map +0 -1
- package/dist/array/xor.mjs +0 -12
- package/dist/array/xor.mjs.map +0 -1
- package/dist/array/xorBy.js +0 -65
- package/dist/array/xorBy.js.map +0 -1
- package/dist/array/xorBy.mjs +0 -11
- package/dist/array/xorBy.mjs.map +0 -1
- package/dist/array/xorWith.js +0 -72
- package/dist/array/xorWith.js.map +0 -1
- package/dist/array/xorWith.mjs +0 -12
- package/dist/array/xorWith.mjs.map +0 -1
- package/dist/array/zip.d.mts +0 -27
- package/dist/array/zip.js +0 -42
- package/dist/array/zip.js.map +0 -1
- package/dist/array/zip.mjs +0 -8
- package/dist/array/zip.mjs.map +0 -1
- package/dist/array/zipWith.js +0 -41
- package/dist/array/zipWith.js.map +0 -1
- package/dist/array/zipWith.mjs +0 -8
- package/dist/array/zipWith.mjs.map +0 -1
- package/dist/chunk-2KXLTAVK.mjs +0 -16
- package/dist/chunk-2KXLTAVK.mjs.map +0 -1
- package/dist/chunk-2MM5EJJX.mjs +0 -21
- package/dist/chunk-2MM5EJJX.mjs.map +0 -1
- package/dist/chunk-2VB6XU3I.mjs +0 -12
- package/dist/chunk-2VB6XU3I.mjs.map +0 -1
- package/dist/chunk-35TWSMYS.mjs +0 -19
- package/dist/chunk-35TWSMYS.mjs.map +0 -1
- package/dist/chunk-6ZCQ5ZMB.mjs +0 -13
- package/dist/chunk-6ZCQ5ZMB.mjs.map +0 -1
- package/dist/chunk-724PNXPR.mjs +0 -13
- package/dist/chunk-724PNXPR.mjs.map +0 -1
- package/dist/chunk-7GWOR247.mjs +0 -11
- package/dist/chunk-7GWOR247.mjs.map +0 -1
- package/dist/chunk-7KIXZNXS.mjs +0 -21
- package/dist/chunk-7KIXZNXS.mjs.map +0 -1
- package/dist/chunk-7OZZODAE.mjs +0 -19
- package/dist/chunk-7OZZODAE.mjs.map +0 -1
- package/dist/chunk-7PPND7QY.mjs +0 -16
- package/dist/chunk-7PPND7QY.mjs.map +0 -1
- package/dist/chunk-7SJHJHBN.mjs +0 -11
- package/dist/chunk-7SJHJHBN.mjs.map +0 -1
- package/dist/chunk-ARWKEQMQ.mjs +0 -19
- package/dist/chunk-ARWKEQMQ.mjs.map +0 -1
- package/dist/chunk-ARZ5BDR6.mjs +0 -1
- package/dist/chunk-ARZ5BDR6.mjs.map +0 -1
- package/dist/chunk-BAJC3BM7.mjs +0 -12
- package/dist/chunk-BAJC3BM7.mjs.map +0 -1
- package/dist/chunk-EAI6NLXI.mjs +0 -12
- package/dist/chunk-EAI6NLXI.mjs.map +0 -1
- package/dist/chunk-EJGAXTF7.mjs +0 -1
- package/dist/chunk-EJGAXTF7.mjs.map +0 -1
- package/dist/chunk-FUWEG5ZM.mjs +0 -9
- package/dist/chunk-FUWEG5ZM.mjs.map +0 -1
- package/dist/chunk-GJM7F3TH.mjs +0 -13
- package/dist/chunk-GJM7F3TH.mjs.map +0 -1
- package/dist/chunk-HQF6OFGM.mjs +0 -9
- package/dist/chunk-HQF6OFGM.mjs.map +0 -1
- package/dist/chunk-IJLQVGW4.mjs +0 -1
- package/dist/chunk-IJLQVGW4.mjs.map +0 -1
- package/dist/chunk-J3NTLMAE.mjs +0 -10
- package/dist/chunk-J3NTLMAE.mjs.map +0 -1
- package/dist/chunk-L4Y3G6AJ.mjs +0 -23
- package/dist/chunk-L4Y3G6AJ.mjs.map +0 -1
- package/dist/chunk-LAZNLIBJ.mjs +0 -10
- package/dist/chunk-LAZNLIBJ.mjs.map +0 -1
- package/dist/chunk-MAJSPFA6.mjs +0 -1
- package/dist/chunk-MAJSPFA6.mjs.map +0 -1
- package/dist/chunk-NEMQJ2GF.mjs +0 -18
- package/dist/chunk-NEMQJ2GF.mjs.map +0 -1
- package/dist/chunk-NK2262VG.mjs +0 -9
- package/dist/chunk-NK2262VG.mjs.map +0 -1
- package/dist/chunk-NSYWEYWT.mjs +0 -13
- package/dist/chunk-NSYWEYWT.mjs.map +0 -1
- package/dist/chunk-NYVT33DR.mjs +0 -9
- package/dist/chunk-NYVT33DR.mjs.map +0 -1
- package/dist/chunk-O3DWW7O5.mjs +0 -18
- package/dist/chunk-O3DWW7O5.mjs.map +0 -1
- package/dist/chunk-O5YJUO7P.mjs +0 -13
- package/dist/chunk-O5YJUO7P.mjs.map +0 -1
- package/dist/chunk-OBMK7JO2.mjs +0 -13
- package/dist/chunk-OBMK7JO2.mjs.map +0 -1
- package/dist/chunk-OF7HQYH4.mjs +0 -9
- package/dist/chunk-OF7HQYH4.mjs.map +0 -1
- package/dist/chunk-PTQLD7TG.mjs +0 -11
- package/dist/chunk-PTQLD7TG.mjs.map +0 -1
- package/dist/chunk-PWMHSN27.mjs +0 -14
- package/dist/chunk-PWMHSN27.mjs.map +0 -1
- package/dist/chunk-QRQPLMV4.mjs +0 -16
- package/dist/chunk-QRQPLMV4.mjs.map +0 -1
- package/dist/chunk-R5DNKXDI.mjs +0 -21
- package/dist/chunk-R5DNKXDI.mjs.map +0 -1
- package/dist/chunk-RK6PRCEJ.mjs +0 -12
- package/dist/chunk-RK6PRCEJ.mjs.map +0 -1
- package/dist/chunk-RLDY4N3Q.mjs +0 -13
- package/dist/chunk-RLDY4N3Q.mjs.map +0 -1
- package/dist/chunk-RU3RXBUC.mjs +0 -17
- package/dist/chunk-RU3RXBUC.mjs.map +0 -1
- package/dist/chunk-S767XFOS.mjs +0 -10
- package/dist/chunk-S767XFOS.mjs.map +0 -1
- package/dist/chunk-SGSQKXDO.mjs +0 -15
- package/dist/chunk-SGSQKXDO.mjs.map +0 -1
- package/dist/chunk-SYQTG4N4.mjs +0 -1
- package/dist/chunk-SYQTG4N4.mjs.map +0 -1
- package/dist/chunk-T5JCRGXA.mjs +0 -1
- package/dist/chunk-T5JCRGXA.mjs.map +0 -1
- package/dist/chunk-TOLR2FNF.mjs +0 -13
- package/dist/chunk-TOLR2FNF.mjs.map +0 -1
- package/dist/chunk-U42V7PZH.mjs +0 -9
- package/dist/chunk-U42V7PZH.mjs.map +0 -1
- package/dist/chunk-UNX3KZO2.mjs +0 -17
- package/dist/chunk-UNX3KZO2.mjs.map +0 -1
- package/dist/chunk-UZP4YX7I.mjs +0 -17
- package/dist/chunk-UZP4YX7I.mjs.map +0 -1
- package/dist/chunk-VACGGQOL.mjs +0 -9
- package/dist/chunk-VACGGQOL.mjs.map +0 -1
- package/dist/chunk-VAKCSKGR.mjs +0 -17
- package/dist/chunk-VAKCSKGR.mjs.map +0 -1
- package/dist/chunk-XAJYDHCM.mjs +0 -16
- package/dist/chunk-XAJYDHCM.mjs.map +0 -1
- package/dist/chunk-XW452I77.mjs +0 -16
- package/dist/chunk-XW452I77.mjs.map +0 -1
- package/dist/chunk-Z4IO7EIH.mjs +0 -16
- package/dist/chunk-Z4IO7EIH.mjs.map +0 -1
- package/dist/function/debounce.js +0 -47
- package/dist/function/debounce.js.map +0 -1
- package/dist/function/debounce.mjs +0 -8
- package/dist/function/debounce.mjs.map +0 -1
- package/dist/function/index.js.map +0 -1
- package/dist/function/index.mjs +0 -17
- package/dist/function/index.mjs.map +0 -1
- package/dist/function/once.js +0 -43
- package/dist/function/once.js.map +0 -1
- package/dist/function/once.mjs +0 -8
- package/dist/function/once.mjs.map +0 -1
- package/dist/function/throttle.js +0 -41
- package/dist/function/throttle.js.map +0 -1
- package/dist/function/throttle.mjs +0 -8
- package/dist/function/throttle.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -190
- package/dist/index.mjs.map +0 -1
- package/dist/math/clamp.js +0 -36
- package/dist/math/clamp.js.map +0 -1
- package/dist/math/clamp.mjs +0 -8
- package/dist/math/clamp.mjs.map +0 -1
- package/dist/math/index.js.map +0 -1
- package/dist/math/index.mjs +0 -17
- package/dist/math/index.mjs.map +0 -1
- package/dist/math/round.js +0 -34
- package/dist/math/round.js.map +0 -1
- package/dist/math/round.mjs +0 -8
- package/dist/math/round.mjs.map +0 -1
- package/dist/math/sum.d.mts +0 -16
- package/dist/math/sum.js +0 -37
- package/dist/math/sum.js.map +0 -1
- package/dist/math/sum.mjs +0 -8
- package/dist/math/sum.mjs.map +0 -1
- package/dist/object/index.js.map +0 -1
- package/dist/object/index.mjs +0 -21
- package/dist/object/index.mjs.map +0 -1
- package/dist/object/omit.js +0 -51
- package/dist/object/omit.js.map +0 -1
- package/dist/object/omit.mjs +0 -8
- package/dist/object/omit.mjs.map +0 -1
- package/dist/object/omitBy.js +0 -40
- package/dist/object/omitBy.js.map +0 -1
- package/dist/object/omitBy.mjs +0 -8
- package/dist/object/omitBy.mjs.map +0 -1
- package/dist/object/pick.js +0 -37
- package/dist/object/pick.js.map +0 -1
- package/dist/object/pick.mjs +0 -8
- package/dist/object/pick.mjs.map +0 -1
- package/dist/object/pickBy.js +0 -40
- package/dist/object/pickBy.js.map +0 -1
- package/dist/object/pickBy.mjs +0 -8
- package/dist/object/pickBy.mjs.map +0 -1
- package/dist/predicate/index.js.map +0 -1
- package/dist/predicate/index.mjs +0 -21
- package/dist/predicate/index.mjs.map +0 -1
- package/dist/predicate/isNil.js +0 -33
- package/dist/predicate/isNil.js.map +0 -1
- package/dist/predicate/isNil.mjs +0 -8
- package/dist/predicate/isNil.mjs.map +0 -1
- package/dist/predicate/isNotNil.js +0 -33
- package/dist/predicate/isNotNil.js.map +0 -1
- package/dist/predicate/isNotNil.mjs +0 -8
- package/dist/predicate/isNotNil.mjs.map +0 -1
- package/dist/predicate/isNull.js +0 -33
- package/dist/predicate/isNull.js.map +0 -1
- package/dist/predicate/isNull.mjs +0 -8
- package/dist/predicate/isNull.mjs.map +0 -1
- package/dist/predicate/isUndefined.js +0 -33
- package/dist/predicate/isUndefined.js.map +0 -1
- package/dist/predicate/isUndefined.mjs +0 -8
- package/dist/predicate/isUndefined.mjs.map +0 -1
- package/dist/promise/delay.js +0 -35
- package/dist/promise/delay.js.map +0 -1
- package/dist/promise/delay.mjs +0 -8
- package/dist/promise/delay.mjs.map +0 -1
- package/dist/promise/index.js.map +0 -1
- package/dist/promise/index.mjs +0 -9
- package/dist/promise/index.mjs.map +0 -1
- /package/{dist/array/index.d.mts → esm/array/index.mjs} +0 -0
- /package/{dist/function/index.d.mts → esm/function/index.mjs} +0 -0
- /package/{dist/index.d.mts → esm/index.mjs} +0 -0
- /package/{dist/math/index.d.mts → esm/math/index.mjs} +0 -0
- /package/{dist/object/index.d.mts → esm/object/index.mjs} +0 -0
- /package/{dist/predicate/index.d.mts → esm/predicate/index.mjs} +0 -0
- /package/{dist/promise/index.d.mts → esm/promise/index.mjs} +0 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { createForOfIteratorHelper as _createForOfIteratorHelper } from './_virtual/_rollupPluginBabelHelpers.mjs';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Creates a new object composed of the picked object properties.
|
|
3
5
|
*
|
|
4
|
-
* This function takes an object and an array of keys, and returns a new object that
|
|
6
|
+
* This function takes an object and an array of keys, and returns a new object that
|
|
5
7
|
* includes only the properties corresponding to the specified keys.
|
|
6
8
|
*
|
|
7
9
|
* @param {T} obj - The object to pick keys from.
|
|
@@ -13,6 +15,21 @@
|
|
|
13
15
|
* const result = pick(obj, ['a', 'c']);
|
|
14
16
|
* // result will be { a: 1, c: 3 }
|
|
15
17
|
*/
|
|
16
|
-
|
|
18
|
+
function pick(obj, keys) {
|
|
19
|
+
var result = {};
|
|
20
|
+
var _iterator = _createForOfIteratorHelper(keys),
|
|
21
|
+
_step;
|
|
22
|
+
try {
|
|
23
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
24
|
+
var key = _step.value;
|
|
25
|
+
result[key] = obj[key];
|
|
26
|
+
}
|
|
27
|
+
} catch (err) {
|
|
28
|
+
_iterator.e(err);
|
|
29
|
+
} finally {
|
|
30
|
+
_iterator.f();
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
17
34
|
|
|
18
35
|
export { pick };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray } from './_virtual/_rollupPluginBabelHelpers.mjs';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Creates a new object composed of the properties that satisfy the predicate function.
|
|
3
5
|
*
|
|
4
|
-
* This function takes an object and a predicate function, and returns a new object that
|
|
6
|
+
* This function takes an object and a predicate function, and returns a new object that
|
|
5
7
|
* includes only the properties for which the predicate function returns true.
|
|
6
8
|
*
|
|
7
9
|
* @param {T} obj - The object to pick properties from.
|
|
8
|
-
* @param {(value: T[keyof T], key: string) => boolean} shouldPick - A predicate function that determines
|
|
9
|
-
* whether a property should be picked. It takes the property's key and value as arguments and returns `true`
|
|
10
|
+
* @param {(value: T[keyof T], key: string) => boolean} shouldPick - A predicate function that determines
|
|
11
|
+
* whether a property should be picked. It takes the property's key and value as arguments and returns `true`
|
|
10
12
|
* if the property should be picked, and `false` otherwise.
|
|
11
13
|
* @returns {Partial<T>} A new object with the properties that satisfy the predicate function.
|
|
12
14
|
*
|
|
@@ -16,6 +18,18 @@
|
|
|
16
18
|
* const result = pickBy(obj, shouldPick);
|
|
17
19
|
* // result will be { b: 'pick' }
|
|
18
20
|
*/
|
|
19
|
-
|
|
21
|
+
function pickBy(obj, shouldPick) {
|
|
22
|
+
var result = {};
|
|
23
|
+
for (var _i = 0, _Object$entries = Object.entries(obj); _i < _Object$entries.length; _i++) {
|
|
24
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
25
|
+
key = _Object$entries$_i[0],
|
|
26
|
+
value = _Object$entries$_i[1];
|
|
27
|
+
if (!shouldPick(value, key)) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
result[key] = value;
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
20
34
|
|
|
21
35
|
export { pickBy };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks if a given value is null or undefined.
|
|
3
|
-
*
|
|
4
|
-
* This function tests whether the provided value is either `null` or `undefined`.
|
|
3
|
+
*
|
|
4
|
+
* This function tests whether the provided value is either `null` or `undefined`.
|
|
5
5
|
* It returns `true` if the value is `null` or `undefined`, and `false` otherwise.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
7
|
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.
|
|
8
8
|
*
|
|
9
9
|
* @param {unknown} x - The value to test for null or undefined.
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
* const result2 = isNil(value2); // true
|
|
18
18
|
* const result3 = isNil(value3); // false
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
function isNil(x) {
|
|
21
|
+
return x == null || x == undefined;
|
|
22
|
+
}
|
|
21
23
|
|
|
22
24
|
export { isNil };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks if the given value is not null nor undefined.
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* The main use of this function is to be used with TypeScript as a type predicate.
|
|
5
5
|
*
|
|
6
6
|
* @param {T | null | undefined} x - The value to test if it is not null nor undefined.
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* const result = arr.filter(isNotNil);
|
|
14
14
|
* // result will be [1, 3]
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
function isNotNil(x) {
|
|
17
|
+
return x != null && x != undefined;
|
|
18
|
+
}
|
|
17
19
|
|
|
18
20
|
export { isNotNil };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks if the given value is null.
|
|
3
3
|
*
|
|
4
|
-
* This function tests whether the provided value is strictly equal to `null`.
|
|
4
|
+
* This function tests whether the provided value is strictly equal to `null`.
|
|
5
5
|
* It returns `true` if the value is `null`, and `false` otherwise.
|
|
6
6
|
*
|
|
7
7
|
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* @param {unknown} x - The value to test if it is null.
|
|
10
10
|
* @returns {x is null} True if the value is null, false otherwise.
|
|
11
11
|
*
|
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
* * const value1 = null;
|
|
14
14
|
* const value2 = undefined;
|
|
15
15
|
* const value3 = 42;
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
17
|
* console.log(isNull(value1)); // true
|
|
18
18
|
* console.log(isNull(value2)); // false
|
|
19
19
|
* console.log(isNull(value3)); // false
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
function isNull(x) {
|
|
22
|
+
return x === null;
|
|
23
|
+
}
|
|
22
24
|
|
|
23
25
|
export { isNull };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks if the given value is undefined.
|
|
3
3
|
*
|
|
4
|
-
* This function tests whether the provided value is strictly equal to `undefined`.
|
|
4
|
+
* This function tests whether the provided value is strictly equal to `undefined`.
|
|
5
5
|
* It returns `true` if the value is `undefined`, and `false` otherwise.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
7
|
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.
|
|
8
8
|
*
|
|
9
9
|
* @param {unknown} x - The value to test if it is undefined.
|
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
* * const value1 = undefined;
|
|
14
14
|
* const value2 = null;
|
|
15
15
|
* const value3 = 42;
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
17
|
* console.log(isUndefined(value1)); // true
|
|
18
18
|
* console.log(isUndefined(value2)); // false
|
|
19
19
|
* console.log(isUndefined(value3)); // false
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
function isUndefined(x) {
|
|
22
|
+
return x === undefined;
|
|
23
|
+
}
|
|
22
24
|
|
|
23
25
|
export { isUndefined };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Delays the execution of code for a specified number of milliseconds.
|
|
3
|
-
*
|
|
4
|
-
* This function returns a Promise that resolves after the specified delay, allowing you to use it
|
|
3
|
+
*
|
|
4
|
+
* This function returns a Promise that resolves after the specified delay, allowing you to use it
|
|
5
5
|
* with async/await to pause execution.
|
|
6
6
|
*
|
|
7
7
|
* @param {number} ms - The number of milliseconds to delay.
|
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
* await delay(1000); // Delays execution for 1 second
|
|
14
14
|
* console.log('End');
|
|
15
15
|
* }
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
17
|
* foo();
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
function delay(ms) {
|
|
20
|
+
return new Promise(function (resolve) {
|
|
21
|
+
setTimeout(resolve, ms);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
20
24
|
|
|
21
25
|
export { delay };
|
package/package.json
CHANGED
|
@@ -1,163 +1,93 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
3
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
4
|
-
"version": "1.0.3
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"docs"
|
|
7
7
|
],
|
|
8
8
|
"packageManager": "yarn@4.2.2",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
"require": {
|
|
16
|
-
"types": "./dist/index.d.ts",
|
|
17
|
-
"default": "./dist/index.js"
|
|
18
|
-
}
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./esm/index.mjs",
|
|
13
|
+
"require": "./dist/index.js"
|
|
19
14
|
},
|
|
20
15
|
"./array": {
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
"require": {
|
|
26
|
-
"types": "./dist/array/index.d.ts",
|
|
27
|
-
"default": "./dist/array/index.js"
|
|
28
|
-
}
|
|
16
|
+
"types": "./dist/array/index.d.ts",
|
|
17
|
+
"import": "./esm/array/index.mjs",
|
|
18
|
+
"require": "./dist/array/index.js"
|
|
29
19
|
},
|
|
30
20
|
"./function": {
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
"require": {
|
|
36
|
-
"types": "./dist/function/index.d.ts",
|
|
37
|
-
"default": "./dist/function/index.js"
|
|
38
|
-
}
|
|
21
|
+
"types": "./dist/function/index.d.ts",
|
|
22
|
+
"import": "./esm/function/index.mjs",
|
|
23
|
+
"require": "./dist/function/index.js"
|
|
39
24
|
},
|
|
40
25
|
"./math": {
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
"require": {
|
|
46
|
-
"types": "./dist/math/index.d.ts",
|
|
47
|
-
"default": "./dist/math/index.js"
|
|
48
|
-
}
|
|
26
|
+
"types": "./dist/math/index.d.ts",
|
|
27
|
+
"import": "./esm/math/index.mjs",
|
|
28
|
+
"require": "./dist/math/index.js"
|
|
49
29
|
},
|
|
50
30
|
"./object": {
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
"require": {
|
|
56
|
-
"types": "./dist/object/index.d.ts",
|
|
57
|
-
"default": "./dist/object/index.js"
|
|
58
|
-
}
|
|
31
|
+
"types": "./dist/object/index.d.ts",
|
|
32
|
+
"import": "./esm/object/index.mjs",
|
|
33
|
+
"require": "./dist/object/index.js"
|
|
59
34
|
},
|
|
60
35
|
"./predicate": {
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
"require": {
|
|
66
|
-
"types": "./dist/predicate/index.d.ts",
|
|
67
|
-
"default": "./dist/predicate/index.js"
|
|
68
|
-
}
|
|
36
|
+
"types": "./dist/predicate/index.d.ts",
|
|
37
|
+
"import": "./esm/predicate/index.mjs",
|
|
38
|
+
"require": "./dist/predicate/index.js"
|
|
69
39
|
},
|
|
70
40
|
"./promise": {
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
"require": {
|
|
76
|
-
"types": "./dist/promise/index.d.ts",
|
|
77
|
-
"default": "./dist/promise/index.js"
|
|
78
|
-
}
|
|
41
|
+
"types": "./dist/promise/index.d.ts",
|
|
42
|
+
"import": "./esm/promise/index.mjs",
|
|
43
|
+
"require": "./dist/promise/index.js"
|
|
79
44
|
},
|
|
80
45
|
"./package.json": "./package.json"
|
|
81
46
|
},
|
|
82
47
|
"files": [
|
|
83
|
-
"dist",
|
|
48
|
+
"dist/**/*",
|
|
49
|
+
"esm/**/*",
|
|
84
50
|
"*.d.ts"
|
|
85
51
|
],
|
|
86
52
|
"publishConfig": {
|
|
87
53
|
"access": "public",
|
|
88
54
|
"main": "./dist/index.js",
|
|
89
|
-
"module": "./dist/index.mjs",
|
|
90
55
|
"types": "./dist/index.d.ts",
|
|
91
56
|
"exports": {
|
|
92
57
|
".": {
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
"require": {
|
|
98
|
-
"types": "./dist/index.d.ts",
|
|
99
|
-
"default": "./dist/index.js"
|
|
100
|
-
}
|
|
58
|
+
"types": "./dist/index.d.ts",
|
|
59
|
+
"import": "./esm/index.mjs",
|
|
60
|
+
"require": "./dist/index.js"
|
|
101
61
|
},
|
|
102
62
|
"./array": {
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
"require": {
|
|
108
|
-
"types": "./dist/array/index.d.ts",
|
|
109
|
-
"default": "./dist/array/index.js"
|
|
110
|
-
}
|
|
63
|
+
"types": "./dist/array/index.d.ts",
|
|
64
|
+
"import": "./esm/array/index.mjs",
|
|
65
|
+
"require": "./dist/array/index.js"
|
|
111
66
|
},
|
|
112
67
|
"./function": {
|
|
113
|
-
"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
"require": {
|
|
118
|
-
"types": "./dist/function/index.d.ts",
|
|
119
|
-
"default": "./dist/function/index.js"
|
|
120
|
-
}
|
|
68
|
+
"types": "./dist/function/index.d.ts",
|
|
69
|
+
"import": "./esm/function/index.mjs",
|
|
70
|
+
"require": "./dist/function/index.js"
|
|
121
71
|
},
|
|
122
72
|
"./math": {
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
"require": {
|
|
128
|
-
"types": "./dist/math/index.d.ts",
|
|
129
|
-
"default": "./dist/math/index.js"
|
|
130
|
-
}
|
|
73
|
+
"types": "./dist/math/index.d.ts",
|
|
74
|
+
"import": "./esm/math/index.mjs",
|
|
75
|
+
"require": "./dist/math/index.js"
|
|
131
76
|
},
|
|
132
77
|
"./object": {
|
|
133
|
-
"
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
"require": {
|
|
138
|
-
"types": "./dist/object/index.d.ts",
|
|
139
|
-
"default": "./dist/object/index.js"
|
|
140
|
-
}
|
|
78
|
+
"types": "./dist/object/index.d.ts",
|
|
79
|
+
"import": "./esm/object/index.mjs",
|
|
80
|
+
"require": "./dist/object/index.js"
|
|
141
81
|
},
|
|
142
82
|
"./predicate": {
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
},
|
|
147
|
-
"require": {
|
|
148
|
-
"types": "./dist/predicate/index.d.ts",
|
|
149
|
-
"default": "./dist/predicate/index.js"
|
|
150
|
-
}
|
|
83
|
+
"types": "./dist/predicate/index.d.ts",
|
|
84
|
+
"import": "./esm/predicate/index.mjs",
|
|
85
|
+
"require": "./dist/predicate/index.js"
|
|
151
86
|
},
|
|
152
87
|
"./promise": {
|
|
153
|
-
"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
},
|
|
157
|
-
"require": {
|
|
158
|
-
"types": "./dist/promise/index.d.ts",
|
|
159
|
-
"default": "./dist/promise/index.js"
|
|
160
|
-
}
|
|
88
|
+
"types": "./dist/promise/index.d.ts",
|
|
89
|
+
"import": "./esm/promise/index.mjs",
|
|
90
|
+
"require": "./dist/promise/index.js"
|
|
161
91
|
},
|
|
162
92
|
"./package.json": "./package.json"
|
|
163
93
|
}
|
|
@@ -168,6 +98,7 @@
|
|
|
168
98
|
"@babel/preset-typescript": "^7.24.1",
|
|
169
99
|
"@changesets/changelog-github": "^0.5.0",
|
|
170
100
|
"@changesets/cli": "^2.27.1",
|
|
101
|
+
"@toss/rollup-config": "0.2.0-canary.0",
|
|
171
102
|
"@types/babel__core": "^7",
|
|
172
103
|
"@types/babel__preset-env": "^7",
|
|
173
104
|
"@types/broken-link-checker": "^0",
|
|
@@ -181,17 +112,16 @@
|
|
|
181
112
|
"eslint-config-prettier": "^8.5.0",
|
|
182
113
|
"lodash": "^4.17.21",
|
|
183
114
|
"prettier": "^3.2.5",
|
|
184
|
-
"
|
|
115
|
+
"rollup": "^2.78.0",
|
|
185
116
|
"typescript": "^5.4.5",
|
|
186
117
|
"vitest": "^1.5.2"
|
|
187
118
|
},
|
|
188
119
|
"sideEffects": false,
|
|
189
120
|
"scripts": {
|
|
190
121
|
"prepack": "yarn build",
|
|
191
|
-
"build": "
|
|
122
|
+
"build": "rm -rf dist esm && tsc -p tsconfig.json --declaration --emitDeclarationOnly --declarationDir dist && rollup -c rollup.config.js && ./.scripts/postbuild.sh",
|
|
192
123
|
"test": "vitest run --coverage --typecheck"
|
|
193
124
|
},
|
|
194
125
|
"main": "./dist/index.js",
|
|
195
|
-
"module": "./dist/index.mjs",
|
|
196
126
|
"types": "./dist/index.d.ts"
|
|
197
127
|
}
|
package/dist/array/chunk.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/array/chunk.ts
|
|
21
|
-
var chunk_exports = {};
|
|
22
|
-
__export(chunk_exports, {
|
|
23
|
-
chunk: () => chunk
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(chunk_exports);
|
|
26
|
-
function chunk(arr, size) {
|
|
27
|
-
if (!Number.isInteger(size) || size <= 0) {
|
|
28
|
-
throw new Error("Size must be an integer greater than zero.");
|
|
29
|
-
}
|
|
30
|
-
const chunkLength = Math.ceil(arr.length / size);
|
|
31
|
-
const result = Array(chunkLength);
|
|
32
|
-
for (let index = 0; index < chunkLength; index++) {
|
|
33
|
-
const start = index * size;
|
|
34
|
-
const end = start + size;
|
|
35
|
-
result[index] = arr.slice(start, end);
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
chunk
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=chunk.js.map
|
package/dist/array/chunk.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/array/chunk.ts"],"sourcesContent":["/**\n * Splits an array into smaller arrays of a specified length.\n *\n * This function takes an input array and divides it into multiple smaller arrays,\n * each of a specified length. If the input array cannot be evenly divided,\n * the final sub-array will contain the remaining elements.\n *\n * @template T The type of elements in the array.\n * @param {T[]} arr - The array to be chunked into smaller arrays.\n * @param {number} size - The size of each smaller array. Must be a positive integer.\n * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`.\n * @throws {Error} Throws an error if `size` is not a positive integer.\n *\n * @example\n * // Splits an array of numbers into sub-arrays of length 2\n * chunk([1, 2, 3, 4, 5], 2);\n * // Returns: [[1, 2], [3, 4], [5]]\n *\n * @example\n * // Splits an array of strings into sub-arrays of length 3\n * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3);\n * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]\n */\nexport function chunk<T>(arr: T[], size: number): T[][] {\n if (!Number.isInteger(size) || size <= 0) {\n throw new Error('Size must be an integer greater than zero.');\n }\n\n const chunkLength = Math.ceil(arr.length / size);\n const result: T[][] = Array(chunkLength);\n\n for (let index = 0; index < chunkLength; index++) {\n const start = index * size;\n const end = start + size;\n \n result[index] = arr.slice(start, end);\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBO,SAAS,MAAS,KAAU,MAAqB;AACtD,MAAI,CAAC,OAAO,UAAU,IAAI,KAAK,QAAQ,GAAG;AACxC,UAAM,IAAI,MAAM,4CAA4C;AAAA,EAC9D;AAEA,QAAM,cAAc,KAAK,KAAK,IAAI,SAAS,IAAI;AAC/C,QAAM,SAAgB,MAAM,WAAW;AAEvC,WAAS,QAAQ,GAAG,QAAQ,aAAa,SAAS;AAChD,UAAM,QAAQ,QAAQ;AACtB,UAAM,MAAM,QAAQ;AAEpB,WAAO,KAAK,IAAI,IAAI,MAAM,OAAO,GAAG;AAAA,EACtC;AAEA,SAAO;AACT;","names":[]}
|
package/dist/array/chunk.mjs
DELETED
package/dist/array/chunk.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/array/difference.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/array/difference.ts
|
|
21
|
-
var difference_exports = {};
|
|
22
|
-
__export(difference_exports, {
|
|
23
|
-
difference: () => difference
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(difference_exports);
|
|
26
|
-
function difference(firstArr, secondArr) {
|
|
27
|
-
return firstArr.filter((item) => {
|
|
28
|
-
return !secondArr.includes(item);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
difference
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=difference.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/array/difference.ts"],"sourcesContent":["/**\n * Computes the difference between two arrays.\n * \n * This function takes two arrays and returns a new array containing the elements \n * that are present in the first array but not in the second array. It effectively \n * filters out any elements from the first array that also appear in the second array.\n *\n * @template T\n * @param {T[]} firstArr - The array from which to derive the difference. This is the primary array \n * from which elements will be compared and filtered.\n * @param {T[]} secondArr - The array containing elements to be excluded from the first array. \n * Each element in this array will be checked against the first array, and if a match is found, \n * that element will be excluded from the result.\n * @returns {T[]} A new array containing the elements that are present in the first array but not \n * in the second array.\n *\n * @example\n * * const array1 = [1, 2, 3, 4, 5];\n * const array2 = [2, 4];\n * const result = difference(array1, array2);\n * // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result.\n */\nexport function difference<T>(firstArr: T[], secondArr: T[]): T[] {\n return firstArr.filter(item => {\n return !secondArr.includes(item)\n });\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBO,SAAS,WAAc,UAAe,WAAqB;AAChE,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,CAAC,UAAU,SAAS,IAAI;AAAA,EACjC,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/array/differenceBy.ts
|
|
21
|
-
var differenceBy_exports = {};
|
|
22
|
-
__export(differenceBy_exports, {
|
|
23
|
-
differenceBy: () => differenceBy
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(differenceBy_exports);
|
|
26
|
-
function differenceBy(firstArr, secondArr, mapper) {
|
|
27
|
-
const mappedSecondArr = secondArr.map((item) => mapper(item));
|
|
28
|
-
return firstArr.filter((item) => {
|
|
29
|
-
return !mappedSecondArr.includes(mapper(item));
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
differenceBy
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=differenceBy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/array/differenceBy.ts"],"sourcesContent":["/**\n * Computes the difference between two arrays after mapping their elements through a provided function.\n * \n * This function takes two arrays and a mapper function. It returns a new array containing the elements \n * that are present in the first array but not in the second array, based on the identity calculated \n * by the mapper function. \n * \n * Essentially, it filters out any elements from the first array that, when \n * mapped, match an element in the mapped version of the second array.\n *\n * @template T, U\n * @param {T[]} firstArr - The primary array from which to derive the difference. \n * @param {T[]} secondArr - The array containing elements to be excluded from the first array.\n * @param {(value: T) => U} mapper - The function to map the elements of both arrays. This function \n * is applied to each element in both arrays, and the comparison is made based on the mapped values.\n * @returns {T[]} A new array containing the elements from the first array that do not have a corresponding \n * mapped identity in the second array.\n *\n * @example\n * * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }];\n * const array2 = [{ id: 2 }, { id: 4 }];\n * const mapper = item => item.id;\n * const result = differenceBy(array1, array2, mapper);\n * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result.\n */\nexport function differenceBy<T, U>(firstArr: T[], secondArr: T[], mapper: (value: T) => U): T[] {\n const mappedSecondArr = secondArr.map(item => mapper(item));\n \n return firstArr.filter(item => {\n return !mappedSecondArr.includes(mapper(item));\n });\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBO,SAAS,aAAmB,UAAe,WAAgB,QAA8B;AAC9F,QAAM,kBAAkB,UAAU,IAAI,UAAQ,OAAO,IAAI,CAAC;AAE1D,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,CAAC,gBAAgB,SAAS,OAAO,IAAI,CAAC;AAAA,EAC/C,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/array/differenceWith.ts
|
|
21
|
-
var differenceWith_exports = {};
|
|
22
|
-
__export(differenceWith_exports, {
|
|
23
|
-
differenceWith: () => differenceWith
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(differenceWith_exports);
|
|
26
|
-
function differenceWith(firstArr, secondArr, areItemsEqual) {
|
|
27
|
-
return firstArr.filter((firstItem) => {
|
|
28
|
-
return secondArr.every((secondItem) => {
|
|
29
|
-
return !areItemsEqual(firstItem, secondItem);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
differenceWith
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=differenceWith.js.map
|