es-toolkit 1.0.4-dev.42 → 1.0.4
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/README.md +1 -0
- package/dist/array/chunk.js.map +1 -1
- package/dist/array/chunk.mjs +1 -1
- package/dist/array/difference.js.map +1 -1
- package/dist/array/difference.mjs +1 -1
- package/dist/array/differenceBy.js.map +1 -1
- package/dist/array/differenceBy.mjs +1 -1
- package/dist/array/differenceWith.js.map +1 -1
- package/dist/array/differenceWith.mjs +1 -1
- package/dist/array/drop.js.map +1 -1
- package/dist/array/drop.mjs +1 -1
- package/dist/array/dropRight.js.map +1 -1
- package/dist/array/dropRight.mjs +1 -1
- package/dist/array/dropRightWhile.js.map +1 -1
- package/dist/array/dropRightWhile.mjs +2 -2
- package/dist/array/dropWhile.js.map +1 -1
- package/dist/array/dropWhile.mjs +1 -1
- package/dist/array/groupBy.js.map +1 -1
- package/dist/array/groupBy.mjs +1 -1
- package/dist/array/index.js.map +1 -1
- package/dist/array/index.mjs +51 -51
- package/dist/array/intersection.js.map +1 -1
- package/dist/array/intersection.mjs +1 -1
- package/dist/array/intersectionBy.js.map +1 -1
- package/dist/array/intersectionBy.mjs +1 -1
- package/dist/array/intersectionWith.js.map +1 -1
- package/dist/array/intersectionWith.mjs +1 -1
- package/dist/array/partition.js.map +1 -1
- package/dist/array/partition.mjs +1 -1
- package/dist/array/sample.js.map +1 -1
- package/dist/array/sample.mjs +1 -1
- package/dist/array/shuffle.js.map +1 -1
- package/dist/array/shuffle.mjs +1 -1
- package/dist/array/take.js.map +1 -1
- package/dist/array/take.mjs +1 -1
- package/dist/array/takeRight.js.map +1 -1
- package/dist/array/takeRight.mjs +1 -1
- package/dist/array/takeRightWhile.js.map +1 -1
- package/dist/array/takeRightWhile.mjs +1 -1
- package/dist/array/takeWhile.js.map +1 -1
- package/dist/array/takeWhile.mjs +1 -1
- package/dist/array/union.js.map +1 -1
- package/dist/array/union.mjs +2 -2
- package/dist/array/unionBy.js.map +1 -1
- package/dist/array/unionBy.mjs +1 -1
- package/dist/array/unionWith.js.map +1 -1
- package/dist/array/unionWith.mjs +2 -2
- package/dist/array/uniq.js.map +1 -1
- package/dist/array/uniq.mjs +1 -1
- package/dist/array/uniqBy.js.map +1 -1
- package/dist/array/uniqBy.mjs +2 -2
- package/dist/array/uniqWith.js.map +1 -1
- package/dist/array/uniqWith.mjs +1 -1
- package/dist/array/xor.js.map +1 -1
- package/dist/array/xor.mjs +5 -5
- package/dist/array/xorBy.js.map +1 -1
- package/dist/array/xorBy.mjs +4 -4
- package/dist/array/xorWith.js.map +1 -1
- package/dist/array/xorWith.mjs +5 -5
- package/dist/array/zip.js.map +1 -1
- package/dist/array/zip.mjs +1 -1
- package/dist/array/zipWith.js.map +1 -1
- package/dist/array/zipWith.mjs +1 -1
- package/dist/{chunk-LLOAPSQ6.mjs → chunk-2KXLTAVK.mjs} +1 -1
- package/dist/{chunk-LLOAPSQ6.mjs.map → chunk-2KXLTAVK.mjs.map} +1 -1
- package/dist/{chunk-ANJSX6WH.mjs → chunk-2VB6XU3I.mjs} +1 -1
- package/dist/chunk-2VB6XU3I.mjs.map +1 -0
- package/dist/{chunk-OS5PZ4B4.mjs → chunk-35TWSMYS.mjs} +1 -1
- package/dist/{chunk-OS5PZ4B4.mjs.map → chunk-35TWSMYS.mjs.map} +1 -1
- package/dist/{chunk-L25VRQ54.mjs → chunk-5JWSGT4R.mjs} +1 -1
- package/dist/chunk-5JWSGT4R.mjs.map +1 -0
- package/dist/{chunk-AFYV2UVZ.mjs → chunk-724PNXPR.mjs} +1 -1
- package/dist/chunk-724PNXPR.mjs.map +1 -0
- package/dist/{chunk-YNRYG5OB.mjs → chunk-7GWOR247.mjs} +1 -1
- package/dist/chunk-7GWOR247.mjs.map +1 -0
- package/dist/{chunk-QC3SFAQJ.mjs → chunk-7OZZODAE.mjs} +4 -4
- package/dist/chunk-7OZZODAE.mjs.map +1 -0
- package/dist/{chunk-SPLO5OZW.mjs → chunk-7PPND7QY.mjs} +1 -1
- package/dist/chunk-7PPND7QY.mjs.map +1 -0
- package/dist/{chunk-ZBG3EYM3.mjs → chunk-7SJHJHBN.mjs} +1 -1
- package/dist/chunk-7SJHJHBN.mjs.map +1 -0
- package/dist/{chunk-UFAA5WKR.mjs → chunk-ARWKEQMQ.mjs} +1 -1
- package/dist/chunk-ARWKEQMQ.mjs.map +1 -0
- package/dist/{chunk-L3C6TG2V.mjs → chunk-BAJC3BM7.mjs} +1 -1
- package/dist/chunk-BAJC3BM7.mjs.map +1 -0
- package/dist/{chunk-SQOYF647.mjs → chunk-EAI4DDCQ.mjs} +1 -1
- package/dist/chunk-EAI4DDCQ.mjs.map +1 -0
- package/dist/{chunk-PUQLVKMB.mjs → chunk-EAI6NLXI.mjs} +1 -1
- package/dist/chunk-EAI6NLXI.mjs.map +1 -0
- package/dist/{chunk-Y6ZRNII6.mjs → chunk-FUWEG5ZM.mjs} +1 -1
- package/dist/chunk-FUWEG5ZM.mjs.map +1 -0
- package/dist/{chunk-7LAOIS6P.mjs → chunk-GJM7F3TH.mjs} +1 -1
- package/dist/chunk-GJM7F3TH.mjs.map +1 -0
- package/dist/{chunk-OLBUAFBX.mjs → chunk-HQF6OFGM.mjs} +1 -1
- package/dist/chunk-HQF6OFGM.mjs.map +1 -0
- package/dist/{chunk-PHG5JCSW.mjs → chunk-J3NTLMAE.mjs} +1 -1
- package/dist/chunk-J3NTLMAE.mjs.map +1 -0
- package/dist/{chunk-TK2EDHSP.mjs → chunk-JMLFPGZ3.mjs} +2 -2
- package/dist/chunk-JMLFPGZ3.mjs.map +1 -0
- package/dist/{chunk-GELVVASW.mjs → chunk-L4Y3G6AJ.mjs} +3 -3
- package/dist/chunk-L4Y3G6AJ.mjs.map +1 -0
- package/dist/{chunk-YHY2XTJW.mjs → chunk-LAZNLIBJ.mjs} +1 -1
- package/dist/chunk-LAZNLIBJ.mjs.map +1 -0
- package/dist/{chunk-TF6N37OE.mjs → chunk-NEMQJ2GF.mjs} +1 -1
- package/dist/chunk-NEMQJ2GF.mjs.map +1 -0
- package/dist/{chunk-HOQRMBSB.mjs → chunk-NK2262VG.mjs} +1 -1
- package/dist/chunk-NK2262VG.mjs.map +1 -0
- package/dist/{chunk-M3SHJ3LL.mjs → chunk-NSYWEYWT.mjs} +1 -1
- package/dist/chunk-NSYWEYWT.mjs.map +1 -0
- package/dist/{chunk-6BCRFIEW.mjs → chunk-NYVT33DR.mjs} +1 -1
- package/dist/chunk-NYVT33DR.mjs.map +1 -0
- package/dist/{chunk-B5P232BA.mjs → chunk-OBMK7JO2.mjs} +1 -1
- package/dist/chunk-OBMK7JO2.mjs.map +1 -0
- package/dist/{chunk-2PB2OCC6.mjs → chunk-PTQLD7TG.mjs} +1 -1
- package/dist/chunk-PTQLD7TG.mjs.map +1 -0
- package/dist/{chunk-IFCX35BI.mjs → chunk-PWMHSN27.mjs} +1 -1
- package/dist/chunk-PWMHSN27.mjs.map +1 -0
- package/dist/{chunk-JDMFIUGM.mjs → chunk-QRQPLMV4.mjs} +1 -1
- package/dist/chunk-QRQPLMV4.mjs.map +1 -0
- package/dist/{chunk-TULUUJ3E.mjs → chunk-R5DNKXDI.mjs} +4 -4
- package/dist/chunk-R5DNKXDI.mjs.map +1 -0
- package/dist/{chunk-GLAZTR32.mjs → chunk-RLDY4N3Q.mjs} +2 -2
- package/dist/chunk-RLDY4N3Q.mjs.map +1 -0
- package/dist/{chunk-PRTIPC5X.mjs → chunk-RU3RXBUC.mjs} +1 -1
- package/dist/chunk-RU3RXBUC.mjs.map +1 -0
- package/dist/{chunk-3PFYAKOD.mjs → chunk-S767XFOS.mjs} +1 -1
- package/dist/chunk-S767XFOS.mjs.map +1 -0
- package/dist/{chunk-6LDIBBWQ.mjs → chunk-SGSQKXDO.mjs} +2 -2
- package/dist/chunk-SGSQKXDO.mjs.map +1 -0
- package/dist/{chunk-23DC774L.mjs → chunk-TOLR2FNF.mjs} +1 -1
- package/dist/chunk-TOLR2FNF.mjs.map +1 -0
- package/dist/{chunk-V6LXSPMF.mjs → chunk-UNX3KZO2.mjs} +1 -1
- package/dist/chunk-UNX3KZO2.mjs.map +1 -0
- package/dist/{chunk-J6SWM4X6.mjs → chunk-UZP4YX7I.mjs} +1 -1
- package/dist/chunk-UZP4YX7I.mjs.map +1 -0
- package/dist/{chunk-6GRNTXI3.mjs → chunk-VACGGQOL.mjs} +1 -1
- package/dist/chunk-VACGGQOL.mjs.map +1 -0
- package/dist/{chunk-XLO3QZVY.mjs → chunk-VAKCSKGR.mjs} +3 -3
- package/dist/chunk-VAKCSKGR.mjs.map +1 -0
- package/dist/{chunk-YEZIGQJG.mjs → chunk-VJGGYY4Y.mjs} +2 -2
- package/dist/chunk-VJGGYY4Y.mjs.map +1 -0
- package/dist/{chunk-KBJTBR5T.mjs → chunk-WFQ3LAHQ.mjs} +1 -1
- package/dist/chunk-WFQ3LAHQ.mjs.map +1 -0
- package/dist/{chunk-TCHT4HCP.mjs → chunk-XS4ZPJMT.mjs} +4 -4
- package/dist/chunk-XS4ZPJMT.mjs.map +1 -0
- package/dist/{chunk-T2C2WVFL.mjs → chunk-XW452I77.mjs} +1 -1
- package/dist/chunk-XW452I77.mjs.map +1 -0
- package/dist/{chunk-ZQNAZPSK.mjs → chunk-YMNXRH52.mjs} +1 -1
- package/dist/chunk-YMNXRH52.mjs.map +1 -0
- package/dist/{chunk-SF3V7XXM.mjs → chunk-Z4IO7EIH.mjs} +1 -1
- package/dist/chunk-Z4IO7EIH.mjs.map +1 -0
- package/dist/function/debounce.d.mts +4 -3
- package/dist/function/debounce.d.ts +4 -3
- package/dist/function/debounce.js +2 -2
- package/dist/function/debounce.js.map +1 -1
- package/dist/function/debounce.mjs +1 -1
- package/dist/function/index.js +4 -4
- package/dist/function/index.js.map +1 -1
- package/dist/function/index.mjs +3 -3
- package/dist/function/once.js.map +1 -1
- package/dist/function/once.mjs +1 -1
- package/dist/function/throttle.d.mts +3 -3
- package/dist/function/throttle.d.ts +3 -3
- package/dist/function/throttle.js +2 -2
- package/dist/function/throttle.js.map +1 -1
- package/dist/function/throttle.mjs +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +72 -72
- package/dist/math/index.js.map +1 -1
- package/dist/math/index.mjs +2 -2
- package/dist/math/round.js.map +1 -1
- package/dist/math/round.mjs +1 -1
- package/dist/math/sum.js.map +1 -1
- package/dist/math/sum.mjs +1 -1
- package/dist/object/index.js.map +1 -1
- package/dist/object/index.mjs +4 -4
- package/dist/object/omit.js.map +1 -1
- package/dist/object/omit.mjs +1 -1
- package/dist/object/omitBy.js.map +1 -1
- package/dist/object/omitBy.mjs +1 -1
- package/dist/object/pick.js.map +1 -1
- package/dist/object/pick.mjs +1 -1
- package/dist/object/pickBy.js.map +1 -1
- package/dist/object/pickBy.mjs +1 -1
- package/dist/predicate/index.js.map +1 -1
- package/dist/predicate/index.mjs +4 -4
- package/dist/predicate/isNil.js.map +1 -1
- package/dist/predicate/isNil.mjs +1 -1
- package/dist/predicate/isNotNil.js.map +1 -1
- package/dist/predicate/isNotNil.mjs +1 -1
- package/dist/predicate/isNull.js.map +1 -1
- package/dist/predicate/isNull.mjs +1 -1
- package/dist/predicate/isUndefined.js.map +1 -1
- package/dist/predicate/isUndefined.mjs +1 -1
- package/dist/promise/delay.js.map +1 -1
- package/dist/promise/delay.mjs +1 -1
- package/dist/promise/index.js.map +1 -1
- package/dist/promise/index.mjs +1 -1
- package/package.json +2 -3
- package/dist/chunk-23DC774L.mjs.map +0 -1
- package/dist/chunk-2PB2OCC6.mjs.map +0 -1
- package/dist/chunk-3PFYAKOD.mjs.map +0 -1
- package/dist/chunk-6BCRFIEW.mjs.map +0 -1
- package/dist/chunk-6GRNTXI3.mjs.map +0 -1
- package/dist/chunk-6LDIBBWQ.mjs.map +0 -1
- package/dist/chunk-7LAOIS6P.mjs.map +0 -1
- package/dist/chunk-AFYV2UVZ.mjs.map +0 -1
- package/dist/chunk-ANJSX6WH.mjs.map +0 -1
- package/dist/chunk-B5P232BA.mjs.map +0 -1
- package/dist/chunk-GELVVASW.mjs.map +0 -1
- package/dist/chunk-GLAZTR32.mjs.map +0 -1
- package/dist/chunk-HOQRMBSB.mjs.map +0 -1
- package/dist/chunk-IFCX35BI.mjs.map +0 -1
- package/dist/chunk-J6SWM4X6.mjs.map +0 -1
- package/dist/chunk-JDMFIUGM.mjs.map +0 -1
- package/dist/chunk-KBJTBR5T.mjs.map +0 -1
- package/dist/chunk-L25VRQ54.mjs.map +0 -1
- package/dist/chunk-L3C6TG2V.mjs.map +0 -1
- package/dist/chunk-M3SHJ3LL.mjs.map +0 -1
- package/dist/chunk-OLBUAFBX.mjs.map +0 -1
- package/dist/chunk-PHG5JCSW.mjs.map +0 -1
- package/dist/chunk-PRTIPC5X.mjs.map +0 -1
- package/dist/chunk-PUQLVKMB.mjs.map +0 -1
- package/dist/chunk-QC3SFAQJ.mjs.map +0 -1
- package/dist/chunk-SF3V7XXM.mjs.map +0 -1
- package/dist/chunk-SPLO5OZW.mjs.map +0 -1
- package/dist/chunk-SQOYF647.mjs.map +0 -1
- package/dist/chunk-T2C2WVFL.mjs.map +0 -1
- package/dist/chunk-TCHT4HCP.mjs.map +0 -1
- package/dist/chunk-TF6N37OE.mjs.map +0 -1
- package/dist/chunk-TK2EDHSP.mjs.map +0 -1
- package/dist/chunk-TULUUJ3E.mjs.map +0 -1
- package/dist/chunk-UFAA5WKR.mjs.map +0 -1
- package/dist/chunk-V6LXSPMF.mjs.map +0 -1
- package/dist/chunk-XLO3QZVY.mjs.map +0 -1
- package/dist/chunk-Y6ZRNII6.mjs.map +0 -1
- package/dist/chunk-YEZIGQJG.mjs.map +0 -1
- package/dist/chunk-YHY2XTJW.mjs.map +0 -1
- package/dist/chunk-YNRYG5OB.mjs.map +0 -1
- package/dist/chunk-ZBG3EYM3.mjs.map +0 -1
- package/dist/chunk-ZQNAZPSK.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,144 +1,144 @@
|
|
|
1
1
|
import "./chunk-ARZ5BDR6.mjs";
|
|
2
2
|
import {
|
|
3
3
|
delay
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7SJHJHBN.mjs";
|
|
5
5
|
import "./chunk-T5JCRGXA.mjs";
|
|
6
6
|
import {
|
|
7
7
|
omit
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UZP4YX7I.mjs";
|
|
9
9
|
import {
|
|
10
10
|
omitBy
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Z4IO7EIH.mjs";
|
|
12
12
|
import {
|
|
13
13
|
pick
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-724PNXPR.mjs";
|
|
15
15
|
import {
|
|
16
16
|
pickBy
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-XW452I77.mjs";
|
|
18
18
|
import "./chunk-MAJSPFA6.mjs";
|
|
19
19
|
import {
|
|
20
20
|
isNull
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-FUWEG5ZM.mjs";
|
|
22
22
|
import {
|
|
23
23
|
isUndefined
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NK2262VG.mjs";
|
|
25
25
|
import {
|
|
26
26
|
isNil
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-WFQ3LAHQ.mjs";
|
|
28
28
|
import {
|
|
29
29
|
isNotNil
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-YMNXRH52.mjs";
|
|
31
31
|
import "./chunk-IJLQVGW4.mjs";
|
|
32
32
|
import {
|
|
33
33
|
clamp
|
|
34
34
|
} from "./chunk-RK6PRCEJ.mjs";
|
|
35
35
|
import {
|
|
36
36
|
round
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-LAZNLIBJ.mjs";
|
|
38
38
|
import {
|
|
39
39
|
sum
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-SYQTG4N4.mjs";
|
|
42
|
-
import {
|
|
43
|
-
debounce
|
|
44
|
-
} from "./chunk-GELVVASW.mjs";
|
|
45
|
-
import {
|
|
46
|
-
once
|
|
47
|
-
} from "./chunk-UFAA5WKR.mjs";
|
|
48
|
-
import {
|
|
49
|
-
throttle
|
|
50
|
-
} from "./chunk-XLO3QZVY.mjs";
|
|
40
|
+
} from "./chunk-OBMK7JO2.mjs";
|
|
51
41
|
import "./chunk-EJGAXTF7.mjs";
|
|
52
|
-
import {
|
|
53
|
-
uniqBy
|
|
54
|
-
} from "./chunk-TK2EDHSP.mjs";
|
|
55
|
-
import {
|
|
56
|
-
xor
|
|
57
|
-
} from "./chunk-QC3SFAQJ.mjs";
|
|
58
42
|
import {
|
|
59
43
|
xorBy
|
|
60
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-R5DNKXDI.mjs";
|
|
61
45
|
import {
|
|
62
46
|
xorWith
|
|
63
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-XS4ZPJMT.mjs";
|
|
64
48
|
import {
|
|
65
49
|
zip
|
|
66
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-5JWSGT4R.mjs";
|
|
67
51
|
import {
|
|
68
52
|
zipWith
|
|
69
|
-
} from "./chunk-
|
|
70
|
-
import {
|
|
71
|
-
shuffle
|
|
72
|
-
} from "./chunk-23DC774L.mjs";
|
|
73
|
-
import {
|
|
74
|
-
take
|
|
75
|
-
} from "./chunk-OLBUAFBX.mjs";
|
|
76
|
-
import {
|
|
77
|
-
takeRight
|
|
78
|
-
} from "./chunk-L3C6TG2V.mjs";
|
|
79
|
-
import {
|
|
80
|
-
takeRightWhile
|
|
81
|
-
} from "./chunk-IFCX35BI.mjs";
|
|
53
|
+
} from "./chunk-RU3RXBUC.mjs";
|
|
82
54
|
import {
|
|
83
55
|
takeWhile
|
|
84
|
-
} from "./chunk-
|
|
85
|
-
import {
|
|
86
|
-
union
|
|
87
|
-
} from "./chunk-GLAZTR32.mjs";
|
|
88
|
-
import {
|
|
89
|
-
uniq
|
|
90
|
-
} from "./chunk-JDMFIUGM.mjs";
|
|
56
|
+
} from "./chunk-2KXLTAVK.mjs";
|
|
91
57
|
import {
|
|
92
58
|
unionBy
|
|
93
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-7PPND7QY.mjs";
|
|
94
60
|
import {
|
|
95
61
|
unionWith
|
|
96
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-VJGGYY4Y.mjs";
|
|
63
|
+
import {
|
|
64
|
+
uniqBy
|
|
65
|
+
} from "./chunk-JMLFPGZ3.mjs";
|
|
97
66
|
import {
|
|
98
67
|
uniqWith
|
|
99
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-EAI4DDCQ.mjs";
|
|
100
69
|
import {
|
|
101
|
-
|
|
102
|
-
} from "./chunk-
|
|
70
|
+
xor
|
|
71
|
+
} from "./chunk-7OZZODAE.mjs";
|
|
103
72
|
import {
|
|
104
|
-
|
|
105
|
-
} from "./chunk-
|
|
73
|
+
union
|
|
74
|
+
} from "./chunk-RLDY4N3Q.mjs";
|
|
75
|
+
import {
|
|
76
|
+
uniq
|
|
77
|
+
} from "./chunk-QRQPLMV4.mjs";
|
|
106
78
|
import {
|
|
107
79
|
intersectionBy
|
|
108
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-2VB6XU3I.mjs";
|
|
109
81
|
import {
|
|
110
82
|
intersectionWith
|
|
111
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-GJM7F3TH.mjs";
|
|
112
84
|
import {
|
|
113
85
|
partition
|
|
114
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-NEMQJ2GF.mjs";
|
|
115
87
|
import {
|
|
116
88
|
sample
|
|
117
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-J3NTLMAE.mjs";
|
|
118
90
|
import {
|
|
119
|
-
|
|
120
|
-
} from "./chunk-
|
|
91
|
+
shuffle
|
|
92
|
+
} from "./chunk-TOLR2FNF.mjs";
|
|
121
93
|
import {
|
|
122
|
-
|
|
123
|
-
} from "./chunk-
|
|
94
|
+
take
|
|
95
|
+
} from "./chunk-HQF6OFGM.mjs";
|
|
124
96
|
import {
|
|
125
|
-
|
|
126
|
-
} from "./chunk-
|
|
97
|
+
takeRight
|
|
98
|
+
} from "./chunk-BAJC3BM7.mjs";
|
|
99
|
+
import {
|
|
100
|
+
takeRightWhile
|
|
101
|
+
} from "./chunk-PWMHSN27.mjs";
|
|
127
102
|
import {
|
|
128
103
|
differenceWith
|
|
129
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-NSYWEYWT.mjs";
|
|
130
105
|
import {
|
|
131
106
|
drop
|
|
132
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-NYVT33DR.mjs";
|
|
133
108
|
import {
|
|
134
109
|
dropRight
|
|
135
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-VACGGQOL.mjs";
|
|
136
111
|
import {
|
|
137
112
|
dropRightWhile
|
|
138
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-SGSQKXDO.mjs";
|
|
139
114
|
import {
|
|
140
115
|
dropWhile
|
|
141
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-S767XFOS.mjs";
|
|
117
|
+
import {
|
|
118
|
+
groupBy
|
|
119
|
+
} from "./chunk-UNX3KZO2.mjs";
|
|
120
|
+
import {
|
|
121
|
+
intersection
|
|
122
|
+
} from "./chunk-7GWOR247.mjs";
|
|
123
|
+
import "./chunk-SYQTG4N4.mjs";
|
|
124
|
+
import {
|
|
125
|
+
debounce
|
|
126
|
+
} from "./chunk-L4Y3G6AJ.mjs";
|
|
127
|
+
import {
|
|
128
|
+
once
|
|
129
|
+
} from "./chunk-ARWKEQMQ.mjs";
|
|
130
|
+
import {
|
|
131
|
+
throttle
|
|
132
|
+
} from "./chunk-VAKCSKGR.mjs";
|
|
133
|
+
import {
|
|
134
|
+
chunk
|
|
135
|
+
} from "./chunk-35TWSMYS.mjs";
|
|
136
|
+
import {
|
|
137
|
+
difference
|
|
138
|
+
} from "./chunk-PTQLD7TG.mjs";
|
|
139
|
+
import {
|
|
140
|
+
differenceBy
|
|
141
|
+
} from "./chunk-EAI6NLXI.mjs";
|
|
142
142
|
import "./chunk-2MM5EJJX.mjs";
|
|
143
143
|
export {
|
|
144
144
|
chunk,
|
package/dist/math/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/math/index.ts","../../src/math/clamp.ts","../../src/math/round.ts","../../src/math/sum.ts"],"sourcesContent":["export { clamp } from './clamp';\nexport { round } from './round';\nexport { sum } from './sum'
|
|
1
|
+
{"version":3,"sources":["../../src/math/index.ts","../../src/math/clamp.ts","../../src/math/round.ts","../../src/math/sum.ts"],"sourcesContent":["export { clamp } from './clamp';\nexport { round } from './round';\nexport { sum } from './sum';","/**\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","/**\n * Rounds a number to a specified precision.\n * \n * This function takes a number and an optional precision value, and returns the number rounded \n * to the specified number of decimal places.\n *\n * @param {number} value - The number to round.\n * @param {number} [precision=0] - The number of decimal places to round to. Defaults to 0.\n * @returns {number} The rounded number.\n *\n * @example\n * * const result1 = round(1.2345); // result1 will be 1\n * const result2 = round(1.2345, 2); // result2 will be 1.23\n * const result3 = round(1.2345, 3); // result3 will be 1.235\n */\nexport function round(value: number, precision: number = 0): number {\n const multiplier = Math.pow(10, precision);\n return Math.round(value * multiplier) / multiplier;\n}\n","/**\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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmBO,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;;;ACVO,SAAS,MAAM,OAAe,YAAoB,GAAW;AAClE,QAAM,aAAa,KAAK,IAAI,IAAI,SAAS;AACzC,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;;;ACLO,SAAS,IAAI,MAAwB;AAC1C,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;","names":[]}
|
package/dist/math/index.mjs
CHANGED
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "../chunk-RK6PRCEJ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
round
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-LAZNLIBJ.mjs";
|
|
8
8
|
import {
|
|
9
9
|
sum
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-OBMK7JO2.mjs";
|
|
11
11
|
import "../chunk-2MM5EJJX.mjs";
|
|
12
12
|
export {
|
|
13
13
|
clamp,
|
package/dist/math/round.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/math/round.ts"],"sourcesContent":["/**\n * Rounds a number to a specified precision.\n
|
|
1
|
+
{"version":3,"sources":["../../src/math/round.ts"],"sourcesContent":["/**\n * Rounds a number to a specified precision.\n * \n * This function takes a number and an optional precision value, and returns the number rounded \n * to the specified number of decimal places.\n *\n * @param {number} value - The number to round.\n * @param {number} [precision=0] - The number of decimal places to round to. Defaults to 0.\n * @returns {number} The rounded number.\n *\n * @example\n * * const result1 = round(1.2345); // result1 will be 1\n * const result2 = round(1.2345, 2); // result2 will be 1.23\n * const result3 = round(1.2345, 3); // result3 will be 1.235\n */\nexport function round(value: number, precision: number = 0): number {\n const multiplier = Math.pow(10, precision);\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,MAAM,OAAe,YAAoB,GAAW;AAClE,QAAM,aAAa,KAAK,IAAI,IAAI,SAAS;AACzC,SAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AAC1C;","names":[]}
|
package/dist/math/round.mjs
CHANGED
package/dist/math/sum.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/math/sum.ts"],"sourcesContent":["/**\n * Calculates the sum of an array of numbers.\n
|
|
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,SAAS,IAAI,MAAwB;AAC1C,MAAI,SAAS;AAEb,aAAW,OAAO,MAAM;AACtB,cAAU;AAAA,EACZ;AAEA,SAAO;AACT;","names":[]}
|
package/dist/math/sum.mjs
CHANGED
package/dist/object/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/object/index.ts","../../src/object/omit.ts","../../src/object/omitBy.ts","../../src/object/pick.ts","../../src/object/pickBy.ts"],"sourcesContent":["export { omit } from './omit';\nexport { omitBy } from './omitBy';\nexport { pick } from './pick';\nexport { pickBy } from './pickBy'
|
|
1
|
+
{"version":3,"sources":["../../src/object/index.ts","../../src/object/omit.ts","../../src/object/omitBy.ts","../../src/object/pick.ts","../../src/object/pickBy.ts"],"sourcesContent":["export { omit } from './omit';\nexport { omitBy } from './omitBy';\nexport { pick } from './pick';\nexport { pickBy } from './pickBy';","/**\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","/**\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}","/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that \n * includes only the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n","/**\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;;;ACLO,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;;;ACfO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;;;ACLO,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/object/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "../chunk-T5JCRGXA.mjs";
|
|
2
2
|
import {
|
|
3
3
|
omit
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-UZP4YX7I.mjs";
|
|
5
5
|
import {
|
|
6
6
|
omitBy
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-Z4IO7EIH.mjs";
|
|
8
8
|
import {
|
|
9
9
|
pick
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-724PNXPR.mjs";
|
|
11
11
|
import {
|
|
12
12
|
pickBy
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-XW452I77.mjs";
|
|
14
14
|
import "../chunk-2MM5EJJX.mjs";
|
|
15
15
|
export {
|
|
16
16
|
omit,
|
package/dist/object/omit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,mBAAK;AAEpB,aAAW,OAAO,MAAM;AACtB,WAAO,OAAO,GAAG;AAAA,EACnB;AAEA,SAAO;AACT;","names":[]}
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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/object/omit.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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":[]}
|
package/dist/object/omitBy.mjs
CHANGED
package/dist/object/pick.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/object/pick.ts"],"sourcesContent":["/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that\n * includes only the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/object/pick.ts"],"sourcesContent":["/**\n * Creates a new object composed of the picked object properties.\n *\n * This function takes an object and an array of keys, and returns a new object that \n * includes only the properties corresponding to the specified keys.\n *\n * @param {T} obj - The object to pick keys from.\n * @param {K[]} keys - An array of keys to be picked from the object.\n * @returns {Pick<T, K>} A new object with the specified keys picked.\n *\n * @example\n * * const obj = { a: 1, b: 2, c: 3 };\n * const result = pick(obj, ['a', 'c']);\n * // result will be { a: 1, c: 3 }\n */\nexport function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n\n for (const key of keys) {\n result[key] = obj[key];\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,KAA2B,KAAQ,MAAuB;AACxE,QAAM,SAAS,CAAC;AAEhB,aAAW,OAAO,MAAM;AACtB,WAAO,GAAG,IAAI,IAAI,GAAG;AAAA,EACvB;AAEA,SAAO;AACT;","names":[]}
|
package/dist/object/pick.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;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/object/pickBy.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/predicate/index.ts","../../src/predicate/isNil.ts","../../src/predicate/isNotNil.ts","../../src/predicate/isNull.ts","../../src/predicate/isUndefined.ts"],"sourcesContent":["export { isNil } from './isNil';\nexport { isNotNil } from './isNotNil';\nexport { isNull } from './isNull';\nexport { isUndefined } from './isUndefined'
|
|
1
|
+
{"version":3,"sources":["../../src/predicate/index.ts","../../src/predicate/isNil.ts","../../src/predicate/isNotNil.ts","../../src/predicate/isNull.ts","../../src/predicate/isUndefined.ts"],"sourcesContent":["export { isNil } from './isNil';\nexport { isNotNil } from './isNotNil';\nexport { isNull } from './isNull';\nexport { isUndefined } from './isUndefined';","/**\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}","/**\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","/**\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","/**\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;AAAA;AAAA;AAAA;;;ACmBO,SAAS,MAAM,GAAmC;AACvD,SAAO,MAAM,QAAQ,MAAM;AAC7B;;;ACNO,SAAS,SAAY,GAAiC;AAC3D,SAAO,MAAM,QAAQ,MAAM;AAC7B;;;ACGO,SAAS,OAAO,GAAuB;AAC5C,SAAO,MAAM;AACf;;;ACFO,SAAS,YAAY,GAA4B;AACtD,SAAO,MAAM;AACf;","names":[]}
|
package/dist/predicate/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "../chunk-MAJSPFA6.mjs";
|
|
2
2
|
import {
|
|
3
3
|
isNull
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-FUWEG5ZM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
isUndefined
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-NK2262VG.mjs";
|
|
8
8
|
import {
|
|
9
9
|
isNil
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-WFQ3LAHQ.mjs";
|
|
11
11
|
import {
|
|
12
12
|
isNotNil
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-YMNXRH52.mjs";
|
|
14
14
|
import "../chunk-2MM5EJJX.mjs";
|
|
15
15
|
export {
|
|
16
16
|
isNil,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/predicate/isNil.ts"],"sourcesContent":["/**\n * Checks if a given value is null or undefined.\n
|
|
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":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBO,SAAS,MAAM,GAAmC;AACvD,SAAO,MAAM,QAAQ,MAAM;AAC7B;","names":[]}
|
package/dist/predicate/isNil.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/predicate/isNotNil.ts"],"sourcesContent":["/**\n * Checks if the given value is not null nor undefined.\n
|
|
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":[]}
|
|
@@ -1 +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
|
|
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":[]}
|
|
@@ -1 +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
|
|
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":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/promise/delay.ts"],"sourcesContent":["/**\n * Delays the execution of code for a specified number of milliseconds.\n
|
|
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":[]}
|
package/dist/promise/delay.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/promise/index.ts","../../src/promise/delay.ts"],"sourcesContent":["export { delay } from './delay'
|
|
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":[]}
|
package/dist/promise/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"docs"
|
|
7
7
|
],
|
|
@@ -190,8 +190,7 @@
|
|
|
190
190
|
"prepack": "yarn build",
|
|
191
191
|
"build": "tsup && ./.scripts/postbuild.sh",
|
|
192
192
|
"test": "vitest run --coverage --typecheck",
|
|
193
|
-
"lint": "eslint ./src --ext .ts"
|
|
194
|
-
"format": "prettier --write ."
|
|
193
|
+
"lint": "eslint ./src --ext .ts"
|
|
195
194
|
},
|
|
196
195
|
"main": "./dist/index.js",
|
|
197
196
|
"module": "./dist/index.mjs",
|
|
@@ -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":[]}
|
|
@@ -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}\n"],"mappings":";AAsBO,SAAS,WAAc,UAAe,WAAqB;AAChE,SAAO,SAAS,OAAO,UAAQ;AAC7B,WAAO,CAAC,UAAU,SAAS,IAAI;AAAA,EACjC,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/drop.ts"],"sourcesContent":["/**\n * Removes a specified number of elements from the beginning 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 start.\n *\n * @param {T[]} arr - The array from which to drop elements.\n * @param {number} itemsCount - The number of elements to drop from the beginning of the array.\n * @returns {T[]} A new array with the specified number of elements removed from the start.\n *\n * @example\n * * const array = [1, 2, 3, 4, 5];\n * const result = drop(array, 2);\n * // result will be [3, 4, 5] since the first two elements are dropped.\n */\nexport function drop<T>(arr: T[], itemsCount: number): T[] {\n return arr.slice(itemsCount);\n}\n"],"mappings":";AAeO,SAAS,KAAQ,KAAU,YAAyB;AACzD,SAAO,IAAI,MAAM,UAAU;AAC7B;","names":[]}
|
|
@@ -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":[]}
|
|
@@ -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}\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":[]}
|