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 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/zip.ts"],"sourcesContent":["/**\n * Combines multiple arrays into a single array of tuples.\n * \n * This function takes multiple arrays and returns a new array where each element is a tuple \n * containing the corresponding elements from the input arrays. If the input arrays are of \n * different lengths, the resulting array will have the length of the longest input array, \n * with undefined values for missing elements.\n *\n * @param {...T[][]} arrs - The arrays to zip together.\n * @returns {T[][]} A new array of tuples containing the corresponding elements from the input arrays.\n *\n * @example\n * const arr1 = [1, 2, 3];\n * const arr2 = ['a', 'b', 'c'];\n * const result = zip(arr1, arr2);\n * // result will be [[1, 'a'], [2, 'b'], [3, 'c']]\n *\n * const arr3 = [true, false];\n * const result2 = zip(arr1, arr2, arr3);\n * // result2 will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]]\n */\nexport function zip<T>(arr1: T[]): [T][];\nexport function zip<T, U>(arr1: T[], arr2: U[]): [T, U][];\nexport function zip<T, U, V>(arr1: T[], arr2: U[], arr3: V[]): [T, U, V][];\nexport function zip<T, U, V, W>(arr1: T[], arr2: U[], arr3: V[], arr4: W[]): [T, U, V, W][];\nexport function zip<T>(...arrs: T[][]): T[][] {\n const result: T[][] = [];\n\n const maxIndex = Math.max(...arrs.map(x => x.length));\n\n for (let i = 0; i < maxIndex; i++) {\n const element: T[] = [];\n\n for (const arr of arrs) {\n element.push(arr[i]);\n }\n\n result.push(element);\n }\n\n return result;\n}\n"],"mappings":";AAyBO,SAAS,OAAU,MAAoB;AAC5C,QAAM,SAAgB,CAAC;AAEvB,QAAM,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,OAAK,EAAE,MAAM,CAAC;AAEpD,WAAS,IAAI,GAAG,IAAI,UAAU,KAAK;AACjC,UAAM,UAAe,CAAC;AAEtB,eAAW,OAAO,MAAM;AACtB,cAAQ,KAAK,IAAI,CAAC,CAAC;AAAA,IACrB;AAEA,WAAO,KAAK,OAAO;AAAA,EACrB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-O5YJUO7P.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
uniqWith
|
|
3
|
-
} from "./chunk-XAJYDHCM.mjs";
|
|
4
|
-
|
|
5
|
-
// src/array/unionWith.ts
|
|
6
|
-
function unionWith(arr1, arr2, areItemsEqual) {
|
|
7
|
-
return uniqWith(arr1.concat(arr2), areItemsEqual);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
unionWith
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-O5YJUO7P.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/unionWith.ts"],"sourcesContent":["import { uniqWith } from \"./uniqWith\";\n\n/**\n * Creates an array of unique values from two given arrays based on a custom equality function.\n * \n * This function takes two arrays and a custom equality function, merges the arrays, and returns \n * a new array containing only the unique values as determined by the custom equality function.\n *\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal. \n * It takes two arguments and returns `true` if the elements are considered equal, and `false` otherwise.\n * @returns {T[]} A new array of unique values based on the custom equality function.\n *\n * @example\n * const array1 = [{ id: 1 }, { id: 2 }];\n * const array2 = [{ id: 2 }, { id: 3 }];\n * const areItemsEqual = (a, b) => a.id === b.id;\n * const result = unionWith(array1, array2, areItemsEqual);\n * // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays\n */\nexport function unionWith<T>(arr1: T[], arr2: T[], areItemsEqual: (item1: T, item2: T) => boolean): T[] {\n return uniqWith(arr1.concat(arr2), areItemsEqual);\n}\n"],"mappings":";;;;;AAqBO,SAAS,UAAa,MAAW,MAAW,eAAqD;AACtG,SAAO,SAAS,KAAK,OAAO,IAAI,GAAG,aAAa;AAClD;","names":[]}
|
package/dist/chunk-OBMK7JO2.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/math/sum.ts"],"sourcesContent":["/**\n * Calculates the sum of an array of numbers.\n * \n * This function takes an array of numbers and returns the sum of all the elements in the array.\n *\n * @param {number[]} nums - An array of numbers to be summed.\n * @returns {number} The sum of all the numbers in the array.\n *\n * @example\n * * const numbers = [1, 2, 3, 4, 5];\n * const result = sum(numbers);\n * // result will be 15\n */\nexport function sum(nums: number[]): number {\n let result = 0;\n\n for (const num of nums) {\n result += num;\n }\n\n return result;\n}\n"],"mappings":";AAaO,SAAS,IAAI,MAAwB;AAC1C,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-OF7HQYH4.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/predicate/isNotNil.ts"],"sourcesContent":["/**\n * Checks if the given value is not null nor undefined.\n * \n * The main use of this function is to be used with TypeScript as a type predicate.\n *\n * @param {T | null | undefined} x - The value to test if it is not null nor undefined.\n * @returns {x is T} True if the value is not null nor undefined, false otherwise.\n *\n * @example\n * // Here the type of `arr` is (number | undefined)[]\n * const arr = [1, undefined, 3];\n * // Here the type of `result` is number[]\n * const result = arr.filter(isNotNil);\n * // result will be [1, 3]\n */\nexport function isNotNil<T>(x: T | null | undefined): x is T {\n return x != null && x != undefined;\n}\n"],"mappings":";AAeO,SAAS,SAAY,GAAiC;AAC3D,SAAO,KAAK,QAAQ,KAAK;AAC3B;","names":[]}
|
package/dist/chunk-PTQLD7TG.mjs
DELETED
|
@@ -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":";AAsBO,SAAS,WAAc,UAAe,WAAqB;AAChE,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,CAAC,UAAU,SAAS,IAAI;AAAA,EACjC,CAAC;AACH;","names":[]}
|
package/dist/chunk-PWMHSN27.mjs
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/array/takeRightWhile.ts
|
|
2
|
-
function takeRightWhile(arr, shouldContinueTaking) {
|
|
3
|
-
for (let i = arr.length - 1; i >= 0; i--) {
|
|
4
|
-
if (!shouldContinueTaking(arr[i])) {
|
|
5
|
-
return arr.slice(i + 1);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return arr.slice();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
takeRightWhile
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=chunk-PWMHSN27.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/takeRightWhile.ts"],"sourcesContent":["/**\n * Takes elements from the end of the array while the predicate function returns `true`.\n * \n * @template T - Type of elements in the input array.\n * \n * @param {T[]} arr - The array to take elements from.\n * @param {function(T): boolean} shouldContinueTaking - The function invoked per element.\n * @returns {T[]} A new array containing the elements taken from the end while the predicate returns `true`.\n * \n * @example\n * // Returns [3, 2, 1]\n * takeRightWhile([5, 4, 3, 2, 1], n => n < 4);\n * \n * @example\n * // Returns []\n * takeRightWhile([1, 2, 3], n => n > 3);\n */\nexport function takeRightWhile<T>(arr: T[], shouldContinueTaking: (item: T) => boolean): T[] {\n for (let i = arr.length - 1; i >= 0; i--) {\n if (!shouldContinueTaking(arr[i])) {\n return arr.slice(i + 1);\n }\n }\n\n return arr.slice();\n}\n"],"mappings":";AAiBO,SAAS,eAAkB,KAAU,sBAAiD;AAC3F,WAAS,IAAI,IAAI,SAAS,GAAG,KAAK,GAAG,KAAK;AACxC,QAAI,CAAC,qBAAqB,IAAI,CAAC,CAAC,GAAG;AACjC,aAAO,IAAI,MAAM,IAAI,CAAC;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,IAAI,MAAM;AACnB;","names":[]}
|
package/dist/chunk-QRQPLMV4.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/array/uniq.ts
|
|
2
|
-
function uniq(arr) {
|
|
3
|
-
const result = [];
|
|
4
|
-
for (const item of arr) {
|
|
5
|
-
if (result.includes(item)) {
|
|
6
|
-
continue;
|
|
7
|
-
}
|
|
8
|
-
result.push(item);
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
uniq
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-QRQPLMV4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/uniq.ts"],"sourcesContent":["/**\n * Creates a duplicate-free version of an array.\n * \n * This function takes an array and returns a new array containing only the unique values \n * from the original array, preserving the order of first occurrence.\n *\n * @param {T[]} arr - The array to process.\n * @returns {T[]} A new array with only unique values from the original array.\n *\n * @example\n * * const array = [1, 2, 2, 3, 4, 4, 5];\n * const result = uniq(array);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function uniq<T>(arr: T[]): T[] {\n const result: T[] = [];\n\n for (const item of arr) {\n if (result.includes(item)) {\n continue;\n }\n\n result.push(item);\n }\n\n return result;\n}\n"],"mappings":";AAcO,SAAS,KAAQ,KAAe;AACrC,QAAM,SAAc,CAAC;AAErB,aAAW,QAAQ,KAAK;AACtB,QAAI,OAAO,SAAS,IAAI,GAAG;AACzB;AAAA,IACF;AAEA,WAAO,KAAK,IAAI;AAAA,EAClB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-R5DNKXDI.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
unionBy
|
|
3
|
-
} from "./chunk-7PPND7QY.mjs";
|
|
4
|
-
import {
|
|
5
|
-
intersectionBy
|
|
6
|
-
} from "./chunk-2VB6XU3I.mjs";
|
|
7
|
-
import {
|
|
8
|
-
differenceBy
|
|
9
|
-
} from "./chunk-EAI6NLXI.mjs";
|
|
10
|
-
|
|
11
|
-
// src/array/xorBy.ts
|
|
12
|
-
function xorBy(arr1, arr2, mapper) {
|
|
13
|
-
const union = unionBy(arr1, arr2, mapper);
|
|
14
|
-
const intersection = intersectionBy(arr1, arr2, mapper);
|
|
15
|
-
return differenceBy(union, intersection, mapper);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
xorBy
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=chunk-R5DNKXDI.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/xorBy.ts"],"sourcesContent":["import { differenceBy } from \"./differenceBy\";\nimport { intersectionBy } from \"./intersectionBy\";\nimport { unionBy } from \"./unionBy\";\n\n/**\n * Computes the symmetric difference between two arrays using a custom mapping function. \n * The symmetric difference is the set of elements which are in either of the arrays, \n * but not in their intersection, determined by the result of the mapping function.\n *\n * @template T - Type of elements in the input arrays.\n * @template U - Type of the values returned by the mapping function.\n * \n * @param {T[]} arr1 - The first array.\n * @param {T[]} arr2 - The second array.\n * @param {function(item: T): U} mapper - The function to map array elements to comparison values.\n * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the values returned by the mapping function.\n * \n * @example\n * // Custom mapping function for objects with an 'id' property\n * const idMapper = obj => obj.id;\n * xorBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper);\n * // Returns [{ id: 1 }, { id: 3 }]\n */\nexport function xorBy<T, U>(arr1: T[], arr2: T[], mapper: (item: T) => U): T[] {\n const union = unionBy(arr1, arr2, mapper);\n const intersection = intersectionBy(arr1, arr2, mapper);\n \n return differenceBy(union, intersection, mapper);\n}\n"],"mappings":";;;;;;;;;;;AAuBO,SAAS,MAAY,MAAW,MAAW,QAA6B;AAC7E,QAAM,QAAQ,QAAQ,MAAM,MAAM,MAAM;AACxC,QAAM,eAAe,eAAe,MAAM,MAAM,MAAM;AAEtD,SAAO,aAAa,OAAO,cAAc,MAAM;AACjD;","names":[]}
|
package/dist/chunk-RK6PRCEJ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/math/clamp.ts"],"sourcesContent":["/**\n * Clamps a number within the inclusive lower and upper bounds.\n *\n * This function takes a number and two bounds, and returns the number clamped within the specified bounds.\n * If only one bound is provided, it returns the minimum of the value and the bound.\n *\n * @param {number} value - The number to clamp.\n * @param {number} minimum - The minimum bound to clamp the number.\n * @param {number} maximum - The maximum bound to clamp the number.\n * @returns {number} The clamped number within the specified bounds.\n *\n * @example\n * * const result1 = clamp(10, 5); // result1 will be 5, as 10 is clamped to the bound 5\n * const result2 = clamp(10, 5, 15); // result2 will be 10, as it is within the bounds 5 and 15\n * const result3 = clamp(2, 5, 15); // result3 will be 5, as 2 is clamped to the lower bound 5\n * const result4 = clamp(20, 5, 15); // result4 will be 15, as 20 is clamped to the upper bound 15\n */\nexport function clamp(value: number, maximum: number): number;\nexport function clamp(value: number, minimum: number, maximum: number): number;\nexport function clamp(value: number, bound1: number, bound2?: number): number {\n if (bound2 == null) {\n return Math.min(value, bound1);\n }\n\n return Math.min(Math.max(value, bound1), bound2);\n}\n"],"mappings":";AAmBO,SAAS,MAAM,OAAe,QAAgB,QAAyB;AAC5E,MAAI,UAAU,MAAM;AAClB,WAAO,KAAK,IAAI,OAAO,MAAM;AAAA,EAC/B;AAEA,SAAO,KAAK,IAAI,KAAK,IAAI,OAAO,MAAM,GAAG,MAAM;AACjD;","names":[]}
|
package/dist/chunk-RLDY4N3Q.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/union.ts"],"sourcesContent":["import { uniq } from \"./uniq\";\n\n/**\n * Creates an array of unique values from all given arrays.\n * \n * This function takes two arrays, merges them into a single array, and returns a new array \n * containing only the unique values from the merged array.\n *\n * @param {T[]} arr1 - The first array to merge and filter for unique values.\n * @param {T[]} arr2 - The second array to merge and filter for unique values.\n * @returns {T[]} A new array of unique values.\n *\n * @example\n * const array1 = [1, 2, 3];\n * const array2 = [3, 4, 5];\n * const result = union(array1, array2);\n * // result will be [1, 2, 3, 4, 5]\n */\nexport function union<T>(arr1: T[], arr2: T[]): T[] {\n return uniq(arr1.concat(arr2));\n}\n"],"mappings":";;;;;AAkBO,SAAS,MAAS,MAAW,MAAgB;AAClD,SAAO,KAAK,KAAK,OAAO,IAAI,CAAC;AAC/B;","names":[]}
|
package/dist/chunk-RU3RXBUC.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// src/array/zipWith.ts
|
|
2
|
-
function zipWith(arr1, ...rest) {
|
|
3
|
-
const arrs = [arr1, ...rest.slice(0, -1)];
|
|
4
|
-
const combine = rest[rest.length - 1];
|
|
5
|
-
const result = [];
|
|
6
|
-
const maxIndex = Math.max(...arrs.map((arr) => arr.length));
|
|
7
|
-
for (let i = 0; i < maxIndex; i++) {
|
|
8
|
-
const elements = arrs.map((arr) => arr[i]);
|
|
9
|
-
result.push(combine(...elements));
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
zipWith
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-RU3RXBUC.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/zipWith.ts"],"sourcesContent":["/**\n * Combines multiple arrays into a single array using a custom combiner function.\n * \n * This function takes multiple arrays and a combiner function, and returns a new array where each element \n * is the result of applying the combiner function to the corresponding elements of the input arrays.\n *\n * @param {T[]} arr1 - The first array to zip.\n * @param {U[]} [arr2] - The second array to zip (optional).\n * @param {V[]} [arr3] - The third array to zip (optional).\n * @param {W[]} [arr4] - The fourth array to zip (optional).\n * @param {function} combine - The combiner function that takes corresponding elements from each array and returns a single value.\n * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays.\n *\n * @example\n * // Example usage with two arrays:\n * const arr1 = [1, 2, 3];\n * const arr2 = [4, 5, 6];\n * const result = zipWith(arr1, arr2, (a, b) => a + b);\n * // result will be [5, 7, 9]\n *\n * @example\n * // Example usage with three arrays:\n * const arr1 = [1, 2];\n * const arr2 = [3, 4];\n * const arr3 = [5, 6];\n * const result = zipWith(arr1, arr2, arr3, (a, b, c) => `${a}${b}${c}`);\n * // result will be [`135`, `246`]\n */\nexport function zipWith<T, R>(arr1: T[], combine: (item: T) => R): R[];\nexport function zipWith<T, U, R>(arr1: T[], arr2: U[], combine: (item1: T, item2: U) => R): R[];\nexport function zipWith<T, U, V, R>(arr1: T[], arr2: U[], arr3: V[], combine: (item1: T, item2: U, item3: V) => R): R[];\nexport function zipWith<T, U, V, W, R>(arr1: T[], arr2: U[], arr3: V[], arr4: W[], combine: (item1: T, item2: U, item3: V, item4: W) => R): R[];\nexport function zipWith<T, R>(arr1: T[], ...rest: any[]): R[] {\n const arrs = [arr1, ...rest.slice(0, -1)];\n const combine = rest[rest.length - 1] as (...items: T[]) => R;\n\n const result: R[] = [];\n const maxIndex = Math.max(...arrs.map(arr => arr.length));\n\n for (let i = 0; i < maxIndex; i++) {\n const elements: T[] = arrs.map(arr => arr[i]);\n result.push(combine(...elements));\n }\n\n return result;\n}"],"mappings":";AAgCO,SAAS,QAAc,SAAc,MAAkB;AAC5D,QAAM,OAAO,CAAC,MAAM,GAAG,KAAK,MAAM,GAAG,EAAE,CAAC;AACxC,QAAM,UAAU,KAAK,KAAK,SAAS,CAAC;AAEpC,QAAM,SAAc,CAAC;AACrB,QAAM,WAAW,KAAK,IAAI,GAAG,KAAK,IAAI,SAAO,IAAI,MAAM,CAAC;AAExD,WAAS,IAAI,GAAG,IAAI,UAAU,KAAK;AACjC,UAAM,WAAgB,KAAK,IAAI,SAAO,IAAI,CAAC,CAAC;AAC5C,WAAO,KAAK,QAAQ,GAAG,QAAQ,CAAC;AAAA,EAClC;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-S767XFOS.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// src/array/dropWhile.ts
|
|
2
|
-
function dropWhile(arr, canContinueDropping) {
|
|
3
|
-
const dropEndIndex = arr.findIndex((item) => !canContinueDropping(item));
|
|
4
|
-
return arr.slice(dropEndIndex);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
dropWhile
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=chunk-S767XFOS.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/dropWhile.ts"],"sourcesContent":["/**\n * Removes elements from the beginning of an array until the predicate returns false.\n * \n * This function iterates over an array and drops elements from the start until the provided \n * predicate function returns false. It then returns a new array with the remaining elements.\n *\n * @param {T[]} arr - The array from which to drop elements.\n * @param {(item: T) => boolean} canContinueDropping - A predicate function that determines \n * whether to continue dropping elements. The function is called with each element, and dropping \n * continues as long as it returns true.\n * @returns {T[]} A new array with the elements remaining after the predicate returns false.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const result = dropWhile(array, x => x < 3);\n * // result will be [3, 4, 5] since elements less than 3 are dropped.\n */\nexport function dropWhile<T>(arr: T[], canContinueDropping: (item: T) => boolean): T[] {\n const dropEndIndex = arr.findIndex(item => !canContinueDropping(item));\n return arr.slice(dropEndIndex);\n}\n"],"mappings":";AAiBO,SAAS,UAAa,KAAU,qBAAgD;AACrF,QAAM,eAAe,IAAI,UAAU,UAAQ,CAAC,oBAAoB,IAAI,CAAC;AACrE,SAAO,IAAI,MAAM,YAAY;AAC/B;","names":[]}
|
package/dist/chunk-SGSQKXDO.mjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
dropWhile
|
|
3
|
-
} from "./chunk-S767XFOS.mjs";
|
|
4
|
-
|
|
5
|
-
// src/array/dropRightWhile.ts
|
|
6
|
-
function dropRightWhile(arr, canContinueDropping) {
|
|
7
|
-
const reversed = arr.slice().reverse();
|
|
8
|
-
const dropped = dropWhile(reversed, canContinueDropping);
|
|
9
|
-
return dropped.slice().reverse();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export {
|
|
13
|
-
dropRightWhile
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=chunk-SGSQKXDO.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/dropRightWhile.ts"],"sourcesContent":["import { dropWhile } from \"./dropWhile\";\n\n/**\n * Removes elements from the end of an array until the predicate returns false.\n * \n * This function iterates over an array from the end and drops elements until the provided \n * predicate function returns false. It then returns a new array with the remaining elements.\n *\n * @param {T[]} arr - The array from which to drop elements.\n * @param {function(item: T): boolean} canContinueDropping - A predicate function that determines \n * whether to continue dropping elements. The function is called with each element from the end, \n * and dropping continues as long as it returns true.\n * @returns {T[]} A new array with the elements remaining after the predicate returns false.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const result = dropRightWhile(array, x => x > 3);\n * // result will be [1, 2, 3] since elements greater than 3 are dropped from the end.\n */\nexport function dropRightWhile<T>(arr: T[], canContinueDropping: (item: T) => boolean) {\n const reversed = arr.slice().reverse();\n const dropped = dropWhile(reversed, canContinueDropping);\n return dropped.slice().reverse();\n}"],"mappings":";;;;;AAmBO,SAAS,eAAkB,KAAU,qBAA2C;AACrF,QAAM,WAAW,IAAI,MAAM,EAAE,QAAQ;AACrC,QAAM,UAAU,UAAU,UAAU,mBAAmB;AACvD,SAAO,QAAQ,MAAM,EAAE,QAAQ;AACjC;","names":[]}
|
package/dist/chunk-SYQTG4N4.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-SYQTG4N4.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-T5JCRGXA.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-T5JCRGXA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/chunk-TOLR2FNF.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/array/shuffle.ts
|
|
2
|
-
function shuffle(arr) {
|
|
3
|
-
for (let i = arr.length - 1; i >= 1; i--) {
|
|
4
|
-
const j = Math.floor(Math.random() * (i + 1));
|
|
5
|
-
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
6
|
-
}
|
|
7
|
-
return arr;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export {
|
|
11
|
-
shuffle
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=chunk-TOLR2FNF.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/shuffle.ts"],"sourcesContent":["/**\n * Randomizes the order of elements in an array using the Fisher-Yates algorithm.\n * \n * This function takes an array and returns a new array with its elements shuffled in a random order.\n *\n * @param {T[]} arr - The array to shuffle.\n * @returns {T[]} A new array with its elements shuffled in random order.\n *\n * @example\n * const array = [1, 2, 3, 4, 5];\n * const shuffledArray = shuffle(array);\n * // shuffledArray will be a new array with elements of array in random order, e.g., [3, 1, 4, 5, 2]\n */\nexport function shuffle<T>(arr: T[]): T[] {\n /**\n * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n for (let i = arr.length - 1; i >= 1; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n \n [arr[i], arr[j]] = [arr[j], arr[i]];\n }\n\n return arr;\n}\n"],"mappings":";AAaO,SAAS,QAAW,KAAe;AAIxC,WAAS,IAAI,IAAI,SAAS,GAAG,KAAK,GAAG,KAAK;AACxC,UAAM,IAAI,KAAK,MAAM,KAAK,OAAO,KAAK,IAAI,EAAE;AAE5C,KAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;AAAA,EACpC;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-U42V7PZH.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/predicate/isNil.ts"],"sourcesContent":["/**\n * Checks if a given value is null or undefined.\n * \n * This function tests whether the provided value is either `null` or `undefined`. \n * It returns `true` if the value is `null` or `undefined`, and `false` otherwise.\n * \n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null` or `undefined`.\n *\n * @param {unknown} x - The value to test for null or undefined.\n * @returns {boolean} `true` if the value is null or undefined, `false` otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * const result1 = isNil(value1); // true\n * const result2 = isNil(value2); // true\n * const result3 = isNil(value3); // false\n */\nexport function isNil(x: unknown): x is null | undefined {\n return x == null || x == undefined;\n}"],"mappings":";AAmBO,SAAS,MAAM,GAAmC;AACvD,SAAO,KAAK,QAAQ,KAAK;AAC3B;","names":[]}
|
package/dist/chunk-UNX3KZO2.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// src/array/groupBy.ts
|
|
2
|
-
function groupBy(arr, getKeyFromItem) {
|
|
3
|
-
const result = {};
|
|
4
|
-
for (const item of arr) {
|
|
5
|
-
const key = getKeyFromItem(item);
|
|
6
|
-
if (result[key] == null) {
|
|
7
|
-
result[key] = [];
|
|
8
|
-
}
|
|
9
|
-
result[key].push(item);
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
groupBy
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-UNX3KZO2.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/groupBy.ts"],"sourcesContent":["/**\n * Groups the elements of an array based on a provided key-generating function.\n * \n * This function takes an array and a function that generates a key from each element. It returns \n * an object where the keys are the generated keys and the values are arrays of elements that share \n * the same key.\n *\n * @param {T[]} arr - The array to group.\n * @param {(item: T) => K} getKeyFromItem - A function that generates a key from an element.\n * @returns {Record<K, T[]>} An object where each key is associated with an array of elements that \n * share that key.\n *\n * @example\n * const array = [\n * { category: 'fruit', name: 'apple' },\n * { category: 'fruit', name: 'banana' },\n * { category: 'vegetable', name: 'carrot' }\n * ];\n * const result = groupBy(array, item => item.category);\n * // result will be:\n * // {\n * // fruit: [\n * // { category: 'fruit', name: 'apple' },\n * // { category: 'fruit', name: 'banana' }\n * // ],\n * // vegetable: [\n * // { category: 'vegetable', name: 'carrot' }\n * // ]\n * // }\n */\nexport function groupBy<T, K extends string>(arr: T[], getKeyFromItem: (item: T) => K): Record<K, T[]> {\n const result = {} as Record<K, T[]>;\n\n for (const item of arr) {\n const key = getKeyFromItem(item);\n\n if (result[key] == null) {\n result[key] = [];\n }\n\n result[key].push(item);\n }\n\n return result;\n}\n"],"mappings":";AA8BO,SAAS,QAA6B,KAAU,gBAAgD;AACrG,QAAM,SAAS,CAAC;AAEhB,aAAW,QAAQ,KAAK;AACtB,UAAM,MAAM,eAAe,IAAI;AAE/B,QAAI,OAAO,GAAG,KAAK,MAAM;AACvB,aAAO,GAAG,IAAI,CAAC;AAAA,IACjB;AAEA,WAAO,GAAG,EAAE,KAAK,IAAI;AAAA,EACvB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-UZP4YX7I.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__spreadValues
|
|
3
|
-
} from "./chunk-2MM5EJJX.mjs";
|
|
4
|
-
|
|
5
|
-
// src/object/omit.ts
|
|
6
|
-
function omit(obj, keys) {
|
|
7
|
-
const result = __spreadValues({}, obj);
|
|
8
|
-
for (const key of keys) {
|
|
9
|
-
delete result[key];
|
|
10
|
-
}
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
omit
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-UZP4YX7I.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/object/omit.ts"],"sourcesContent":["/**\n * Creates a new object with specified keys omitted.\n *\n * This function takes an object and an array of keys, and returns a new object that \n * excludes the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to omit keys from.\n * @param {K[]} keys - An array of keys to be omitted from the object.\n * @returns {Omit<T, K>} A new object with the specified keys omitted.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = omit(obj, ['b', 'c']);\n * // result will be { a: 1 }\n */\nexport function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const result = { ...obj };\n\n for (const key of keys) {\n delete result[key];\n }\n\n return result as Omit<T, K>;\n}\n"],"mappings":";;;;;AAeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-VACGGQOL.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/dropRight.ts"],"sourcesContent":["/**\n * Removes a specified number of elements from the end of an array and returns the rest.\n * \n * This function takes an array and a number, and returns a new array with the specified number \n * of elements removed from the end.\n *\n * @param {T[]} arr - The array from which to drop elements.\n * @param {number} itemsCount - The number of elements to drop from the end of the array.\n * @returns {T[]} A new array with the specified number of elements removed from the end.\n *\n * @example\n * * const array = [1, 2, 3, 4, 5];\n * const result = dropRight(array, 2);\n * // result will be [1, 2, 3] since the last two elements are dropped.\n */\nexport function dropRight<T>(arr: T[], itemsCount: number): T[] {\n return arr.slice(0, -itemsCount);\n}\n"],"mappings":";AAeO,SAAS,UAAa,KAAU,YAAyB;AAC9D,SAAO,IAAI,MAAM,GAAG,CAAC,UAAU;AACjC;","names":[]}
|
package/dist/chunk-VAKCSKGR.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// src/function/throttle.ts
|
|
2
|
-
function throttle(func, throttleMs) {
|
|
3
|
-
let lastCallTime;
|
|
4
|
-
const throttledFunction = function() {
|
|
5
|
-
const now = Date.now();
|
|
6
|
-
if (lastCallTime == null || now - lastCallTime >= throttleMs) {
|
|
7
|
-
lastCallTime = now;
|
|
8
|
-
func();
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
return throttledFunction;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
throttle
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-VAKCSKGR.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/function/throttle.ts"],"sourcesContent":["/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @param {() => void} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {() => void} A new throttled function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n * \n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n * \n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle(func: () => void, throttleMs: number) {\n let lastCallTime: number | null;\n\n const throttledFunction = function () {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func();\n }\n }\n\n return throttledFunction;\n}"],"mappings":";AAyBO,SAAS,SAAS,MAAkB,YAAoB;AAC7D,MAAI;AAEJ,QAAM,oBAAoB,WAAY;AACpC,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK;AAAA,IACP;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-XAJYDHCM.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/array/uniqWith.ts
|
|
2
|
-
function uniqWith(arr, areItemsEqual) {
|
|
3
|
-
const result = [];
|
|
4
|
-
for (const item of arr) {
|
|
5
|
-
const isUniq = result.every((v) => !areItemsEqual(v, item));
|
|
6
|
-
if (isUniq) {
|
|
7
|
-
result.push(item);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
uniqWith
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-XAJYDHCM.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/uniqWith.ts"],"sourcesContent":["import { uniq } from \"./uniq\";\n\n/**\n * The `uniqWith` function takes an array as its first argument and a 'comparator' function as the second.\n *\n * It evaluates the elements of the array using the comparator function, and if true is returned, it considers those elements as duplicates and removes them.\n *\n * @example\n * ```ts\n * uniqWith([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], (a, b) => Math.abs(a - b) < 1);\n * // [1, 2, 3, 5, 7]\n * ```\n */\nexport function uniqWith<T>(\n arr: T[],\n areItemsEqual: (item1: T, item2: T) => boolean\n): T[] {\n const result: T[] = [];\n\n for (const item of arr) {\n const isUniq = result.every((v) => !areItemsEqual(v, item));\n\n if (isUniq) {\n result.push(item);\n }\n }\n\n return result;\n}\n"],"mappings":";AAaO,SAAS,SACd,KACA,eACK;AACL,QAAM,SAAc,CAAC;AAErB,aAAW,QAAQ,KAAK;AACtB,UAAM,SAAS,OAAO,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC;AAE1D,QAAI,QAAQ;AACV,aAAO,KAAK,IAAI;AAAA,IAClB;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-XW452I77.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/object/pickBy.ts
|
|
2
|
-
function pickBy(obj, shouldPick) {
|
|
3
|
-
const result = {};
|
|
4
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
5
|
-
if (!shouldPick(value, key)) {
|
|
6
|
-
continue;
|
|
7
|
-
}
|
|
8
|
-
result[key] = value;
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
pickBy
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-XW452I77.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/object/pickBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that \n * includes only the properties for which the predicate function returns true.\n *\n * @param {T} obj - The object to pick properties from.\n * @param {(value: T[keyof T], key: string) => boolean} shouldPick - A predicate function that determines \n * whether a property should be picked. It takes the property's key and value as arguments and returns `true` \n * if the property should be picked, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'pick', c: 3 };\n * const shouldPick = (value) => typeof value === 'string';\n * const result = pickBy(obj, shouldPick);\n * // result will be { b: 'pick' }\n */\nexport function pickBy<T extends Record<string, any>>(obj: T, shouldPick: (value: T[keyof T], key: string) => boolean): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (!shouldPick(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}\n"],"mappings":";AAkBO,SAAS,OAAsC,KAAQ,YAAqE;AACjI,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,CAAC,WAAW,OAAO,GAAG,GAAG;AAC3B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-Z4IO7EIH.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// src/object/omitBy.ts
|
|
2
|
-
function omitBy(obj, shouldOmit) {
|
|
3
|
-
const result = {};
|
|
4
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
5
|
-
if (shouldOmit(value, key)) {
|
|
6
|
-
continue;
|
|
7
|
-
}
|
|
8
|
-
result[key] = value;
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
omitBy
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-Z4IO7EIH.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/object/omitBy.ts"],"sourcesContent":["/**\n * Creates a new object composed of the properties that do not satisfy the predicate function.\n *\n * This function takes an object and a predicate function, and returns a new object that \n * includes only the properties for which the predicate function returns false.\n *\n * @param {T} obj - The object to omit properties from.\n * @param {(value: T[string], key: string) => boolean} shouldOmit - A predicate function that determines \n * whether a property should be omitted. It takes the property's key and value as arguments and returns `true` \n * if the property should be omitted, and `false` otherwise.\n * @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.\n *\n * @example\n * const obj = { a: 1, b: 'omit', c: 3 };\n * const shouldOmit = (key, value) => typeof value === 'string';\n * const result = omitBy(obj, shouldOmit);\n * // result will be { a: 1, c: 3 }\n */\nexport function omitBy<T extends Record<string, any>>(obj: T, shouldOmit: (value: T[keyof T], key: string) => boolean): Partial<T> {\n const result: Partial<T> = {};\n\n for (const [key, value] of Object.entries(obj)) {\n if (shouldOmit(value, key)) {\n continue;\n }\n\n (result as any)[key] = value;\n }\n\n return result;\n}"],"mappings":";AAkBO,SAAS,OAAsC,KAAQ,YAAqE;AACjI,QAAM,SAAqB,CAAC;AAE5B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAAG,GAAG;AAC9C,QAAI,WAAW,OAAO,GAAG,GAAG;AAC1B;AAAA,IACF;AAEA,IAAC,OAAe,GAAG,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,47 +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/function/debounce.ts
|
|
21
|
-
var debounce_exports = {};
|
|
22
|
-
__export(debounce_exports, {
|
|
23
|
-
debounce: () => debounce
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(debounce_exports);
|
|
26
|
-
function debounce(func, debounceMs) {
|
|
27
|
-
let timeoutId = null;
|
|
28
|
-
const debounced = function() {
|
|
29
|
-
if (timeoutId != null) {
|
|
30
|
-
clearTimeout(timeoutId);
|
|
31
|
-
}
|
|
32
|
-
timeoutId = setTimeout(() => {
|
|
33
|
-
func();
|
|
34
|
-
}, debounceMs);
|
|
35
|
-
};
|
|
36
|
-
debounced.cancel = function() {
|
|
37
|
-
if (timeoutId != null) {
|
|
38
|
-
clearTimeout(timeoutId);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
return debounced;
|
|
42
|
-
}
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
debounce
|
|
46
|
-
});
|
|
47
|
-
//# sourceMappingURL=debounce.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/function/debounce.ts"],"sourcesContent":["/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @param {() => void} func - The function to debounce.\n * @param {number} debounceMs - The number of milliseconds to delay.\n * @returns {{ (): void; cancel: () => void }} A new debounced function with a `cancel` method.\n *\n * @example\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n * \n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n */\nexport function debounce(func: () => void, debounceMs: number): { (): void; cancel: () => void } {\n let timeoutId: number | NodeJS.Timeout | null = null;\n\n const debounced = function () {\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n }\n \n \n timeoutId = setTimeout(() => {\n func();\n }, debounceMs);\n };\n\n debounced.cancel = function () {\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n }\n } \n\n return debounced;\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,SAAS,MAAkB,YAAsD;AAC/F,MAAI,YAA4C;AAEhD,QAAM,YAAY,WAAY;AAC5B,QAAI,aAAa,MAAM;AACrB,mBAAa,SAAS;AAAA,IACxB;AAGA,gBAAY,WAAW,MAAM;AAC3B,WAAK;AAAA,IACP,GAAG,UAAU;AAAA,EACf;AAEA,YAAU,SAAS,WAAY;AAC7B,QAAI,aAAa,MAAM;AACrB,mBAAa,SAAS;AAAA,IACxB;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/function/index.ts","../../src/function/debounce.ts","../../src/function/once.ts","../../src/function/throttle.ts"],"sourcesContent":["export { debounce } from './debounce';\nexport { once } from './once';\nexport { throttle } from './throttle';","/**\n * Creates a debounced function that delays invoking the provided function until after `debounceMs` milliseconds\n * have elapsed since the last time the debounced function was invoked. The debounced function also has a `cancel`\n * method to cancel any pending execution.\n *\n * @param {() => void} func - The function to debounce.\n * @param {number} debounceMs - The number of milliseconds to delay.\n * @returns {{ (): void; cancel: () => void }} A new debounced function with a `cancel` method.\n *\n * @example\n * const debouncedFunction = debounce(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' after 1 second if not called again in that time\n * debouncedFunction();\n * \n * // Will not log anything as the previous call is canceled\n * debouncedFunction.cancel();\n */\nexport function debounce(func: () => void, debounceMs: number): { (): void; cancel: () => void } {\n let timeoutId: number | NodeJS.Timeout | null = null;\n\n const debounced = function () {\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n }\n \n \n timeoutId = setTimeout(() => {\n func();\n }, debounceMs);\n };\n\n debounced.cancel = function () {\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n }\n } \n\n return debounced;\n}","/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n * \n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n","/**\n * Creates a throttled function that only invokes the provided function at most once\n * per every `throttleMs` milliseconds. Subsequent calls to the throttled function\n * within the wait time will not trigger the execution of the original function.\n *\n * @param {() => void} func - The function to throttle.\n * @param {number} throttleMs - The number of milliseconds to throttle executions to.\n * @returns {() => void} A new throttled function.\n *\n * @example\n * const throttledFunction = throttle(() => {\n * console.log('Function executed');\n * }, 1000);\n *\n * // Will log 'Function executed' immediately\n * throttledFunction();\n * \n * // Will not log anything as it is within the throttle time\n * throttledFunction();\n * \n * // After 1 second\n * setTimeout(() => {\n * throttledFunction(); // Will log 'Function executed'\n * }, 1000);\n */\nexport function throttle(func: () => void, throttleMs: number) {\n let lastCallTime: number | null;\n\n const throttledFunction = function () {\n const now = Date.now();\n\n if (lastCallTime == null || now - lastCallTime >= throttleMs) {\n lastCallTime = now;\n func();\n }\n }\n\n return throttledFunction;\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACoBO,SAAS,SAAS,MAAkB,YAAsD;AAC/F,MAAI,YAA4C;AAEhD,QAAM,YAAY,WAAY;AAC5B,QAAI,aAAa,MAAM;AACrB,mBAAa,SAAS;AAAA,IACxB;AAGA,gBAAY,WAAW,MAAM;AAC3B,WAAK;AAAA,IACP,GAAG,UAAU;AAAA,EACf;AAEA,YAAU,SAAS,WAAY;AAC7B,QAAI,aAAa,MAAM;AACrB,mBAAa,SAAS;AAAA,IACxB;AAAA,EACF;AAEA,SAAO;AACT;;;ACzBO,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;;;ACPO,SAAS,SAAS,MAAkB,YAAoB;AAC7D,MAAI;AAEJ,QAAM,oBAAoB,WAAY;AACpC,UAAM,MAAM,KAAK,IAAI;AAErB,QAAI,gBAAgB,QAAQ,MAAM,gBAAgB,YAAY;AAC5D,qBAAe;AACf,WAAK;AAAA,IACP;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/function/index.mjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import "../chunk-SYQTG4N4.mjs";
|
|
2
|
-
import {
|
|
3
|
-
debounce
|
|
4
|
-
} from "../chunk-L4Y3G6AJ.mjs";
|
|
5
|
-
import {
|
|
6
|
-
once
|
|
7
|
-
} from "../chunk-ARWKEQMQ.mjs";
|
|
8
|
-
import {
|
|
9
|
-
throttle
|
|
10
|
-
} from "../chunk-VAKCSKGR.mjs";
|
|
11
|
-
import "../chunk-2MM5EJJX.mjs";
|
|
12
|
-
export {
|
|
13
|
-
debounce,
|
|
14
|
-
once,
|
|
15
|
-
throttle
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/function/once.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/function/once.ts
|
|
21
|
-
var once_exports = {};
|
|
22
|
-
__export(once_exports, {
|
|
23
|
-
once: () => once
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(once_exports);
|
|
26
|
-
function once(func) {
|
|
27
|
-
let called = false;
|
|
28
|
-
let cache;
|
|
29
|
-
return function() {
|
|
30
|
-
if (called) {
|
|
31
|
-
return cache;
|
|
32
|
-
}
|
|
33
|
-
const result = func();
|
|
34
|
-
called = true;
|
|
35
|
-
cache = result;
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
once
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=once.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/function/once.ts"],"sourcesContent":["/**\n * Creates a function that is restricted to invoking the provided function `func` once.\n * Repeated calls to the function will return the value from the first invocation.\n *\n * @param {F} func - The function to restrict.\n * @returns {F} A new function that invokes `func` once and caches the result.\n *\n * @example\n * const initialize = once(() => {\n * console.log('Initialized!');\n * return true;\n * });\n * \n * initialize(); // Logs: 'Initialized!' and returns true\n * initialize(); // Returns true without logging\n */\nexport function once<F extends () => any>(func: F): F {\n let called = false;\n let cache: ReturnType<F> | undefined;\n\n return function () {\n if (called) {\n return cache;\n }\n\n const result = func();\n\n called = true;\n cache = result;\n\n return result;\n } as F;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBO,SAAS,KAA0B,MAAY;AACpD,MAAI,SAAS;AACb,MAAI;AAEJ,SAAO,WAAY;AACjB,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AAEA,UAAM,SAAS,KAAK;AAEpB,aAAS;AACT,YAAQ;AAER,WAAO;AAAA,EACT;AACF;","names":[]}
|