es-toolkit 1.12.0-dev.270 → 1.12.0-dev.271
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/index.mjs +45 -45
- package/dist/compat/index.d.mts +3 -2
- package/dist/compat/index.d.ts +3 -2
- package/dist/compat/index.js +8 -1
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/index.mjs +62 -55
- package/dist/compat/index.mjs.map +1 -1
- package/dist/index.mjs +54 -54
- package/package.json +1 -1
package/dist/array/index.mjs
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import "../chunk-DDH7K4QM.mjs";
|
|
2
|
+
import {
|
|
3
|
+
unzipWith
|
|
4
|
+
} from "../chunk-IFNXROZR.mjs";
|
|
5
|
+
import {
|
|
6
|
+
without
|
|
7
|
+
} from "../chunk-PYEYV7BY.mjs";
|
|
8
|
+
import {
|
|
9
|
+
xor
|
|
10
|
+
} from "../chunk-L7FQX5MN.mjs";
|
|
2
11
|
import {
|
|
3
12
|
xorBy
|
|
4
13
|
} from "../chunk-Q47NGNXT.mjs";
|
|
@@ -14,9 +23,21 @@ import {
|
|
|
14
23
|
import {
|
|
15
24
|
zipWith
|
|
16
25
|
} from "../chunk-4KYXHZ4R.mjs";
|
|
26
|
+
import {
|
|
27
|
+
toFilled
|
|
28
|
+
} from "../chunk-OP4OAKQJ.mjs";
|
|
29
|
+
import {
|
|
30
|
+
union
|
|
31
|
+
} from "../chunk-R6QA7PLZ.mjs";
|
|
32
|
+
import {
|
|
33
|
+
unionBy
|
|
34
|
+
} from "../chunk-NFS7RWWE.mjs";
|
|
17
35
|
import {
|
|
18
36
|
unionWith
|
|
19
37
|
} from "../chunk-2ZCITDMK.mjs";
|
|
38
|
+
import {
|
|
39
|
+
uniq
|
|
40
|
+
} from "../chunk-DVK2N4KC.mjs";
|
|
20
41
|
import {
|
|
21
42
|
uniqBy
|
|
22
43
|
} from "../chunk-B4COTK4K.mjs";
|
|
@@ -27,14 +48,16 @@ import {
|
|
|
27
48
|
unzip
|
|
28
49
|
} from "../chunk-UYZKMBDO.mjs";
|
|
29
50
|
import {
|
|
30
|
-
|
|
31
|
-
} from "../chunk-
|
|
51
|
+
sample
|
|
52
|
+
} from "../chunk-2KNLZB7V.mjs";
|
|
32
53
|
import {
|
|
33
|
-
|
|
34
|
-
} from "../chunk-
|
|
54
|
+
sampleSize
|
|
55
|
+
} from "../chunk-EHSKB6DF.mjs";
|
|
56
|
+
import "../chunk-GIWAOOFY.mjs";
|
|
57
|
+
import "../chunk-SYWMYQYJ.mjs";
|
|
35
58
|
import {
|
|
36
|
-
|
|
37
|
-
} from "../chunk-
|
|
59
|
+
shuffle
|
|
60
|
+
} from "../chunk-G7UQ5PUR.mjs";
|
|
38
61
|
import {
|
|
39
62
|
tail
|
|
40
63
|
} from "../chunk-OF6NM4G7.mjs";
|
|
@@ -51,17 +74,14 @@ import {
|
|
|
51
74
|
takeWhile
|
|
52
75
|
} from "../chunk-2IXFGSUA.mjs";
|
|
53
76
|
import {
|
|
54
|
-
|
|
55
|
-
} from "../chunk-
|
|
56
|
-
import {
|
|
57
|
-
union
|
|
58
|
-
} from "../chunk-R6QA7PLZ.mjs";
|
|
77
|
+
intersectionBy
|
|
78
|
+
} from "../chunk-O6UXZR3U.mjs";
|
|
59
79
|
import {
|
|
60
|
-
|
|
61
|
-
} from "../chunk-
|
|
80
|
+
intersectionWith
|
|
81
|
+
} from "../chunk-XI7KRD2C.mjs";
|
|
62
82
|
import {
|
|
63
|
-
|
|
64
|
-
} from "../chunk-
|
|
83
|
+
keyBy
|
|
84
|
+
} from "../chunk-AJKZMN2V.mjs";
|
|
65
85
|
import {
|
|
66
86
|
last
|
|
67
87
|
} from "../chunk-KPBQ7OUY.mjs";
|
|
@@ -78,16 +98,11 @@ import {
|
|
|
78
98
|
partition
|
|
79
99
|
} from "../chunk-DN3NOZ3H.mjs";
|
|
80
100
|
import {
|
|
81
|
-
|
|
82
|
-
} from "../chunk-
|
|
83
|
-
import {
|
|
84
|
-
sampleSize
|
|
85
|
-
} from "../chunk-EHSKB6DF.mjs";
|
|
86
|
-
import "../chunk-GIWAOOFY.mjs";
|
|
87
|
-
import "../chunk-SYWMYQYJ.mjs";
|
|
101
|
+
flattenDeep
|
|
102
|
+
} from "../chunk-ML727RRJ.mjs";
|
|
88
103
|
import {
|
|
89
|
-
|
|
90
|
-
} from "../chunk-
|
|
104
|
+
forEachRight
|
|
105
|
+
} from "../chunk-IEA53J7P.mjs";
|
|
91
106
|
import {
|
|
92
107
|
groupBy
|
|
93
108
|
} from "../chunk-E6E4RZLN.mjs";
|
|
@@ -101,14 +116,14 @@ import {
|
|
|
101
116
|
intersection
|
|
102
117
|
} from "../chunk-FVVSE2F2.mjs";
|
|
103
118
|
import {
|
|
104
|
-
|
|
105
|
-
} from "../chunk-
|
|
119
|
+
differenceBy
|
|
120
|
+
} from "../chunk-LVWX5B43.mjs";
|
|
106
121
|
import {
|
|
107
|
-
|
|
108
|
-
} from "../chunk-
|
|
122
|
+
differenceWith
|
|
123
|
+
} from "../chunk-6NVQAHXP.mjs";
|
|
109
124
|
import {
|
|
110
|
-
|
|
111
|
-
} from "../chunk-
|
|
125
|
+
drop
|
|
126
|
+
} from "../chunk-3EZAFZG3.mjs";
|
|
112
127
|
import {
|
|
113
128
|
dropRight
|
|
114
129
|
} from "../chunk-OXZCMC5I.mjs";
|
|
@@ -124,15 +139,9 @@ import {
|
|
|
124
139
|
import {
|
|
125
140
|
flatMap
|
|
126
141
|
} from "../chunk-UY76KTPE.mjs";
|
|
127
|
-
import {
|
|
128
|
-
flattenDeep
|
|
129
|
-
} from "../chunk-ML727RRJ.mjs";
|
|
130
142
|
import {
|
|
131
143
|
flatten
|
|
132
144
|
} from "../chunk-33MSBDC6.mjs";
|
|
133
|
-
import {
|
|
134
|
-
forEachRight
|
|
135
|
-
} from "../chunk-IEA53J7P.mjs";
|
|
136
145
|
import {
|
|
137
146
|
chunk
|
|
138
147
|
} from "../chunk-E6C5EZQA.mjs";
|
|
@@ -145,15 +154,6 @@ import {
|
|
|
145
154
|
import {
|
|
146
155
|
difference
|
|
147
156
|
} from "../chunk-JPUKH67K.mjs";
|
|
148
|
-
import {
|
|
149
|
-
differenceBy
|
|
150
|
-
} from "../chunk-LVWX5B43.mjs";
|
|
151
|
-
import {
|
|
152
|
-
differenceWith
|
|
153
|
-
} from "../chunk-6NVQAHXP.mjs";
|
|
154
|
-
import {
|
|
155
|
-
drop
|
|
156
|
-
} from "../chunk-3EZAFZG3.mjs";
|
|
157
157
|
import "../chunk-424M7IR7.mjs";
|
|
158
158
|
export {
|
|
159
159
|
chunk,
|
package/dist/compat/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { compact } from '../array/compact.mjs';
|
|
2
2
|
export { countBy } from '../array/countBy.mjs';
|
|
3
|
-
export { difference } from '../array/difference.mjs';
|
|
4
3
|
export { differenceBy } from '../array/differenceBy.mjs';
|
|
5
4
|
export { differenceWith } from '../array/differenceWith.mjs';
|
|
6
5
|
export { drop } from '../array/drop.mjs';
|
|
@@ -110,6 +109,8 @@ export { capitalize } from '../string/capitalize.mjs';
|
|
|
110
109
|
*/
|
|
111
110
|
declare function chunk<T>(arr: readonly T[], size?: number): T[][];
|
|
112
111
|
|
|
112
|
+
declare function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[];
|
|
113
|
+
|
|
113
114
|
/**
|
|
114
115
|
* Creates a deeply nested object given arrays of paths and values.
|
|
115
116
|
*
|
|
@@ -497,4 +498,4 @@ declare function max<T>(items?: readonly T[]): T;
|
|
|
497
498
|
*/
|
|
498
499
|
declare function min<T>(items?: readonly T[]): T;
|
|
499
500
|
|
|
500
|
-
export { chunk, endsWith, get, max, min, set, startsWith, zipObjectDeep };
|
|
501
|
+
export { chunk, difference, endsWith, get, max, min, set, startsWith, zipObjectDeep };
|
package/dist/compat/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { compact } from '../array/compact.js';
|
|
2
2
|
export { countBy } from '../array/countBy.js';
|
|
3
|
-
export { difference } from '../array/difference.js';
|
|
4
3
|
export { differenceBy } from '../array/differenceBy.js';
|
|
5
4
|
export { differenceWith } from '../array/differenceWith.js';
|
|
6
5
|
export { drop } from '../array/drop.js';
|
|
@@ -110,6 +109,8 @@ export { capitalize } from '../string/capitalize.js';
|
|
|
110
109
|
*/
|
|
111
110
|
declare function chunk<T>(arr: readonly T[], size?: number): T[][];
|
|
112
111
|
|
|
112
|
+
declare function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[];
|
|
113
|
+
|
|
113
114
|
/**
|
|
114
115
|
* Creates a deeply nested object given arrays of paths and values.
|
|
115
116
|
*
|
|
@@ -497,4 +498,4 @@ declare function max<T>(items?: readonly T[]): T;
|
|
|
497
498
|
*/
|
|
498
499
|
declare function min<T>(items?: readonly T[]): T;
|
|
499
500
|
|
|
500
|
-
export { chunk, endsWith, get, max, min, set, startsWith, zipObjectDeep };
|
|
501
|
+
export { chunk, difference, endsWith, get, max, min, set, startsWith, zipObjectDeep };
|
package/dist/compat/index.js
CHANGED
|
@@ -65,7 +65,7 @@ __export(compat_exports, {
|
|
|
65
65
|
countBy: () => countBy,
|
|
66
66
|
debounce: () => debounce,
|
|
67
67
|
delay: () => delay,
|
|
68
|
-
difference: () =>
|
|
68
|
+
difference: () => difference2,
|
|
69
69
|
differenceBy: () => differenceBy,
|
|
70
70
|
differenceWith: () => differenceWith,
|
|
71
71
|
drop: () => drop,
|
|
@@ -1076,6 +1076,13 @@ function chunk2(arr, size = 1) {
|
|
|
1076
1076
|
return chunk(arr, size);
|
|
1077
1077
|
}
|
|
1078
1078
|
|
|
1079
|
+
// src/compat/array/difference.ts
|
|
1080
|
+
function difference2(arr, ...values) {
|
|
1081
|
+
const arr1 = arr;
|
|
1082
|
+
const arr2 = flatten(values);
|
|
1083
|
+
return difference(arr1, arr2);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1079
1086
|
// src/compat/_internal/isIndex.ts
|
|
1080
1087
|
var IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
|
|
1081
1088
|
function isIndex(value) {
|