es-toolkit 1.0.3 → 1.0.4-dev.39
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/CHANGELOG.md +6 -0
- package/{esm/array/chunk.mjs → dist/array/chunk.d.mts} +1 -13
- package/dist/array/chunk.d.ts +3 -1
- package/dist/array/chunk.js +43 -0
- package/dist/array/chunk.js.map +1 -0
- package/dist/array/chunk.mjs +8 -0
- package/dist/array/chunk.mjs.map +1 -0
- package/{esm/array/difference.mjs → dist/array/difference.d.mts} +8 -12
- package/dist/array/difference.d.ts +3 -1
- package/dist/array/difference.js +35 -0
- package/dist/array/difference.js.map +1 -0
- package/dist/array/difference.mjs +8 -0
- package/dist/array/difference.mjs.map +1 -0
- package/{esm/array/differenceBy.mjs → dist/array/differenceBy.d.mts} +10 -17
- package/dist/array/differenceBy.d.ts +3 -1
- package/dist/array/differenceBy.js +36 -0
- package/dist/array/differenceBy.js.map +1 -0
- package/dist/array/differenceBy.mjs +8 -0
- package/dist/array/differenceBy.mjs.map +1 -0
- package/{esm/array/differenceWith.mjs → dist/array/differenceWith.d.mts} +6 -12
- package/dist/array/differenceWith.d.ts +3 -1
- package/dist/array/differenceWith.js +37 -0
- package/dist/array/differenceWith.js.map +1 -0
- package/dist/array/differenceWith.mjs +8 -0
- package/dist/array/differenceWith.mjs.map +1 -0
- package/{esm/array/drop.mjs → dist/array/drop.d.mts} +4 -6
- package/dist/array/drop.d.ts +3 -1
- package/dist/array/drop.js +33 -0
- package/dist/array/drop.js.map +1 -0
- package/dist/array/drop.mjs +8 -0
- package/dist/array/drop.mjs.map +1 -0
- package/{esm/array/dropRight.mjs → dist/array/dropRight.d.mts} +3 -5
- package/dist/array/dropRight.d.ts +3 -1
- package/dist/array/dropRight.js +33 -0
- package/dist/array/dropRight.js.map +1 -0
- package/dist/array/dropRight.mjs +8 -0
- package/dist/array/dropRight.mjs.map +1 -0
- package/{esm/array/dropRightWhile.mjs → dist/array/dropRightWhile.d.mts} +5 -11
- package/dist/array/dropRightWhile.d.ts +3 -1
- package/dist/array/dropRightWhile.js +43 -0
- package/dist/array/dropRightWhile.js.map +1 -0
- package/dist/array/dropRightWhile.mjs +9 -0
- package/dist/array/dropRightWhile.mjs.map +1 -0
- package/{esm/array/dropWhile.mjs → dist/array/dropWhile.d.mts} +5 -10
- package/dist/array/dropWhile.d.ts +3 -1
- package/dist/array/dropWhile.js +34 -0
- package/dist/array/dropWhile.js.map +1 -0
- package/dist/array/dropWhile.mjs +8 -0
- package/dist/array/dropWhile.mjs.map +1 -0
- package/{esm/array/groupBy.mjs → dist/array/groupBy.d.mts} +5 -26
- package/dist/array/groupBy.d.ts +3 -1
- package/dist/array/groupBy.js +41 -0
- package/dist/array/groupBy.js.map +1 -0
- package/dist/array/groupBy.mjs +8 -0
- package/dist/array/groupBy.mjs.map +1 -0
- package/dist/array/index.d.ts +30 -30
- package/dist/array/index.js +199 -842
- package/dist/array/index.js.map +1 -0
- package/dist/array/index.mjs +125 -0
- package/dist/array/index.mjs.map +1 -0
- package/{esm/array/intersection.mjs → dist/array/intersection.d.mts} +4 -8
- package/dist/array/intersection.d.ts +3 -1
- package/dist/array/intersection.js +35 -0
- package/dist/array/intersection.js.map +1 -0
- package/dist/array/intersection.mjs +8 -0
- package/dist/array/intersection.mjs.map +1 -0
- package/{esm/array/intersectionBy.mjs → dist/array/intersectionBy.d.mts} +5 -12
- package/dist/array/intersectionBy.d.ts +3 -1
- package/dist/array/intersectionBy.js +36 -0
- package/dist/array/intersectionBy.js.map +1 -0
- package/dist/array/intersectionBy.mjs +8 -0
- package/dist/array/intersectionBy.mjs.map +1 -0
- package/{esm/array/intersectionWith.mjs → dist/array/intersectionWith.d.mts} +6 -12
- package/dist/array/intersectionWith.d.ts +3 -1
- package/dist/array/intersectionWith.js +37 -0
- package/dist/array/intersectionWith.js.map +1 -0
- package/dist/array/intersectionWith.mjs +8 -0
- package/dist/array/intersectionWith.mjs.map +1 -0
- package/{esm/array/partition.mjs → dist/array/partition.d.mts} +8 -30
- package/dist/array/partition.d.ts +3 -1
- package/dist/array/partition.js +42 -0
- package/dist/array/partition.js.map +1 -0
- package/dist/array/partition.mjs +8 -0
- package/dist/array/partition.mjs.map +1 -0
- package/{esm/array/sample.mjs → dist/array/sample.d.mts} +2 -5
- package/dist/array/sample.d.ts +3 -1
- package/dist/array/sample.js +34 -0
- package/dist/array/sample.js.map +1 -0
- package/dist/array/sample.mjs +8 -0
- package/dist/array/sample.mjs.map +1 -0
- package/{esm/array/shuffle.mjs → dist/array/shuffle.d.mts} +2 -13
- package/dist/array/shuffle.d.ts +3 -1
- package/dist/array/shuffle.js +37 -0
- package/dist/array/shuffle.js.map +1 -0
- package/dist/array/shuffle.mjs +8 -0
- package/dist/array/shuffle.mjs.map +1 -0
- package/{esm/array/take.mjs → dist/array/take.d.mts} +5 -7
- package/dist/array/take.d.ts +3 -1
- package/dist/array/take.js +33 -0
- package/dist/array/take.js.map +1 -0
- package/dist/array/take.mjs +8 -0
- package/dist/array/take.mjs.map +1 -0
- package/{esm/array/takeRight.mjs → dist/array/takeRight.d.mts} +5 -10
- package/dist/array/takeRight.d.ts +3 -1
- package/dist/array/takeRight.js +36 -0
- package/dist/array/takeRight.js.map +1 -0
- package/dist/array/takeRight.mjs +8 -0
- package/dist/array/takeRight.mjs.map +1 -0
- package/{esm/array/takeRightWhile.mjs → dist/array/takeRightWhile.d.mts} +5 -12
- package/dist/array/takeRightWhile.d.ts +3 -1
- package/dist/array/takeRightWhile.js +38 -0
- package/dist/array/takeRightWhile.js.map +1 -0
- package/dist/array/takeRightWhile.mjs +8 -0
- package/dist/array/takeRightWhile.mjs.map +1 -0
- package/{esm/array/takeWhile.mjs → dist/array/takeWhile.d.mts} +1 -21
- package/dist/array/takeWhile.d.ts +3 -1
- package/dist/array/takeWhile.js +40 -0
- package/dist/array/takeWhile.js.map +1 -0
- package/dist/array/takeWhile.mjs +8 -0
- package/dist/array/takeWhile.mjs.map +1 -0
- package/{esm/array/union.mjs → dist/array/union.d.mts} +3 -7
- package/dist/array/union.d.ts +3 -1
- package/dist/array/union.js +47 -0
- package/dist/array/union.js.map +1 -0
- package/dist/array/union.mjs +9 -0
- package/dist/array/union.mjs.map +1 -0
- package/{esm/array/unionBy.mjs → dist/array/unionBy.d.mts} +4 -16
- package/dist/array/unionBy.d.ts +3 -1
- package/dist/array/unionBy.js +40 -0
- package/dist/array/unionBy.js.map +1 -0
- package/dist/array/unionBy.mjs +8 -0
- package/dist/array/unionBy.mjs.map +1 -0
- package/{esm/array/unionWith.mjs → dist/array/unionWith.d.mts} +4 -8
- package/dist/array/unionWith.d.ts +3 -1
- package/dist/array/unionWith.js +47 -0
- package/dist/array/unionWith.js.map +1 -0
- package/dist/array/unionWith.mjs +9 -0
- package/dist/array/unionWith.mjs.map +1 -0
- package/dist/array/uniq.d.mts +17 -0
- package/dist/array/uniq.d.ts +3 -1
- package/dist/array/uniq.js +40 -0
- package/dist/array/uniq.js.map +1 -0
- package/dist/array/uniq.mjs +8 -0
- package/dist/array/uniq.mjs.map +1 -0
- package/{esm/array/uniqBy.mjs → dist/array/uniqBy.d.mts} +1 -7
- package/dist/array/uniqBy.d.ts +3 -1
- package/dist/array/uniqBy.js +47 -0
- package/dist/array/uniqBy.js.map +1 -0
- package/dist/array/uniqBy.mjs +9 -0
- package/dist/array/uniqBy.mjs.map +1 -0
- package/dist/array/uniqWith.d.mts +14 -0
- package/dist/array/uniqWith.d.ts +3 -1
- package/dist/array/uniqWith.js +40 -0
- package/dist/array/uniqWith.js.map +1 -0
- package/dist/array/uniqWith.mjs +8 -0
- package/dist/array/uniqWith.mjs.map +1 -0
- package/{esm/array/xor.mjs → dist/array/xor.d.mts} +4 -10
- package/dist/array/xor.d.ts +3 -1
- package/dist/array/xor.js +66 -0
- package/dist/array/xor.js.map +1 -0
- package/dist/array/xor.mjs +12 -0
- package/dist/array/xor.mjs.map +1 -0
- package/{esm/array/xorBy.mjs → dist/array/xorBy.d.mts} +5 -13
- package/dist/array/xorBy.d.ts +3 -1
- package/dist/array/xorBy.js +65 -0
- package/dist/array/xorBy.js.map +1 -0
- package/dist/array/xorBy.mjs +11 -0
- package/dist/array/xorBy.mjs.map +1 -0
- package/{esm/array/xorWith.mjs → dist/array/xorWith.d.mts} +5 -13
- package/dist/array/xorWith.d.ts +3 -1
- package/dist/array/xorWith.js +72 -0
- package/dist/array/xorWith.js.map +1 -0
- package/dist/array/xorWith.mjs +12 -0
- package/dist/array/xorWith.mjs.map +1 -0
- package/dist/array/zip.d.mts +27 -0
- package/dist/array/zip.d.ts +6 -4
- package/dist/array/zip.js +42 -0
- package/dist/array/zip.js.map +1 -0
- package/dist/array/zip.mjs +8 -0
- package/dist/array/zip.mjs.map +1 -0
- package/{esm/array/zipWith.mjs → dist/array/zipWith.d.mts} +6 -26
- package/dist/array/zipWith.d.ts +6 -4
- package/dist/array/zipWith.js +41 -0
- package/dist/array/zipWith.js.map +1 -0
- package/dist/array/zipWith.mjs +8 -0
- package/dist/array/zipWith.mjs.map +1 -0
- package/dist/chunk-2KXLTAVK.mjs +16 -0
- package/dist/chunk-2KXLTAVK.mjs.map +1 -0
- package/dist/chunk-2MM5EJJX.mjs +21 -0
- package/dist/chunk-2MM5EJJX.mjs.map +1 -0
- package/dist/chunk-2VB6XU3I.mjs +12 -0
- package/dist/chunk-2VB6XU3I.mjs.map +1 -0
- package/dist/chunk-35TWSMYS.mjs +19 -0
- package/dist/chunk-35TWSMYS.mjs.map +1 -0
- package/dist/chunk-5JWSGT4R.mjs +18 -0
- package/dist/chunk-5JWSGT4R.mjs.map +1 -0
- package/dist/chunk-724PNXPR.mjs +13 -0
- package/dist/chunk-724PNXPR.mjs.map +1 -0
- package/dist/chunk-7GWOR247.mjs +11 -0
- package/dist/chunk-7GWOR247.mjs.map +1 -0
- package/dist/chunk-7OZZODAE.mjs +19 -0
- package/dist/chunk-7OZZODAE.mjs.map +1 -0
- package/dist/chunk-7PPND7QY.mjs +16 -0
- package/dist/chunk-7PPND7QY.mjs.map +1 -0
- package/dist/chunk-7SJHJHBN.mjs +11 -0
- package/dist/chunk-7SJHJHBN.mjs.map +1 -0
- package/dist/chunk-ARWKEQMQ.mjs +19 -0
- package/dist/chunk-ARWKEQMQ.mjs.map +1 -0
- package/dist/chunk-ARZ5BDR6.mjs +1 -0
- package/dist/chunk-ARZ5BDR6.mjs.map +1 -0
- package/dist/chunk-BAJC3BM7.mjs +12 -0
- package/dist/chunk-BAJC3BM7.mjs.map +1 -0
- package/dist/chunk-EAI4DDCQ.mjs +16 -0
- package/dist/chunk-EAI4DDCQ.mjs.map +1 -0
- package/dist/chunk-EAI6NLXI.mjs +12 -0
- package/dist/chunk-EAI6NLXI.mjs.map +1 -0
- package/dist/chunk-EJGAXTF7.mjs +1 -0
- package/dist/chunk-EJGAXTF7.mjs.map +1 -0
- package/dist/chunk-FUWEG5ZM.mjs +9 -0
- package/dist/chunk-FUWEG5ZM.mjs.map +1 -0
- package/dist/chunk-GJM7F3TH.mjs +13 -0
- package/dist/chunk-GJM7F3TH.mjs.map +1 -0
- package/dist/chunk-HQF6OFGM.mjs +9 -0
- package/dist/chunk-HQF6OFGM.mjs.map +1 -0
- package/dist/chunk-IJLQVGW4.mjs +1 -0
- package/dist/chunk-IJLQVGW4.mjs.map +1 -0
- package/dist/chunk-J3NTLMAE.mjs +10 -0
- package/dist/chunk-J3NTLMAE.mjs.map +1 -0
- package/dist/chunk-JMLFPGZ3.mjs +13 -0
- package/dist/chunk-JMLFPGZ3.mjs.map +1 -0
- package/dist/chunk-L4Y3G6AJ.mjs +23 -0
- package/dist/chunk-L4Y3G6AJ.mjs.map +1 -0
- package/dist/chunk-LAZNLIBJ.mjs +10 -0
- package/dist/chunk-LAZNLIBJ.mjs.map +1 -0
- package/dist/chunk-MAJSPFA6.mjs +1 -0
- package/dist/chunk-MAJSPFA6.mjs.map +1 -0
- package/dist/chunk-NEMQJ2GF.mjs +18 -0
- package/dist/chunk-NEMQJ2GF.mjs.map +1 -0
- package/dist/chunk-NK2262VG.mjs +9 -0
- package/dist/chunk-NK2262VG.mjs.map +1 -0
- package/dist/chunk-NSYWEYWT.mjs +13 -0
- package/dist/chunk-NSYWEYWT.mjs.map +1 -0
- package/dist/chunk-NYVT33DR.mjs +9 -0
- package/dist/chunk-NYVT33DR.mjs.map +1 -0
- package/dist/chunk-OBMK7JO2.mjs +13 -0
- package/dist/chunk-OBMK7JO2.mjs.map +1 -0
- package/dist/chunk-PTQLD7TG.mjs +11 -0
- package/dist/chunk-PTQLD7TG.mjs.map +1 -0
- package/dist/chunk-PWMHSN27.mjs +14 -0
- package/dist/chunk-PWMHSN27.mjs.map +1 -0
- package/dist/chunk-QRQPLMV4.mjs +16 -0
- package/dist/chunk-QRQPLMV4.mjs.map +1 -0
- package/dist/chunk-R5DNKXDI.mjs +21 -0
- package/dist/chunk-R5DNKXDI.mjs.map +1 -0
- package/dist/chunk-RK6PRCEJ.mjs +12 -0
- package/dist/chunk-RK6PRCEJ.mjs.map +1 -0
- package/dist/chunk-RLDY4N3Q.mjs +13 -0
- package/dist/chunk-RLDY4N3Q.mjs.map +1 -0
- package/dist/chunk-RU3RXBUC.mjs +17 -0
- package/dist/chunk-RU3RXBUC.mjs.map +1 -0
- package/dist/chunk-S767XFOS.mjs +10 -0
- package/dist/chunk-S767XFOS.mjs.map +1 -0
- package/dist/chunk-SGSQKXDO.mjs +15 -0
- package/dist/chunk-SGSQKXDO.mjs.map +1 -0
- package/dist/chunk-SYQTG4N4.mjs +1 -0
- package/dist/chunk-SYQTG4N4.mjs.map +1 -0
- package/dist/chunk-T5JCRGXA.mjs +1 -0
- package/dist/chunk-T5JCRGXA.mjs.map +1 -0
- package/dist/chunk-TOLR2FNF.mjs +13 -0
- package/dist/chunk-TOLR2FNF.mjs.map +1 -0
- package/dist/chunk-UNX3KZO2.mjs +17 -0
- package/dist/chunk-UNX3KZO2.mjs.map +1 -0
- package/dist/chunk-UZP4YX7I.mjs +17 -0
- package/dist/chunk-UZP4YX7I.mjs.map +1 -0
- package/dist/chunk-VACGGQOL.mjs +9 -0
- package/dist/chunk-VACGGQOL.mjs.map +1 -0
- package/dist/chunk-VAKCSKGR.mjs +17 -0
- package/dist/chunk-VAKCSKGR.mjs.map +1 -0
- package/dist/chunk-VJGGYY4Y.mjs +13 -0
- package/dist/chunk-VJGGYY4Y.mjs.map +1 -0
- package/dist/chunk-WFQ3LAHQ.mjs +9 -0
- package/dist/chunk-WFQ3LAHQ.mjs.map +1 -0
- package/dist/chunk-XS4ZPJMT.mjs +21 -0
- package/dist/chunk-XS4ZPJMT.mjs.map +1 -0
- package/dist/chunk-XW452I77.mjs +16 -0
- package/dist/chunk-XW452I77.mjs.map +1 -0
- package/dist/chunk-YMNXRH52.mjs +9 -0
- package/dist/chunk-YMNXRH52.mjs.map +1 -0
- package/dist/chunk-Z4IO7EIH.mjs +16 -0
- package/dist/chunk-Z4IO7EIH.mjs.map +1 -0
- package/{esm/function/debounce.mjs → dist/function/debounce.d.mts} +5 -18
- package/dist/function/debounce.d.ts +3 -1
- package/dist/function/debounce.js +47 -0
- package/dist/function/debounce.js.map +1 -0
- package/dist/function/debounce.mjs +8 -0
- package/dist/function/debounce.mjs.map +1 -0
- package/dist/function/index.d.ts +3 -3
- package/dist/function/index.js +47 -78
- package/dist/function/index.js.map +1 -0
- package/dist/function/index.mjs +17 -0
- package/dist/function/index.mjs.map +1 -0
- package/{esm/function/once.mjs → dist/function/once.d.mts} +2 -14
- package/dist/function/once.d.ts +3 -1
- package/dist/function/once.js +43 -0
- package/dist/function/once.js.map +1 -0
- package/dist/function/once.mjs +8 -0
- package/dist/function/once.mjs.map +1 -0
- package/{esm/function/throttle.mjs → dist/function/throttle.d.mts} +3 -13
- package/dist/function/throttle.d.ts +3 -1
- package/dist/function/throttle.js +41 -0
- package/dist/function/throttle.js.map +1 -0
- package/dist/function/throttle.mjs +8 -0
- package/dist/function/throttle.mjs.map +1 -0
- package/dist/index.d.ts +45 -6
- package/dist/index.js +288 -1271
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +190 -0
- package/dist/index.mjs.map +1 -0
- package/{esm/math/clamp.mjs → dist/math/clamp.d.mts} +2 -7
- package/dist/math/clamp.d.ts +4 -2
- package/dist/math/clamp.js +36 -0
- package/dist/math/clamp.js.map +1 -0
- package/dist/math/clamp.mjs +8 -0
- package/dist/math/clamp.mjs.map +1 -0
- package/dist/math/index.d.ts +3 -3
- package/dist/math/index.js +41 -132
- package/dist/math/index.js.map +1 -0
- package/dist/math/index.mjs +17 -0
- package/dist/math/index.mjs.map +1 -0
- package/{esm/math/round.mjs → dist/math/round.d.mts} +3 -7
- package/dist/math/round.d.ts +3 -1
- package/dist/math/round.js +34 -0
- package/dist/math/round.js.map +1 -0
- package/dist/math/round.mjs +8 -0
- package/dist/math/round.mjs.map +1 -0
- package/dist/math/sum.d.mts +16 -0
- package/dist/math/sum.d.ts +3 -1
- package/dist/math/sum.js +37 -0
- package/dist/math/sum.js.map +1 -0
- package/dist/math/sum.mjs +8 -0
- package/dist/math/sum.mjs.map +1 -0
- package/dist/object/index.d.ts +4 -4
- package/dist/object/index.js +62 -256
- package/dist/object/index.js.map +1 -0
- package/dist/object/index.mjs +21 -0
- package/dist/object/index.mjs.map +1 -0
- package/{esm/object/omit.mjs → dist/object/omit.d.mts} +2 -19
- package/dist/object/omit.d.ts +3 -1
- package/dist/object/omit.js +51 -0
- package/dist/object/omit.js.map +1 -0
- package/dist/object/omit.mjs +8 -0
- package/dist/object/omit.mjs.map +1 -0
- package/{esm/object/omitBy.mjs → dist/object/omitBy.d.mts} +4 -18
- package/dist/object/omitBy.d.ts +3 -1
- package/dist/object/omitBy.js +40 -0
- package/dist/object/omitBy.js.map +1 -0
- package/dist/object/omitBy.mjs +8 -0
- package/dist/object/omitBy.mjs.map +1 -0
- package/{esm/object/pick.mjs → dist/object/pick.d.mts} +2 -19
- package/dist/object/pick.d.ts +3 -1
- package/dist/object/pick.js +37 -0
- package/dist/object/pick.js.map +1 -0
- package/dist/object/pick.mjs +8 -0
- package/dist/object/pick.mjs.map +1 -0
- package/{esm/object/pickBy.mjs → dist/object/pickBy.d.mts} +4 -18
- package/dist/object/pickBy.d.ts +3 -1
- package/dist/object/pickBy.js +40 -0
- package/dist/object/pickBy.js.map +1 -0
- package/dist/object/pickBy.mjs +8 -0
- package/dist/object/pickBy.mjs.map +1 -0
- package/dist/predicate/index.d.ts +4 -4
- package/dist/predicate/index.js +42 -84
- package/dist/predicate/index.js.map +1 -0
- package/dist/predicate/index.mjs +21 -0
- package/dist/predicate/index.mjs.map +1 -0
- package/{esm/predicate/isNil.mjs → dist/predicate/isNil.d.mts} +4 -6
- package/dist/predicate/isNil.d.ts +3 -1
- package/dist/predicate/isNil.js +33 -0
- package/dist/predicate/isNil.js.map +1 -0
- package/dist/predicate/isNil.mjs +8 -0
- package/dist/predicate/isNil.mjs.map +1 -0
- package/{esm/predicate/isNotNil.mjs → dist/predicate/isNotNil.d.mts} +2 -4
- package/dist/predicate/isNotNil.d.ts +3 -1
- package/dist/predicate/isNotNil.js +33 -0
- package/dist/predicate/isNotNil.js.map +1 -0
- package/dist/predicate/isNotNil.mjs +8 -0
- package/dist/predicate/isNotNil.mjs.map +1 -0
- package/{esm/predicate/isNull.mjs → dist/predicate/isNull.d.mts} +4 -6
- package/dist/predicate/isNull.d.ts +3 -1
- package/dist/predicate/isNull.js +33 -0
- package/dist/predicate/isNull.js.map +1 -0
- package/dist/predicate/isNull.mjs +8 -0
- package/dist/predicate/isNull.mjs.map +1 -0
- package/{esm/predicate/isUndefined.mjs → dist/predicate/isUndefined.d.mts} +4 -6
- package/dist/predicate/isUndefined.d.ts +3 -1
- package/dist/predicate/isUndefined.js +33 -0
- package/dist/predicate/isUndefined.js.map +1 -0
- package/dist/predicate/isUndefined.mjs +8 -0
- package/dist/predicate/isUndefined.mjs.map +1 -0
- package/{esm/promise/delay.mjs → dist/promise/delay.d.mts} +4 -8
- package/dist/promise/delay.d.ts +3 -1
- package/dist/promise/delay.js +35 -0
- package/dist/promise/delay.js.map +1 -0
- package/dist/promise/delay.mjs +8 -0
- package/dist/promise/delay.mjs.map +1 -0
- package/dist/promise/index.d.ts +1 -1
- package/dist/promise/index.js +31 -23
- package/dist/promise/index.js.map +1 -0
- package/dist/promise/index.mjs +9 -0
- package/dist/promise/index.mjs.map +1 -0
- package/package.json +120 -49
- package/dist/array/chunk.spec.d.ts +0 -1
- package/dist/array/difference.spec.d.ts +0 -1
- package/dist/array/differenceBy.spec.d.ts +0 -1
- package/dist/array/differenceWith.spec.d.ts +0 -1
- package/dist/array/drop.spec.d.ts +0 -1
- package/dist/array/dropRight.spec.d.ts +0 -1
- package/dist/array/dropRightWhile.spec.d.ts +0 -1
- package/dist/array/dropWhile.spec.d.ts +0 -1
- package/dist/array/groupBy.spec.d.ts +0 -1
- package/dist/array/intersection.spec.d.ts +0 -1
- package/dist/array/intersectionBy.spec.d.ts +0 -1
- package/dist/array/intersectionWith.spec.d.ts +0 -1
- package/dist/array/partition.spec.d.ts +0 -1
- package/dist/array/sample.spec.d.ts +0 -1
- package/dist/array/shuffle.spec.d.ts +0 -1
- package/dist/array/take.spec.d.ts +0 -1
- package/dist/array/takeRight.spec.d.ts +0 -1
- package/dist/array/takeRightWhile.spec.d.ts +0 -1
- package/dist/array/takeWhile.spec.d.ts +0 -1
- package/dist/array/union.spec.d.ts +0 -1
- package/dist/array/unionBy.spec.d.ts +0 -1
- package/dist/array/unionWith.spec.d.ts +0 -1
- package/dist/array/uniq.spec.d.ts +0 -1
- package/dist/array/uniqBy.spec.d.ts +0 -1
- package/dist/array/uniqWith.spec.d.ts +0 -1
- package/dist/array/xor.spec.d.ts +0 -1
- package/dist/array/xorBy.spec.d.ts +0 -1
- package/dist/array/xorWith.spec.d.ts +0 -1
- package/dist/array/zip.spec.d.ts +0 -1
- package/dist/array/zipWith.spec.d.ts +0 -1
- package/dist/function/debounce.spec.d.ts +0 -1
- package/dist/function/once.spec.d.ts +0 -1
- package/dist/function/throttle.spec.d.ts +0 -1
- package/dist/math/clamp.spec.d.ts +0 -1
- package/dist/math/round.spec.d.ts +0 -1
- package/dist/math/sum.spec.d.ts +0 -1
- package/dist/object/omit.spec.d.ts +0 -1
- package/dist/object/omitBy.spec.d.ts +0 -1
- package/dist/object/pick.spec.d.ts +0 -1
- package/dist/object/pickBy.spec.d.ts +0 -1
- package/dist/predicate/isNil.spec.d.ts +0 -1
- package/dist/predicate/isNotNil.spec.d.ts +0 -1
- package/dist/predicate/isNull.spec.d.ts +0 -1
- package/dist/predicate/isUndefined.spec.d.ts +0 -1
- package/dist/promise/delay.spec.d.ts +0 -1
- package/esm/_virtual/_rollupPluginBabelHelpers.mjs +0 -163
- package/esm/array/_virtual/_rollupPluginBabelHelpers.mjs +0 -78
- package/esm/array/uniq.mjs +0 -37
- package/esm/array/uniqWith.mjs +0 -39
- package/esm/array/zip.mjs +0 -52
- package/esm/math/_virtual/_rollupPluginBabelHelpers.mjs +0 -66
- package/esm/math/sum.mjs +0 -33
- package/esm/object/_virtual/_rollupPluginBabelHelpers.mjs +0 -151
- /package/{esm/array/index.mjs → dist/array/index.d.mts} +0 -0
- /package/{esm/function/index.mjs → dist/function/index.d.mts} +0 -0
- /package/{esm/index.mjs → dist/index.d.mts} +0 -0
- /package/{esm/math/index.mjs → dist/math/index.d.mts} +0 -0
- /package/{esm/object/index.mjs → dist/object/index.d.mts} +0 -0
- /package/{esm/predicate/index.mjs → dist/predicate/index.d.mts} +0 -0
- /package/{esm/promise/index.mjs → dist/promise/index.d.mts} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
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/predicate/isNotNil.ts
|
|
21
|
+
var isNotNil_exports = {};
|
|
22
|
+
__export(isNotNil_exports, {
|
|
23
|
+
isNotNil: () => isNotNil
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(isNotNil_exports);
|
|
26
|
+
function isNotNil(x) {
|
|
27
|
+
return x !== null && x !== void 0;
|
|
28
|
+
}
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
isNotNil
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=isNotNil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks if the given value is null.
|
|
3
3
|
*
|
|
4
|
-
* This function tests whether the provided value is strictly equal to `null`.
|
|
4
|
+
* This function tests whether the provided value is strictly equal to `null`.
|
|
5
5
|
* It returns `true` if the value is `null`, and `false` otherwise.
|
|
6
6
|
*
|
|
7
7
|
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* @param {unknown} x - The value to test if it is null.
|
|
10
10
|
* @returns {x is null} True if the value is null, false otherwise.
|
|
11
11
|
*
|
|
@@ -13,13 +13,11 @@
|
|
|
13
13
|
* * const value1 = null;
|
|
14
14
|
* const value2 = undefined;
|
|
15
15
|
* const value3 = 42;
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
17
|
* console.log(isNull(value1)); // true
|
|
18
18
|
* console.log(isNull(value2)); // false
|
|
19
19
|
* console.log(isNull(value3)); // false
|
|
20
20
|
*/
|
|
21
|
-
function isNull(x)
|
|
22
|
-
return x === null;
|
|
23
|
-
}
|
|
21
|
+
declare function isNull(x: unknown): x is null;
|
|
24
22
|
|
|
25
23
|
export { isNull };
|
|
@@ -0,0 +1,33 @@
|
|
|
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/predicate/isNull.ts
|
|
21
|
+
var isNull_exports = {};
|
|
22
|
+
__export(isNull_exports, {
|
|
23
|
+
isNull: () => isNull
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(isNull_exports);
|
|
26
|
+
function isNull(x) {
|
|
27
|
+
return x === null;
|
|
28
|
+
}
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
isNull
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=isNull.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/predicate/isNull.ts"],"sourcesContent":["/**\n * Checks if the given value is null.\n *\n * This function tests whether the provided value is strictly equal to `null`. \n * It returns `true` if the value is `null`, and `false` otherwise.\n *\n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `null`.\n * \n * @param {unknown} x - The value to test if it is null.\n * @returns {x is null} True if the value is null, false otherwise.\n *\n * @example\n * * const value1 = null;\n * const value2 = undefined;\n * const value3 = 42;\n * \n * console.log(isNull(value1)); // true\n * console.log(isNull(value2)); // false\n * console.log(isNull(value3)); // false\n */\nexport function isNull(x: unknown): x is null {\n return x === null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks if the given value is undefined.
|
|
3
3
|
*
|
|
4
|
-
* This function tests whether the provided value is strictly equal to `undefined`.
|
|
4
|
+
* This function tests whether the provided value is strictly equal to `undefined`.
|
|
5
5
|
* It returns `true` if the value is `undefined`, and `false` otherwise.
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
7
|
* This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.
|
|
8
8
|
*
|
|
9
9
|
* @param {unknown} x - The value to test if it is undefined.
|
|
@@ -13,13 +13,11 @@
|
|
|
13
13
|
* * const value1 = undefined;
|
|
14
14
|
* const value2 = null;
|
|
15
15
|
* const value3 = 42;
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
17
|
* console.log(isUndefined(value1)); // true
|
|
18
18
|
* console.log(isUndefined(value2)); // false
|
|
19
19
|
* console.log(isUndefined(value3)); // false
|
|
20
20
|
*/
|
|
21
|
-
function isUndefined(x)
|
|
22
|
-
return x === undefined;
|
|
23
|
-
}
|
|
21
|
+
declare function isUndefined(x: unknown): x is undefined;
|
|
24
22
|
|
|
25
23
|
export { isUndefined };
|
|
@@ -0,0 +1,33 @@
|
|
|
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/predicate/isUndefined.ts
|
|
21
|
+
var isUndefined_exports = {};
|
|
22
|
+
__export(isUndefined_exports, {
|
|
23
|
+
isUndefined: () => isUndefined
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(isUndefined_exports);
|
|
26
|
+
function isUndefined(x) {
|
|
27
|
+
return x === void 0;
|
|
28
|
+
}
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
isUndefined
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=isUndefined.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/predicate/isUndefined.ts"],"sourcesContent":["/**\n * Checks if the given value is undefined.\n *\n * This function tests whether the provided value is strictly equal to `undefined`. \n * It returns `true` if the value is `undefined`, and `false` otherwise.\n * \n * This function can also serve as a type predicate in TypeScript, narrowing the type of the argument to `undefined`.\n *\n * @param {unknown} x - The value to test if it is undefined.\n * @returns {x is undefined} true if the value is undefined, false otherwise.\n *\n * @example\n * * const value1 = undefined;\n * const value2 = null;\n * const value3 = 42;\n * \n * console.log(isUndefined(value1)); // true\n * console.log(isUndefined(value2)); // false\n * console.log(isUndefined(value3)); // false\n */\nexport function isUndefined(x: unknown): x is undefined {\n return x === undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Delays the execution of code for a specified number of milliseconds.
|
|
3
|
-
*
|
|
4
|
-
* This function returns a Promise that resolves after the specified delay, allowing you to use it
|
|
3
|
+
*
|
|
4
|
+
* This function returns a Promise that resolves after the specified delay, allowing you to use it
|
|
5
5
|
* with async/await to pause execution.
|
|
6
6
|
*
|
|
7
7
|
* @param {number} ms - The number of milliseconds to delay.
|
|
@@ -13,13 +13,9 @@
|
|
|
13
13
|
* await delay(1000); // Delays execution for 1 second
|
|
14
14
|
* console.log('End');
|
|
15
15
|
* }
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
17
|
* foo();
|
|
18
18
|
*/
|
|
19
|
-
function delay(ms)
|
|
20
|
-
return new Promise(function (resolve) {
|
|
21
|
-
setTimeout(resolve, ms);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
19
|
+
declare function delay(ms: number): Promise<void>;
|
|
24
20
|
|
|
25
21
|
export { delay };
|
package/dist/promise/delay.d.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
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/promise/delay.ts
|
|
21
|
+
var delay_exports = {};
|
|
22
|
+
__export(delay_exports, {
|
|
23
|
+
delay: () => delay
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(delay_exports);
|
|
26
|
+
function delay(ms) {
|
|
27
|
+
return new Promise((resolve) => {
|
|
28
|
+
setTimeout(resolve, ms);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
delay
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=delay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/promise/delay.ts"],"sourcesContent":["/**\n * Delays the execution of code for a specified number of milliseconds.\n * \n * This function returns a Promise that resolves after the specified delay, allowing you to use it \n * with async/await to pause execution.\n *\n * @param {number} ms - The number of milliseconds to delay.\n * @returns {Promise<void>} A Promise that resolves after the specified delay.\n *\n * @example\n * async function foo() {\n * console.log('Start');\n * await delay(1000); // Delays execution for 1 second\n * console.log('End');\n * }\n * \n * foo();\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBO,SAAS,MAAM,IAA2B;AAC/C,SAAO,IAAI,QAAQ,aAAW;AAC5B,eAAW,SAAS,EAAE;AAAA,EACxB,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/promise/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { delay } from './delay';
|
|
1
|
+
export { delay } from './delay.js';
|
package/dist/promise/index.js
CHANGED
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
|
|
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);
|
|
2
19
|
|
|
3
|
-
|
|
20
|
+
// src/promise/index.ts
|
|
21
|
+
var promise_exports = {};
|
|
22
|
+
__export(promise_exports, {
|
|
23
|
+
delay: () => delay
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(promise_exports);
|
|
4
26
|
|
|
5
|
-
|
|
6
|
-
* Delays the execution of code for a specified number of milliseconds.
|
|
7
|
-
*
|
|
8
|
-
* This function returns a Promise that resolves after the specified delay, allowing you to use it
|
|
9
|
-
* with async/await to pause execution.
|
|
10
|
-
*
|
|
11
|
-
* @param {number} ms - The number of milliseconds to delay.
|
|
12
|
-
* @returns {Promise<void>} A Promise that resolves after the specified delay.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* async function foo() {
|
|
16
|
-
* console.log('Start');
|
|
17
|
-
* await delay(1000); // Delays execution for 1 second
|
|
18
|
-
* console.log('End');
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* foo();
|
|
22
|
-
*/
|
|
27
|
+
// src/promise/delay.ts
|
|
23
28
|
function delay(ms) {
|
|
24
|
-
return new Promise(
|
|
29
|
+
return new Promise((resolve) => {
|
|
25
30
|
setTimeout(resolve, ms);
|
|
26
31
|
});
|
|
27
32
|
}
|
|
28
|
-
|
|
29
|
-
exports
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
delay
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/promise/index.ts","../../src/promise/delay.ts"],"sourcesContent":["export { delay } from './delay';","/**\n * Delays the execution of code for a specified number of milliseconds.\n * \n * This function returns a Promise that resolves after the specified delay, allowing you to use it \n * with async/await to pause execution.\n *\n * @param {number} ms - The number of milliseconds to delay.\n * @returns {Promise<void>} A Promise that resolves after the specified delay.\n *\n * @example\n * async function foo() {\n * console.log('Start');\n * await delay(1000); // Delays execution for 1 second\n * console.log('End');\n * }\n * \n * foo();\n */\nexport function delay(ms: number): Promise<void> {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkBO,SAAS,MAAM,IAA2B;AAC/C,SAAO,IAAI,QAAQ,aAAW;AAC5B,eAAW,SAAS,EAAE;AAAA,EACxB,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,93 +1,163 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-toolkit",
|
|
3
3
|
"description": "A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4-dev.39+21fa1218",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"docs"
|
|
7
7
|
],
|
|
8
8
|
"packageManager": "yarn@4.2.2",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.mts",
|
|
13
|
+
"default": "./dist/index.mjs"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
14
19
|
},
|
|
15
20
|
"./array": {
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/array/index.d.mts",
|
|
23
|
+
"default": "./dist/array/index.mjs"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/array/index.d.ts",
|
|
27
|
+
"default": "./dist/array/index.js"
|
|
28
|
+
}
|
|
19
29
|
},
|
|
20
30
|
"./function": {
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
"import": {
|
|
32
|
+
"types": "./dist/function/index.d.mts",
|
|
33
|
+
"default": "./dist/function/index.mjs"
|
|
34
|
+
},
|
|
35
|
+
"require": {
|
|
36
|
+
"types": "./dist/function/index.d.ts",
|
|
37
|
+
"default": "./dist/function/index.js"
|
|
38
|
+
}
|
|
24
39
|
},
|
|
25
40
|
"./math": {
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
"import": {
|
|
42
|
+
"types": "./dist/math/index.d.mts",
|
|
43
|
+
"default": "./dist/math/index.mjs"
|
|
44
|
+
},
|
|
45
|
+
"require": {
|
|
46
|
+
"types": "./dist/math/index.d.ts",
|
|
47
|
+
"default": "./dist/math/index.js"
|
|
48
|
+
}
|
|
29
49
|
},
|
|
30
50
|
"./object": {
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
51
|
+
"import": {
|
|
52
|
+
"types": "./dist/object/index.d.mts",
|
|
53
|
+
"default": "./dist/object/index.mjs"
|
|
54
|
+
},
|
|
55
|
+
"require": {
|
|
56
|
+
"types": "./dist/object/index.d.ts",
|
|
57
|
+
"default": "./dist/object/index.js"
|
|
58
|
+
}
|
|
34
59
|
},
|
|
35
60
|
"./predicate": {
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
61
|
+
"import": {
|
|
62
|
+
"types": "./dist/predicate/index.d.mts",
|
|
63
|
+
"default": "./dist/predicate/index.mjs"
|
|
64
|
+
},
|
|
65
|
+
"require": {
|
|
66
|
+
"types": "./dist/predicate/index.d.ts",
|
|
67
|
+
"default": "./dist/predicate/index.js"
|
|
68
|
+
}
|
|
39
69
|
},
|
|
40
70
|
"./promise": {
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
71
|
+
"import": {
|
|
72
|
+
"types": "./dist/promise/index.d.mts",
|
|
73
|
+
"default": "./dist/promise/index.mjs"
|
|
74
|
+
},
|
|
75
|
+
"require": {
|
|
76
|
+
"types": "./dist/promise/index.d.ts",
|
|
77
|
+
"default": "./dist/promise/index.js"
|
|
78
|
+
}
|
|
44
79
|
},
|
|
45
80
|
"./package.json": "./package.json"
|
|
46
81
|
},
|
|
47
82
|
"files": [
|
|
48
|
-
"dist
|
|
49
|
-
"esm/**/*",
|
|
83
|
+
"dist",
|
|
50
84
|
"*.d.ts"
|
|
51
85
|
],
|
|
52
86
|
"publishConfig": {
|
|
53
87
|
"access": "public",
|
|
54
88
|
"main": "./dist/index.js",
|
|
89
|
+
"module": "./dist/index.mjs",
|
|
55
90
|
"types": "./dist/index.d.ts",
|
|
56
91
|
"exports": {
|
|
57
92
|
".": {
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
93
|
+
"import": {
|
|
94
|
+
"types": "./dist/index.d.mts",
|
|
95
|
+
"default": "./dist/index.mjs"
|
|
96
|
+
},
|
|
97
|
+
"require": {
|
|
98
|
+
"types": "./dist/index.d.ts",
|
|
99
|
+
"default": "./dist/index.js"
|
|
100
|
+
}
|
|
61
101
|
},
|
|
62
102
|
"./array": {
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./dist/array/index.d.mts",
|
|
105
|
+
"default": "./dist/array/index.mjs"
|
|
106
|
+
},
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./dist/array/index.d.ts",
|
|
109
|
+
"default": "./dist/array/index.js"
|
|
110
|
+
}
|
|
66
111
|
},
|
|
67
112
|
"./function": {
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
113
|
+
"import": {
|
|
114
|
+
"types": "./dist/function/index.d.mts",
|
|
115
|
+
"default": "./dist/function/index.mjs"
|
|
116
|
+
},
|
|
117
|
+
"require": {
|
|
118
|
+
"types": "./dist/function/index.d.ts",
|
|
119
|
+
"default": "./dist/function/index.js"
|
|
120
|
+
}
|
|
71
121
|
},
|
|
72
122
|
"./math": {
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
123
|
+
"import": {
|
|
124
|
+
"types": "./dist/math/index.d.mts",
|
|
125
|
+
"default": "./dist/math/index.mjs"
|
|
126
|
+
},
|
|
127
|
+
"require": {
|
|
128
|
+
"types": "./dist/math/index.d.ts",
|
|
129
|
+
"default": "./dist/math/index.js"
|
|
130
|
+
}
|
|
76
131
|
},
|
|
77
132
|
"./object": {
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./dist/object/index.d.mts",
|
|
135
|
+
"default": "./dist/object/index.mjs"
|
|
136
|
+
},
|
|
137
|
+
"require": {
|
|
138
|
+
"types": "./dist/object/index.d.ts",
|
|
139
|
+
"default": "./dist/object/index.js"
|
|
140
|
+
}
|
|
81
141
|
},
|
|
82
142
|
"./predicate": {
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
143
|
+
"import": {
|
|
144
|
+
"types": "./dist/predicate/index.d.mts",
|
|
145
|
+
"default": "./dist/predicate/index.mjs"
|
|
146
|
+
},
|
|
147
|
+
"require": {
|
|
148
|
+
"types": "./dist/predicate/index.d.ts",
|
|
149
|
+
"default": "./dist/predicate/index.js"
|
|
150
|
+
}
|
|
86
151
|
},
|
|
87
152
|
"./promise": {
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
153
|
+
"import": {
|
|
154
|
+
"types": "./dist/promise/index.d.mts",
|
|
155
|
+
"default": "./dist/promise/index.mjs"
|
|
156
|
+
},
|
|
157
|
+
"require": {
|
|
158
|
+
"types": "./dist/promise/index.d.ts",
|
|
159
|
+
"default": "./dist/promise/index.js"
|
|
160
|
+
}
|
|
91
161
|
},
|
|
92
162
|
"./package.json": "./package.json"
|
|
93
163
|
}
|
|
@@ -98,7 +168,6 @@
|
|
|
98
168
|
"@babel/preset-typescript": "^7.24.1",
|
|
99
169
|
"@changesets/changelog-github": "^0.5.0",
|
|
100
170
|
"@changesets/cli": "^2.27.1",
|
|
101
|
-
"@toss/rollup-config": "0.2.0-canary.0",
|
|
102
171
|
"@types/babel__core": "^7",
|
|
103
172
|
"@types/babel__preset-env": "^7",
|
|
104
173
|
"@types/broken-link-checker": "^0",
|
|
@@ -112,16 +181,18 @@
|
|
|
112
181
|
"eslint-config-prettier": "^8.5.0",
|
|
113
182
|
"lodash": "^4.17.21",
|
|
114
183
|
"prettier": "^3.2.5",
|
|
115
|
-
"
|
|
184
|
+
"tsup": "^8.1.0",
|
|
116
185
|
"typescript": "^5.4.5",
|
|
117
186
|
"vitest": "^1.5.2"
|
|
118
187
|
},
|
|
119
188
|
"sideEffects": false,
|
|
120
189
|
"scripts": {
|
|
121
190
|
"prepack": "yarn build",
|
|
122
|
-
"build": "
|
|
123
|
-
"test": "vitest run --coverage --typecheck"
|
|
191
|
+
"build": "tsup && ./.scripts/postbuild.sh",
|
|
192
|
+
"test": "vitest run --coverage --typecheck",
|
|
193
|
+
"lint": "eslint ./src --ext .ts"
|
|
124
194
|
},
|
|
125
195
|
"main": "./dist/index.js",
|
|
196
|
+
"module": "./dist/index.mjs",
|
|
126
197
|
"types": "./dist/index.d.ts"
|
|
127
198
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|