es-toolkit 1.5.0-dev.102 → 1.5.0-dev.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array/compact.d.mts +14 -0
- package/dist/array/compact.d.ts +14 -0
- package/dist/array/compact.js +39 -0
- package/dist/array/compact.js.map +1 -0
- package/dist/array/compact.mjs +8 -0
- package/dist/array/index.d.mts +1 -0
- package/dist/array/index.d.ts +1 -0
- package/dist/array/index.js +21 -8
- package/dist/array/index.js.map +1 -1
- package/dist/array/index.mjs +37 -33
- package/dist/array/maxBy.d.mts +8 -15
- package/dist/array/maxBy.d.ts +8 -15
- package/dist/array/maxBy.js +4 -4
- package/dist/array/maxBy.js.map +1 -1
- package/dist/array/maxBy.mjs +1 -1
- package/dist/array/minBy.d.mts +9 -8
- package/dist/array/minBy.d.ts +9 -8
- package/dist/array/minBy.js +4 -4
- package/dist/array/minBy.js.map +1 -1
- package/dist/array/minBy.mjs +1 -1
- package/dist/chunk-FXOABQRO.mjs +18 -0
- package/dist/chunk-FXOABQRO.mjs.map +1 -0
- package/dist/chunk-KTL5FU5A.mjs +1 -0
- package/dist/chunk-KTL5FU5A.mjs.map +1 -0
- package/dist/chunk-OIHARMNM.mjs +18 -0
- package/dist/chunk-OIHARMNM.mjs.map +1 -0
- package/dist/chunk-PERPAVPS.mjs +15 -0
- package/dist/chunk-PERPAVPS.mjs.map +1 -0
- package/dist/function/index.mjs +3 -3
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +21 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -57
- package/dist/math/index.mjs +3 -3
- package/dist/predicate/index.mjs +3 -3
- package/package.json +1 -1
- package/dist/chunk-H23GUJVF.mjs +0 -18
- package/dist/chunk-H23GUJVF.mjs.map +0 -1
- package/dist/chunk-KZ5JY7J3.mjs +0 -18
- package/dist/chunk-KZ5JY7J3.mjs.map +0 -1
- package/dist/chunk-NP6PDX3E.mjs +0 -1
- /package/dist/{chunk-NP6PDX3E.mjs.map → array/compact.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -16,6 +16,9 @@ import {
|
|
|
16
16
|
pickBy
|
|
17
17
|
} from "./chunk-MQWVBKUT.mjs";
|
|
18
18
|
import "./chunk-MAJSPFA6.mjs";
|
|
19
|
+
import {
|
|
20
|
+
isNotNil
|
|
21
|
+
} from "./chunk-ZQNAZPSK.mjs";
|
|
19
22
|
import {
|
|
20
23
|
isNull
|
|
21
24
|
} from "./chunk-AIRSKN47.mjs";
|
|
@@ -25,10 +28,10 @@ import {
|
|
|
25
28
|
import {
|
|
26
29
|
isNil
|
|
27
30
|
} from "./chunk-OHQAR5AU.mjs";
|
|
28
|
-
import {
|
|
29
|
-
isNotNil
|
|
30
|
-
} from "./chunk-ZQNAZPSK.mjs";
|
|
31
31
|
import "./chunk-N6EM6ETS.mjs";
|
|
32
|
+
import {
|
|
33
|
+
throttle
|
|
34
|
+
} from "./chunk-XLO3QZVY.mjs";
|
|
32
35
|
import {
|
|
33
36
|
debounce
|
|
34
37
|
} from "./chunk-MKETZ2RP.mjs";
|
|
@@ -38,33 +41,13 @@ import {
|
|
|
38
41
|
import {
|
|
39
42
|
once
|
|
40
43
|
} from "./chunk-UFAA5WKR.mjs";
|
|
44
|
+
import "./chunk-KTL5FU5A.mjs";
|
|
41
45
|
import {
|
|
42
|
-
|
|
43
|
-
} from "./chunk-
|
|
44
|
-
import "./chunk-FZEZH22H.mjs";
|
|
45
|
-
import {
|
|
46
|
-
AbortError
|
|
47
|
-
} from "./chunk-VP2LXY75.mjs";
|
|
48
|
-
import "./chunk-7LAMAYGN.mjs";
|
|
49
|
-
import {
|
|
50
|
-
sum
|
|
51
|
-
} from "./chunk-7OU22ENP.mjs";
|
|
52
|
-
import {
|
|
53
|
-
clamp
|
|
54
|
-
} from "./chunk-MLCL773E.mjs";
|
|
55
|
-
import {
|
|
56
|
-
randomInt
|
|
57
|
-
} from "./chunk-5UT77WON.mjs";
|
|
58
|
-
import {
|
|
59
|
-
random
|
|
60
|
-
} from "./chunk-LCP6FOCX.mjs";
|
|
61
|
-
import {
|
|
62
|
-
range
|
|
63
|
-
} from "./chunk-UNLX2F2Y.mjs";
|
|
46
|
+
xorBy
|
|
47
|
+
} from "./chunk-AM2EGFCU.mjs";
|
|
64
48
|
import {
|
|
65
|
-
|
|
66
|
-
} from "./chunk-
|
|
67
|
-
import "./chunk-NP6PDX3E.mjs";
|
|
49
|
+
xorWith
|
|
50
|
+
} from "./chunk-UMDNWTJC.mjs";
|
|
68
51
|
import {
|
|
69
52
|
zip
|
|
70
53
|
} from "./chunk-IDCUZVJL.mjs";
|
|
@@ -72,26 +55,35 @@ import {
|
|
|
72
55
|
zipWith
|
|
73
56
|
} from "./chunk-4KYXHZ4R.mjs";
|
|
74
57
|
import {
|
|
75
|
-
|
|
76
|
-
} from "./chunk-
|
|
77
|
-
import {
|
|
78
|
-
xor
|
|
79
|
-
} from "./chunk-G2TTBLLJ.mjs";
|
|
80
|
-
import {
|
|
81
|
-
xorBy
|
|
82
|
-
} from "./chunk-AM2EGFCU.mjs";
|
|
58
|
+
takeWhile
|
|
59
|
+
} from "./chunk-2IXFGSUA.mjs";
|
|
83
60
|
import {
|
|
84
61
|
unionBy
|
|
85
62
|
} from "./chunk-NRNKP6JF.mjs";
|
|
86
|
-
import {
|
|
87
|
-
xorWith
|
|
88
|
-
} from "./chunk-UMDNWTJC.mjs";
|
|
89
63
|
import {
|
|
90
64
|
unionWith
|
|
91
65
|
} from "./chunk-642SWVKJ.mjs";
|
|
66
|
+
import {
|
|
67
|
+
uniqBy
|
|
68
|
+
} from "./chunk-WPDDOUQT.mjs";
|
|
92
69
|
import {
|
|
93
70
|
uniqWith
|
|
94
71
|
} from "./chunk-2PFDLYQC.mjs";
|
|
72
|
+
import {
|
|
73
|
+
xor
|
|
74
|
+
} from "./chunk-G2TTBLLJ.mjs";
|
|
75
|
+
import {
|
|
76
|
+
union
|
|
77
|
+
} from "./chunk-DAJZ3JCI.mjs";
|
|
78
|
+
import {
|
|
79
|
+
uniq
|
|
80
|
+
} from "./chunk-XFCW7XJ4.mjs";
|
|
81
|
+
import {
|
|
82
|
+
maxBy
|
|
83
|
+
} from "./chunk-FXOABQRO.mjs";
|
|
84
|
+
import {
|
|
85
|
+
minBy
|
|
86
|
+
} from "./chunk-OIHARMNM.mjs";
|
|
95
87
|
import {
|
|
96
88
|
partition
|
|
97
89
|
} from "./chunk-5L2V7WD3.mjs";
|
|
@@ -111,14 +103,14 @@ import {
|
|
|
111
103
|
takeRightWhile
|
|
112
104
|
} from "./chunk-NTLX2MPV.mjs";
|
|
113
105
|
import {
|
|
114
|
-
|
|
115
|
-
} from "./chunk-
|
|
106
|
+
dropRight
|
|
107
|
+
} from "./chunk-Q75KEFW5.mjs";
|
|
116
108
|
import {
|
|
117
|
-
|
|
118
|
-
} from "./chunk-
|
|
109
|
+
dropRightWhile
|
|
110
|
+
} from "./chunk-RNJM5BHX.mjs";
|
|
119
111
|
import {
|
|
120
|
-
|
|
121
|
-
} from "./chunk-
|
|
112
|
+
dropWhile
|
|
113
|
+
} from "./chunk-K2BAFL2T.mjs";
|
|
122
114
|
import {
|
|
123
115
|
groupBy
|
|
124
116
|
} from "./chunk-LWXZFXY5.mjs";
|
|
@@ -131,15 +123,12 @@ import {
|
|
|
131
123
|
import {
|
|
132
124
|
intersectionWith
|
|
133
125
|
} from "./chunk-2EFS3VA3.mjs";
|
|
134
|
-
import {
|
|
135
|
-
maxBy
|
|
136
|
-
} from "./chunk-KZ5JY7J3.mjs";
|
|
137
|
-
import {
|
|
138
|
-
minBy
|
|
139
|
-
} from "./chunk-H23GUJVF.mjs";
|
|
140
126
|
import {
|
|
141
127
|
chunk
|
|
142
128
|
} from "./chunk-E6C5EZQA.mjs";
|
|
129
|
+
import {
|
|
130
|
+
compact
|
|
131
|
+
} from "./chunk-PERPAVPS.mjs";
|
|
143
132
|
import {
|
|
144
133
|
difference
|
|
145
134
|
} from "./chunk-JPUKH67K.mjs";
|
|
@@ -152,20 +141,35 @@ import {
|
|
|
152
141
|
import {
|
|
153
142
|
drop
|
|
154
143
|
} from "./chunk-ACFP3XMB.mjs";
|
|
144
|
+
import "./chunk-FZEZH22H.mjs";
|
|
155
145
|
import {
|
|
156
|
-
|
|
157
|
-
} from "./chunk-
|
|
146
|
+
AbortError
|
|
147
|
+
} from "./chunk-VP2LXY75.mjs";
|
|
148
|
+
import "./chunk-7LAMAYGN.mjs";
|
|
158
149
|
import {
|
|
159
|
-
|
|
160
|
-
} from "./chunk-
|
|
150
|
+
round
|
|
151
|
+
} from "./chunk-5PMKOZ2F.mjs";
|
|
161
152
|
import {
|
|
162
|
-
|
|
163
|
-
} from "./chunk-
|
|
153
|
+
sum
|
|
154
|
+
} from "./chunk-7OU22ENP.mjs";
|
|
155
|
+
import {
|
|
156
|
+
clamp
|
|
157
|
+
} from "./chunk-MLCL773E.mjs";
|
|
158
|
+
import {
|
|
159
|
+
randomInt
|
|
160
|
+
} from "./chunk-5UT77WON.mjs";
|
|
161
|
+
import {
|
|
162
|
+
random
|
|
163
|
+
} from "./chunk-LCP6FOCX.mjs";
|
|
164
|
+
import {
|
|
165
|
+
range
|
|
166
|
+
} from "./chunk-UNLX2F2Y.mjs";
|
|
164
167
|
import "./chunk-2MM5EJJX.mjs";
|
|
165
168
|
export {
|
|
166
169
|
AbortError,
|
|
167
170
|
chunk,
|
|
168
171
|
clamp,
|
|
172
|
+
compact,
|
|
169
173
|
debounce,
|
|
170
174
|
delay,
|
|
171
175
|
difference,
|
package/dist/math/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import "../chunk-7LAMAYGN.mjs";
|
|
2
|
+
import {
|
|
3
|
+
round
|
|
4
|
+
} from "../chunk-5PMKOZ2F.mjs";
|
|
2
5
|
import {
|
|
3
6
|
sum
|
|
4
7
|
} from "../chunk-7OU22ENP.mjs";
|
|
@@ -14,9 +17,6 @@ import {
|
|
|
14
17
|
import {
|
|
15
18
|
range
|
|
16
19
|
} from "../chunk-UNLX2F2Y.mjs";
|
|
17
|
-
import {
|
|
18
|
-
round
|
|
19
|
-
} from "../chunk-5PMKOZ2F.mjs";
|
|
20
20
|
import "../chunk-2MM5EJJX.mjs";
|
|
21
21
|
export {
|
|
22
22
|
clamp,
|
package/dist/predicate/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import "../chunk-MAJSPFA6.mjs";
|
|
2
|
+
import {
|
|
3
|
+
isNotNil
|
|
4
|
+
} from "../chunk-ZQNAZPSK.mjs";
|
|
2
5
|
import {
|
|
3
6
|
isNull
|
|
4
7
|
} from "../chunk-AIRSKN47.mjs";
|
|
@@ -8,9 +11,6 @@ import {
|
|
|
8
11
|
import {
|
|
9
12
|
isNil
|
|
10
13
|
} from "../chunk-OHQAR5AU.mjs";
|
|
11
|
-
import {
|
|
12
|
-
isNotNil
|
|
13
|
-
} from "../chunk-ZQNAZPSK.mjs";
|
|
14
14
|
import "../chunk-2MM5EJJX.mjs";
|
|
15
15
|
export {
|
|
16
16
|
isNil,
|
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.5.0-dev.
|
|
4
|
+
"version": "1.5.0-dev.105+60ae59bc",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"docs"
|
|
7
7
|
],
|
package/dist/chunk-H23GUJVF.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// src/array/minBy.ts
|
|
2
|
-
function minBy(elements, selector) {
|
|
3
|
-
let minElement = elements[0];
|
|
4
|
-
let min = Infinity;
|
|
5
|
-
for (const element of elements) {
|
|
6
|
-
const value = selector(element);
|
|
7
|
-
if (value < min) {
|
|
8
|
-
min = value;
|
|
9
|
-
minElement = element;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return minElement;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
minBy
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=chunk-H23GUJVF.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/minBy.ts"],"sourcesContent":["/**\n * Returns the minimum value in an array of numbers.\n *\n * This function takes an array of elements and a selector function, and returns the element with the minimum value according to the selector.\n *\n * If the array is empty, the function returns `undefined`.\n *\n * @param elements An array of elements.\n * @param selector A function that selects a number from an element.\n */\nexport function minBy<T>(elements: T[], selector: (element: T) => number): T {\n let minElement = elements[0];\n let min = Infinity;\n\n for (const element of elements) {\n const value = selector(element);\n if (value < min) {\n min = value;\n minElement = element;\n }\n }\n\n return minElement;\n}\n"],"mappings":";AAUO,SAAS,MAAS,UAAe,UAAqC;AAC3E,MAAI,aAAa,SAAS,CAAC;AAC3B,MAAI,MAAM;AAEV,aAAW,WAAW,UAAU;AAC9B,UAAM,QAAQ,SAAS,OAAO;AAC9B,QAAI,QAAQ,KAAK;AACf,YAAM;AACN,mBAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-KZ5JY7J3.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// src/array/maxBy.ts
|
|
2
|
-
function maxBy(elements, selector) {
|
|
3
|
-
let maxElement = elements[0];
|
|
4
|
-
let max = -Infinity;
|
|
5
|
-
for (const element of elements) {
|
|
6
|
-
const value = selector(element);
|
|
7
|
-
if (value > max) {
|
|
8
|
-
max = value;
|
|
9
|
-
maxElement = element;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return maxElement;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
maxBy
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=chunk-KZ5JY7J3.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/array/maxBy.ts"],"sourcesContent":["/**\n * Returns the element of the specified array that has the maximum value, according to the specified selector.\n *\n * This function takes an array of elements and a selector function, and returns the element with the maximum value according to the selector.\n *\n * @param {T[]} elements - An array of elements to be compared.\n * @param {(element: T) => number} selector - A function that takes an element and returns a number.\n * @returns {T} The element with the maximum value according to the selector.\n *\n * @example\n * const people = [\n * { name: 'Mark', age: 25 },\n * { name: 'Nunu', age: 30 },\n * { name: 'Overmars', age: 20 }\n * ];\n * const result = maxBy(people, person => person.age);\n * // result will be { name: 'Nunu', age: 30 }\n */\nexport function maxBy<T>(elements: T[], selector: (element: T) => number): T {\n let maxElement = elements[0];\n let max = -Infinity;\n\n for (const element of elements) {\n const value = selector(element);\n if (value > max) {\n max = value;\n maxElement = element;\n }\n }\n\n return maxElement;\n}\n"],"mappings":";AAkBO,SAAS,MAAS,UAAe,UAAqC;AAC3E,MAAI,aAAa,SAAS,CAAC;AAC3B,MAAI,MAAM;AAEV,aAAW,WAAW,UAAU;AAC9B,UAAM,QAAQ,SAAS,OAAO;AAC9B,QAAI,QAAQ,KAAK;AACf,YAAM;AACN,mBAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/chunk-NP6PDX3E.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-NP6PDX3E.mjs.map
|
|
File without changes
|