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
package/dist/math/clamp.d.ts
CHANGED
|
@@ -15,7 +15,5 @@
|
|
|
15
15
|
* const result3 = clamp(2, 5, 15); // result3 will be 5, as 2 is clamped to the lower bound 5
|
|
16
16
|
* const result4 = clamp(20, 5, 15); // result4 will be 15, as 20 is clamped to the upper bound 15
|
|
17
17
|
*/
|
|
18
|
-
declare function clamp(value: number, maximum: number): number;
|
|
19
|
-
declare function clamp(value: number, minimum: number, maximum: number): number;
|
|
20
|
-
|
|
21
|
-
export { clamp };
|
|
18
|
+
export declare function clamp(value: number, maximum: number): number;
|
|
19
|
+
export declare function clamp(value: number, minimum: number, maximum: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/math/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { clamp } from './clamp
|
|
2
|
-
export { round } from './round
|
|
3
|
-
export { sum } from './sum
|
|
1
|
+
export { clamp } from './clamp';
|
|
2
|
+
export { round } from './round';
|
|
3
|
+
export { sum } from './sum';
|
package/dist/math/index.js
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
19
4
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Clamps a number within the inclusive lower and upper bounds.
|
|
7
|
+
*
|
|
8
|
+
* This function takes a number and two bounds, and returns the number clamped within the specified bounds.
|
|
9
|
+
* If only one bound is provided, it returns the minimum of the value and the bound.
|
|
10
|
+
*
|
|
11
|
+
* @param {number} value - The number to clamp.
|
|
12
|
+
* @param {number} minimum - The minimum bound to clamp the number.
|
|
13
|
+
* @param {number} maximum - The maximum bound to clamp the number.
|
|
14
|
+
* @returns {number} The clamped number within the specified bounds.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* * const result1 = clamp(10, 5); // result1 will be 5, as 10 is clamped to the bound 5
|
|
18
|
+
* const result2 = clamp(10, 5, 15); // result2 will be 10, as it is within the bounds 5 and 15
|
|
19
|
+
* const result3 = clamp(2, 5, 15); // result3 will be 5, as 2 is clamped to the lower bound 5
|
|
20
|
+
* const result4 = clamp(20, 5, 15); // result4 will be 15, as 20 is clamped to the upper bound 15
|
|
21
|
+
*/
|
|
28
22
|
|
|
29
|
-
// src/math/clamp.ts
|
|
30
23
|
function clamp(value, bound1, bound2) {
|
|
31
24
|
if (bound2 == null) {
|
|
32
25
|
return Math.min(value, bound1);
|
|
@@ -34,24 +27,122 @@ function clamp(value, bound1, bound2) {
|
|
|
34
27
|
return Math.min(Math.max(value, bound1), bound2);
|
|
35
28
|
}
|
|
36
29
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Rounds a number to a specified precision.
|
|
32
|
+
*
|
|
33
|
+
* This function takes a number and an optional precision value, and returns the number rounded
|
|
34
|
+
* to the specified number of decimal places.
|
|
35
|
+
*
|
|
36
|
+
* @param {number} value - The number to round.
|
|
37
|
+
* @param {number} [precision=0] - The number of decimal places to round to. Defaults to 0.
|
|
38
|
+
* @returns {number} The rounded number.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* * const result1 = round(1.2345); // result1 will be 1
|
|
42
|
+
* const result2 = round(1.2345, 2); // result2 will be 1.23
|
|
43
|
+
* const result3 = round(1.2345, 3); // result3 will be 1.235
|
|
44
|
+
*/
|
|
45
|
+
function round(value) {
|
|
46
|
+
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
47
|
+
var multiplier = Math.pow(10, precision);
|
|
40
48
|
return Math.round(value * multiplier) / multiplier;
|
|
41
49
|
}
|
|
42
50
|
|
|
43
|
-
|
|
51
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
52
|
+
if (!o) return;
|
|
53
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
54
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
55
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
56
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
57
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
58
|
+
}
|
|
59
|
+
function _arrayLikeToArray(arr, len) {
|
|
60
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
61
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
62
|
+
return arr2;
|
|
63
|
+
}
|
|
64
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
65
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
66
|
+
if (!it) {
|
|
67
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
68
|
+
if (it) o = it;
|
|
69
|
+
var i = 0;
|
|
70
|
+
var F = function () {};
|
|
71
|
+
return {
|
|
72
|
+
s: F,
|
|
73
|
+
n: function () {
|
|
74
|
+
if (i >= o.length) return {
|
|
75
|
+
done: true
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
done: false,
|
|
79
|
+
value: o[i++]
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
e: function (e) {
|
|
83
|
+
throw e;
|
|
84
|
+
},
|
|
85
|
+
f: F
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
89
|
+
}
|
|
90
|
+
var normalCompletion = true,
|
|
91
|
+
didErr = false,
|
|
92
|
+
err;
|
|
93
|
+
return {
|
|
94
|
+
s: function () {
|
|
95
|
+
it = it.call(o);
|
|
96
|
+
},
|
|
97
|
+
n: function () {
|
|
98
|
+
var step = it.next();
|
|
99
|
+
normalCompletion = step.done;
|
|
100
|
+
return step;
|
|
101
|
+
},
|
|
102
|
+
e: function (e) {
|
|
103
|
+
didErr = true;
|
|
104
|
+
err = e;
|
|
105
|
+
},
|
|
106
|
+
f: function () {
|
|
107
|
+
try {
|
|
108
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
109
|
+
} finally {
|
|
110
|
+
if (didErr) throw err;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Calculates the sum of an array of numbers.
|
|
118
|
+
*
|
|
119
|
+
* This function takes an array of numbers and returns the sum of all the elements in the array.
|
|
120
|
+
*
|
|
121
|
+
* @param {number[]} nums - An array of numbers to be summed.
|
|
122
|
+
* @returns {number} The sum of all the numbers in the array.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* * const numbers = [1, 2, 3, 4, 5];
|
|
126
|
+
* const result = sum(numbers);
|
|
127
|
+
* // result will be 15
|
|
128
|
+
*/
|
|
44
129
|
function sum(nums) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
130
|
+
var result = 0;
|
|
131
|
+
var _iterator = _createForOfIteratorHelper(nums),
|
|
132
|
+
_step;
|
|
133
|
+
try {
|
|
134
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
135
|
+
var num = _step.value;
|
|
136
|
+
result += num;
|
|
137
|
+
}
|
|
138
|
+
} catch (err) {
|
|
139
|
+
_iterator.e(err);
|
|
140
|
+
} finally {
|
|
141
|
+
_iterator.f();
|
|
48
142
|
}
|
|
49
143
|
return result;
|
|
50
144
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
sum
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=index.js.map
|
|
145
|
+
|
|
146
|
+
exports.clamp = clamp;
|
|
147
|
+
exports.round = round;
|
|
148
|
+
exports.sum = sum;
|
package/dist/math/round.d.ts
CHANGED
|
@@ -13,6 +13,4 @@
|
|
|
13
13
|
* const result2 = round(1.2345, 2); // result2 will be 1.23
|
|
14
14
|
* const result3 = round(1.2345, 3); // result3 will be 1.235
|
|
15
15
|
*/
|
|
16
|
-
declare function round(value: number, precision?: number): number;
|
|
17
|
-
|
|
18
|
-
export { round };
|
|
16
|
+
export declare function round(value: number, precision?: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/math/sum.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/object/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { omit } from './omit
|
|
2
|
-
export { omitBy } from './omitBy
|
|
3
|
-
export { pick } from './pick
|
|
4
|
-
export { pickBy } from './pickBy
|
|
1
|
+
export { omit } from './omit';
|
|
2
|
+
export { omitBy } from './omitBy';
|
|
3
|
+
export { pick } from './pick';
|
|
4
|
+
export { pickBy } from './pickBy';
|
package/dist/object/index.js
CHANGED
|
@@ -1,59 +1,213 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _iterableToArrayLimit(r, l) {
|
|
6
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
7
|
+
if (null != t) {
|
|
8
|
+
var e,
|
|
9
|
+
n,
|
|
10
|
+
i,
|
|
11
|
+
u,
|
|
12
|
+
a = [],
|
|
13
|
+
f = !0,
|
|
14
|
+
o = !1;
|
|
15
|
+
try {
|
|
16
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
17
|
+
if (Object(t) !== t) return;
|
|
18
|
+
f = !1;
|
|
19
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
20
|
+
} catch (r) {
|
|
21
|
+
o = !0, n = r;
|
|
22
|
+
} finally {
|
|
23
|
+
try {
|
|
24
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
25
|
+
} finally {
|
|
26
|
+
if (o) throw n;
|
|
27
|
+
}
|
|
17
28
|
}
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
var __export = (target, all) => {
|
|
21
|
-
for (var name in all)
|
|
22
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
23
|
-
};
|
|
24
|
-
var __copyProps = (to, from, except, desc) => {
|
|
25
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
-
for (let key of __getOwnPropNames(from))
|
|
27
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
29
|
+
return a;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
}
|
|
32
|
+
function ownKeys(e, r) {
|
|
33
|
+
var t = Object.keys(e);
|
|
34
|
+
if (Object.getOwnPropertySymbols) {
|
|
35
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
36
|
+
r && (o = o.filter(function (r) {
|
|
37
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
38
|
+
})), t.push.apply(t, o);
|
|
39
|
+
}
|
|
40
|
+
return t;
|
|
41
|
+
}
|
|
42
|
+
function _objectSpread2(e) {
|
|
43
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
44
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
45
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
46
|
+
_defineProperty(e, r, t[r]);
|
|
47
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
48
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return e;
|
|
52
|
+
}
|
|
53
|
+
function _toPrimitive(t, r) {
|
|
54
|
+
if ("object" != typeof t || !t) return t;
|
|
55
|
+
var e = t[Symbol.toPrimitive];
|
|
56
|
+
if (void 0 !== e) {
|
|
57
|
+
var i = e.call(t, r || "default");
|
|
58
|
+
if ("object" != typeof i) return i;
|
|
59
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
60
|
+
}
|
|
61
|
+
return ("string" === r ? String : Number)(t);
|
|
62
|
+
}
|
|
63
|
+
function _toPropertyKey(t) {
|
|
64
|
+
var i = _toPrimitive(t, "string");
|
|
65
|
+
return "symbol" == typeof i ? i : i + "";
|
|
66
|
+
}
|
|
67
|
+
function _defineProperty(obj, key, value) {
|
|
68
|
+
key = _toPropertyKey(key);
|
|
69
|
+
if (key in obj) {
|
|
70
|
+
Object.defineProperty(obj, key, {
|
|
71
|
+
value: value,
|
|
72
|
+
enumerable: true,
|
|
73
|
+
configurable: true,
|
|
74
|
+
writable: true
|
|
75
|
+
});
|
|
76
|
+
} else {
|
|
77
|
+
obj[key] = value;
|
|
78
|
+
}
|
|
79
|
+
return obj;
|
|
80
|
+
}
|
|
81
|
+
function _slicedToArray(arr, i) {
|
|
82
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
83
|
+
}
|
|
84
|
+
function _arrayWithHoles(arr) {
|
|
85
|
+
if (Array.isArray(arr)) return arr;
|
|
86
|
+
}
|
|
87
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
88
|
+
if (!o) return;
|
|
89
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
90
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
91
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
92
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
93
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
94
|
+
}
|
|
95
|
+
function _arrayLikeToArray(arr, len) {
|
|
96
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
97
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
98
|
+
return arr2;
|
|
99
|
+
}
|
|
100
|
+
function _nonIterableRest() {
|
|
101
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
102
|
+
}
|
|
103
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
104
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
105
|
+
if (!it) {
|
|
106
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
107
|
+
if (it) o = it;
|
|
108
|
+
var i = 0;
|
|
109
|
+
var F = function () {};
|
|
110
|
+
return {
|
|
111
|
+
s: F,
|
|
112
|
+
n: function () {
|
|
113
|
+
if (i >= o.length) return {
|
|
114
|
+
done: true
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
done: false,
|
|
118
|
+
value: o[i++]
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
e: function (e) {
|
|
122
|
+
throw e;
|
|
123
|
+
},
|
|
124
|
+
f: F
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
128
|
+
}
|
|
129
|
+
var normalCompletion = true,
|
|
130
|
+
didErr = false,
|
|
131
|
+
err;
|
|
132
|
+
return {
|
|
133
|
+
s: function () {
|
|
134
|
+
it = it.call(o);
|
|
135
|
+
},
|
|
136
|
+
n: function () {
|
|
137
|
+
var step = it.next();
|
|
138
|
+
normalCompletion = step.done;
|
|
139
|
+
return step;
|
|
140
|
+
},
|
|
141
|
+
e: function (e) {
|
|
142
|
+
didErr = true;
|
|
143
|
+
err = e;
|
|
144
|
+
},
|
|
145
|
+
f: function () {
|
|
146
|
+
try {
|
|
147
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
148
|
+
} finally {
|
|
149
|
+
if (didErr) throw err;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
43
154
|
|
|
44
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Creates a new object with specified keys omitted.
|
|
157
|
+
*
|
|
158
|
+
* This function takes an object and an array of keys, and returns a new object that
|
|
159
|
+
* excludes the properties corresponding to the specified keys.
|
|
160
|
+
*
|
|
161
|
+
* @param {T} obj - The object to omit keys from.
|
|
162
|
+
* @param {K[]} keys - An array of keys to be omitted from the object.
|
|
163
|
+
* @returns {Omit<T, K>} A new object with the specified keys omitted.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* * const obj = { a: 1, b: 2, c: 3 };
|
|
167
|
+
* const result = omit(obj, ['b', 'c']);
|
|
168
|
+
* // result will be { a: 1 }
|
|
169
|
+
*/
|
|
45
170
|
function omit(obj, keys) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
171
|
+
var result = _objectSpread2({}, obj);
|
|
172
|
+
var _iterator = _createForOfIteratorHelper(keys),
|
|
173
|
+
_step;
|
|
174
|
+
try {
|
|
175
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
176
|
+
var key = _step.value;
|
|
177
|
+
delete result[key];
|
|
178
|
+
}
|
|
179
|
+
} catch (err) {
|
|
180
|
+
_iterator.e(err);
|
|
181
|
+
} finally {
|
|
182
|
+
_iterator.f();
|
|
49
183
|
}
|
|
50
184
|
return result;
|
|
51
185
|
}
|
|
52
186
|
|
|
53
|
-
|
|
187
|
+
/**
|
|
188
|
+
* Creates a new object composed of the properties that do not satisfy the predicate function.
|
|
189
|
+
*
|
|
190
|
+
* This function takes an object and a predicate function, and returns a new object that
|
|
191
|
+
* includes only the properties for which the predicate function returns false.
|
|
192
|
+
*
|
|
193
|
+
* @param {T} obj - The object to omit properties from.
|
|
194
|
+
* @param {(value: T[string], key: string) => boolean} shouldOmit - A predicate function that determines
|
|
195
|
+
* whether a property should be omitted. It takes the property's key and value as arguments and returns `true`
|
|
196
|
+
* if the property should be omitted, and `false` otherwise.
|
|
197
|
+
* @returns {Partial<T>} A new object with the properties that do not satisfy the predicate function.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* const obj = { a: 1, b: 'omit', c: 3 };
|
|
201
|
+
* const shouldOmit = (key, value) => typeof value === 'string';
|
|
202
|
+
* const result = omitBy(obj, shouldOmit);
|
|
203
|
+
* // result will be { a: 1, c: 3 }
|
|
204
|
+
*/
|
|
54
205
|
function omitBy(obj, shouldOmit) {
|
|
55
|
-
|
|
56
|
-
for (
|
|
206
|
+
var result = {};
|
|
207
|
+
for (var _i = 0, _Object$entries = Object.entries(obj); _i < _Object$entries.length; _i++) {
|
|
208
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
209
|
+
key = _Object$entries$_i[0],
|
|
210
|
+
value = _Object$entries$_i[1];
|
|
57
211
|
if (shouldOmit(value, key)) {
|
|
58
212
|
continue;
|
|
59
213
|
}
|
|
@@ -62,19 +216,62 @@ function omitBy(obj, shouldOmit) {
|
|
|
62
216
|
return result;
|
|
63
217
|
}
|
|
64
218
|
|
|
65
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Creates a new object composed of the picked object properties.
|
|
221
|
+
*
|
|
222
|
+
* This function takes an object and an array of keys, and returns a new object that
|
|
223
|
+
* includes only the properties corresponding to the specified keys.
|
|
224
|
+
*
|
|
225
|
+
* @param {T} obj - The object to pick keys from.
|
|
226
|
+
* @param {K[]} keys - An array of keys to be picked from the object.
|
|
227
|
+
* @returns {Pick<T, K>} A new object with the specified keys picked.
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* * const obj = { a: 1, b: 2, c: 3 };
|
|
231
|
+
* const result = pick(obj, ['a', 'c']);
|
|
232
|
+
* // result will be { a: 1, c: 3 }
|
|
233
|
+
*/
|
|
66
234
|
function pick(obj, keys) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
235
|
+
var result = {};
|
|
236
|
+
var _iterator = _createForOfIteratorHelper(keys),
|
|
237
|
+
_step;
|
|
238
|
+
try {
|
|
239
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
240
|
+
var key = _step.value;
|
|
241
|
+
result[key] = obj[key];
|
|
242
|
+
}
|
|
243
|
+
} catch (err) {
|
|
244
|
+
_iterator.e(err);
|
|
245
|
+
} finally {
|
|
246
|
+
_iterator.f();
|
|
70
247
|
}
|
|
71
248
|
return result;
|
|
72
249
|
}
|
|
73
250
|
|
|
74
|
-
|
|
251
|
+
/**
|
|
252
|
+
* Creates a new object composed of the properties that satisfy the predicate function.
|
|
253
|
+
*
|
|
254
|
+
* This function takes an object and a predicate function, and returns a new object that
|
|
255
|
+
* includes only the properties for which the predicate function returns true.
|
|
256
|
+
*
|
|
257
|
+
* @param {T} obj - The object to pick properties from.
|
|
258
|
+
* @param {(value: T[keyof T], key: string) => boolean} shouldPick - A predicate function that determines
|
|
259
|
+
* whether a property should be picked. It takes the property's key and value as arguments and returns `true`
|
|
260
|
+
* if the property should be picked, and `false` otherwise.
|
|
261
|
+
* @returns {Partial<T>} A new object with the properties that satisfy the predicate function.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* const obj = { a: 1, b: 'pick', c: 3 };
|
|
265
|
+
* const shouldPick = (value) => typeof value === 'string';
|
|
266
|
+
* const result = pickBy(obj, shouldPick);
|
|
267
|
+
* // result will be { b: 'pick' }
|
|
268
|
+
*/
|
|
75
269
|
function pickBy(obj, shouldPick) {
|
|
76
|
-
|
|
77
|
-
for (
|
|
270
|
+
var result = {};
|
|
271
|
+
for (var _i = 0, _Object$entries = Object.entries(obj); _i < _Object$entries.length; _i++) {
|
|
272
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
273
|
+
key = _Object$entries$_i[0],
|
|
274
|
+
value = _Object$entries$_i[1];
|
|
78
275
|
if (!shouldPick(value, key)) {
|
|
79
276
|
continue;
|
|
80
277
|
}
|
|
@@ -82,11 +279,8 @@ function pickBy(obj, shouldPick) {
|
|
|
82
279
|
}
|
|
83
280
|
return result;
|
|
84
281
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
pickBy
|
|
91
|
-
});
|
|
92
|
-
//# sourceMappingURL=index.js.map
|
|
282
|
+
|
|
283
|
+
exports.omit = omit;
|
|
284
|
+
exports.omitBy = omitBy;
|
|
285
|
+
exports.pick = pick;
|
|
286
|
+
exports.pickBy = pickBy;
|
package/dist/object/omit.d.ts
CHANGED
|
@@ -13,6 +13,4 @@
|
|
|
13
13
|
* const result = omit(obj, ['b', 'c']);
|
|
14
14
|
* // result will be { a: 1 }
|
|
15
15
|
*/
|
|
16
|
-
declare function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
|
|
17
|
-
|
|
18
|
-
export { omit };
|
|
16
|
+
export declare function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/object/omitBy.d.ts
CHANGED
|
@@ -16,6 +16,4 @@
|
|
|
16
16
|
* const result = omitBy(obj, shouldOmit);
|
|
17
17
|
* // result will be { a: 1, c: 3 }
|
|
18
18
|
*/
|
|
19
|
-
declare function omitBy<T extends Record<string, any>>(obj: T, shouldOmit: (value: T[keyof T], key: string) => boolean): Partial<T>;
|
|
20
|
-
|
|
21
|
-
export { omitBy };
|
|
19
|
+
export declare function omitBy<T extends Record<string, any>>(obj: T, shouldOmit: (value: T[keyof T], key: string) => boolean): Partial<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/object/pick.d.ts
CHANGED
|
@@ -13,6 +13,4 @@
|
|
|
13
13
|
* const result = pick(obj, ['a', 'c']);
|
|
14
14
|
* // result will be { a: 1, c: 3 }
|
|
15
15
|
*/
|
|
16
|
-
declare function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
17
|
-
|
|
18
|
-
export { pick };
|
|
16
|
+
export declare function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/object/pickBy.d.ts
CHANGED
|
@@ -16,6 +16,4 @@
|
|
|
16
16
|
* const result = pickBy(obj, shouldPick);
|
|
17
17
|
* // result will be { b: 'pick' }
|
|
18
18
|
*/
|
|
19
|
-
declare function pickBy<T extends Record<string, any>>(obj: T, shouldPick: (value: T[keyof T], key: string) => boolean): Partial<T>;
|
|
20
|
-
|
|
21
|
-
export { pickBy };
|
|
19
|
+
export declare function pickBy<T extends Record<string, any>>(obj: T, shouldPick: (value: T[keyof T], key: string) => boolean): Partial<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { isNil } from './isNil
|
|
2
|
-
export { isNotNil } from './isNotNil
|
|
3
|
-
export { isNull } from './isNull
|
|
4
|
-
export { isUndefined } from './isUndefined
|
|
1
|
+
export { isNil } from './isNil';
|
|
2
|
+
export { isNotNil } from './isNotNil';
|
|
3
|
+
export { isNull } from './isNull';
|
|
4
|
+
export { isUndefined } from './isUndefined';
|