es-toolkit 1.12.0-dev.275 → 1.12.0
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 +31 -31
- package/dist/compat/index.d.mts +2 -32
- package/dist/compat/index.d.ts +2 -32
- package/dist/compat/index.js +1 -15
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/index.mjs +53 -66
- package/dist/compat/index.mjs.map +1 -1
- package/dist/function/index.mjs +6 -6
- package/dist/index.mjs +52 -52
- package/package.json +1 -1
package/dist/array/index.mjs
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import "../chunk-DDH7K4QM.mjs";
|
|
2
|
-
import {
|
|
3
|
-
zipWith
|
|
4
|
-
} from "../chunk-4KYXHZ4R.mjs";
|
|
5
|
-
import {
|
|
6
|
-
unzip
|
|
7
|
-
} from "../chunk-UYZKMBDO.mjs";
|
|
8
|
-
import {
|
|
9
|
-
unzipWith
|
|
10
|
-
} from "../chunk-IFNXROZR.mjs";
|
|
11
2
|
import {
|
|
12
3
|
without
|
|
13
4
|
} from "../chunk-PYEYV7BY.mjs";
|
|
@@ -27,11 +18,8 @@ import {
|
|
|
27
18
|
zipObject
|
|
28
19
|
} from "../chunk-6GWEY5EL.mjs";
|
|
29
20
|
import {
|
|
30
|
-
|
|
31
|
-
} from "../chunk-
|
|
32
|
-
import {
|
|
33
|
-
toFilled
|
|
34
|
-
} from "../chunk-OP4OAKQJ.mjs";
|
|
21
|
+
zipWith
|
|
22
|
+
} from "../chunk-4KYXHZ4R.mjs";
|
|
35
23
|
import {
|
|
36
24
|
union
|
|
37
25
|
} from "../chunk-R6QA7PLZ.mjs";
|
|
@@ -51,11 +39,11 @@ import {
|
|
|
51
39
|
uniqWith
|
|
52
40
|
} from "../chunk-237HGSZS.mjs";
|
|
53
41
|
import {
|
|
54
|
-
|
|
55
|
-
} from "../chunk-
|
|
42
|
+
unzip
|
|
43
|
+
} from "../chunk-UYZKMBDO.mjs";
|
|
56
44
|
import {
|
|
57
|
-
|
|
58
|
-
} from "../chunk-
|
|
45
|
+
unzipWith
|
|
46
|
+
} from "../chunk-IFNXROZR.mjs";
|
|
59
47
|
import {
|
|
60
48
|
sampleSize
|
|
61
49
|
} from "../chunk-EHSKB6DF.mjs";
|
|
@@ -77,11 +65,11 @@ import {
|
|
|
77
65
|
takeRightWhile
|
|
78
66
|
} from "../chunk-NTLX2MPV.mjs";
|
|
79
67
|
import {
|
|
80
|
-
|
|
81
|
-
} from "../chunk-
|
|
68
|
+
takeWhile
|
|
69
|
+
} from "../chunk-2IXFGSUA.mjs";
|
|
82
70
|
import {
|
|
83
|
-
|
|
84
|
-
} from "../chunk-
|
|
71
|
+
toFilled
|
|
72
|
+
} from "../chunk-OP4OAKQJ.mjs";
|
|
85
73
|
import {
|
|
86
74
|
intersectionWith
|
|
87
75
|
} from "../chunk-XI7KRD2C.mjs";
|
|
@@ -101,14 +89,14 @@ import {
|
|
|
101
89
|
orderBy
|
|
102
90
|
} from "../chunk-7B7W36UP.mjs";
|
|
103
91
|
import {
|
|
104
|
-
|
|
105
|
-
} from "../chunk-
|
|
92
|
+
partition
|
|
93
|
+
} from "../chunk-DN3NOZ3H.mjs";
|
|
94
|
+
import {
|
|
95
|
+
sample
|
|
96
|
+
} from "../chunk-2KNLZB7V.mjs";
|
|
106
97
|
import {
|
|
107
98
|
flattenDeep
|
|
108
99
|
} from "../chunk-ML727RRJ.mjs";
|
|
109
|
-
import {
|
|
110
|
-
flatten
|
|
111
|
-
} from "../chunk-33MSBDC6.mjs";
|
|
112
100
|
import {
|
|
113
101
|
forEachRight
|
|
114
102
|
} from "../chunk-IEA53J7P.mjs";
|
|
@@ -122,11 +110,11 @@ import {
|
|
|
122
110
|
initial
|
|
123
111
|
} from "../chunk-XPSOKBRZ.mjs";
|
|
124
112
|
import {
|
|
125
|
-
|
|
126
|
-
} from "../chunk-
|
|
113
|
+
intersection
|
|
114
|
+
} from "../chunk-FVVSE2F2.mjs";
|
|
127
115
|
import {
|
|
128
|
-
|
|
129
|
-
} from "../chunk-
|
|
116
|
+
intersectionBy
|
|
117
|
+
} from "../chunk-O6UXZR3U.mjs";
|
|
130
118
|
import {
|
|
131
119
|
differenceWith
|
|
132
120
|
} from "../chunk-6NVQAHXP.mjs";
|
|
@@ -145,6 +133,12 @@ import {
|
|
|
145
133
|
import {
|
|
146
134
|
fill
|
|
147
135
|
} from "../chunk-YFN6KOC4.mjs";
|
|
136
|
+
import {
|
|
137
|
+
flatMap
|
|
138
|
+
} from "../chunk-UY76KTPE.mjs";
|
|
139
|
+
import {
|
|
140
|
+
flatten
|
|
141
|
+
} from "../chunk-33MSBDC6.mjs";
|
|
148
142
|
import {
|
|
149
143
|
chunk
|
|
150
144
|
} from "../chunk-E6C5EZQA.mjs";
|
|
@@ -154,6 +148,12 @@ import {
|
|
|
154
148
|
import {
|
|
155
149
|
countBy
|
|
156
150
|
} from "../chunk-CRSKT4WW.mjs";
|
|
151
|
+
import {
|
|
152
|
+
difference
|
|
153
|
+
} from "../chunk-JPUKH67K.mjs";
|
|
154
|
+
import {
|
|
155
|
+
differenceBy
|
|
156
|
+
} from "../chunk-LVWX5B43.mjs";
|
|
157
157
|
import "../chunk-424M7IR7.mjs";
|
|
158
158
|
export {
|
|
159
159
|
chunk,
|
package/dist/compat/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { compact } from '../array/compact.mjs';
|
|
2
2
|
export { countBy } from '../array/countBy.mjs';
|
|
3
|
+
export { difference } from '../array/difference.mjs';
|
|
3
4
|
export { differenceBy } from '../array/differenceBy.mjs';
|
|
4
5
|
export { differenceWith } from '../array/differenceWith.mjs';
|
|
5
6
|
export { drop } from '../array/drop.mjs';
|
|
@@ -109,37 +110,6 @@ export { capitalize } from '../string/capitalize.mjs';
|
|
|
109
110
|
*/
|
|
110
111
|
declare function chunk<T>(arr: readonly T[], size?: number): T[][];
|
|
111
112
|
|
|
112
|
-
/**
|
|
113
|
-
* Concatenates multiple arrays and values into a single array.
|
|
114
|
-
*
|
|
115
|
-
* @template T The type of elements in the array.
|
|
116
|
-
* @param {...(T | readonly T[])} values - The values and/or arrays to concatenate.
|
|
117
|
-
* @returns {T[]} A new array containing all the input values.
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* // Concatenate individual values
|
|
121
|
-
* concat(1, 2, 3);
|
|
122
|
-
* // returns [1, 2, 3]
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
* // Concatenate arrays of values
|
|
126
|
-
* concat([1, 2], [3, 4]);
|
|
127
|
-
* // returns [1, 2, 3, 4]
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* // Concatenate a mix of individual values and arrays
|
|
131
|
-
* concat(1, [2, 3], 4);
|
|
132
|
-
* // returns [1, 2, 3, 4]
|
|
133
|
-
*
|
|
134
|
-
* @example
|
|
135
|
-
* // Concatenate nested arrays
|
|
136
|
-
* concat([1, [2, 3]], 4);
|
|
137
|
-
* // returns [1, [2, 3], 4]
|
|
138
|
-
*/
|
|
139
|
-
declare function concat<T>(...values: Array<T | readonly T[]>): T[];
|
|
140
|
-
|
|
141
|
-
declare function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[];
|
|
142
|
-
|
|
143
113
|
/**
|
|
144
114
|
* Creates a deeply nested object given arrays of paths and values.
|
|
145
115
|
*
|
|
@@ -527,4 +497,4 @@ declare function max<T>(items?: readonly T[]): T;
|
|
|
527
497
|
*/
|
|
528
498
|
declare function min<T>(items?: readonly T[]): T;
|
|
529
499
|
|
|
530
|
-
export { chunk,
|
|
500
|
+
export { chunk, endsWith, get, max, min, set, startsWith, zipObjectDeep };
|
package/dist/compat/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { compact } from '../array/compact.js';
|
|
2
2
|
export { countBy } from '../array/countBy.js';
|
|
3
|
+
export { difference } from '../array/difference.js';
|
|
3
4
|
export { differenceBy } from '../array/differenceBy.js';
|
|
4
5
|
export { differenceWith } from '../array/differenceWith.js';
|
|
5
6
|
export { drop } from '../array/drop.js';
|
|
@@ -109,37 +110,6 @@ export { capitalize } from '../string/capitalize.js';
|
|
|
109
110
|
*/
|
|
110
111
|
declare function chunk<T>(arr: readonly T[], size?: number): T[][];
|
|
111
112
|
|
|
112
|
-
/**
|
|
113
|
-
* Concatenates multiple arrays and values into a single array.
|
|
114
|
-
*
|
|
115
|
-
* @template T The type of elements in the array.
|
|
116
|
-
* @param {...(T | readonly T[])} values - The values and/or arrays to concatenate.
|
|
117
|
-
* @returns {T[]} A new array containing all the input values.
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* // Concatenate individual values
|
|
121
|
-
* concat(1, 2, 3);
|
|
122
|
-
* // returns [1, 2, 3]
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
* // Concatenate arrays of values
|
|
126
|
-
* concat([1, 2], [3, 4]);
|
|
127
|
-
* // returns [1, 2, 3, 4]
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* // Concatenate a mix of individual values and arrays
|
|
131
|
-
* concat(1, [2, 3], 4);
|
|
132
|
-
* // returns [1, 2, 3, 4]
|
|
133
|
-
*
|
|
134
|
-
* @example
|
|
135
|
-
* // Concatenate nested arrays
|
|
136
|
-
* concat([1, [2, 3]], 4);
|
|
137
|
-
* // returns [1, [2, 3], 4]
|
|
138
|
-
*/
|
|
139
|
-
declare function concat<T>(...values: Array<T | readonly T[]>): T[];
|
|
140
|
-
|
|
141
|
-
declare function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[];
|
|
142
|
-
|
|
143
113
|
/**
|
|
144
114
|
* Creates a deeply nested object given arrays of paths and values.
|
|
145
115
|
*
|
|
@@ -527,4 +497,4 @@ declare function max<T>(items?: readonly T[]): T;
|
|
|
527
497
|
*/
|
|
528
498
|
declare function min<T>(items?: readonly T[]): T;
|
|
529
499
|
|
|
530
|
-
export { chunk,
|
|
500
|
+
export { chunk, endsWith, get, max, min, set, startsWith, zipObjectDeep };
|
package/dist/compat/index.js
CHANGED
|
@@ -62,11 +62,10 @@ __export(compat_exports, {
|
|
|
62
62
|
clamp: () => clamp,
|
|
63
63
|
clone: () => clone,
|
|
64
64
|
compact: () => compact,
|
|
65
|
-
concat: () => concat,
|
|
66
65
|
countBy: () => countBy,
|
|
67
66
|
debounce: () => debounce,
|
|
68
67
|
delay: () => delay,
|
|
69
|
-
difference: () =>
|
|
68
|
+
difference: () => difference,
|
|
70
69
|
differenceBy: () => differenceBy,
|
|
71
70
|
differenceWith: () => differenceWith,
|
|
72
71
|
drop: () => drop,
|
|
@@ -1077,18 +1076,6 @@ function chunk2(arr, size = 1) {
|
|
|
1077
1076
|
return chunk(arr, size);
|
|
1078
1077
|
}
|
|
1079
1078
|
|
|
1080
|
-
// src/compat/array/concat.ts
|
|
1081
|
-
function concat(...values) {
|
|
1082
|
-
return flatten(values);
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
// src/compat/array/difference.ts
|
|
1086
|
-
function difference2(arr, ...values) {
|
|
1087
|
-
const arr1 = arr;
|
|
1088
|
-
const arr2 = flatten(values);
|
|
1089
|
-
return difference(arr1, arr2);
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
1079
|
// src/compat/_internal/isIndex.ts
|
|
1093
1080
|
var IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
|
|
1094
1081
|
function isIndex(value) {
|
|
@@ -1255,7 +1242,6 @@ function min(items = []) {
|
|
|
1255
1242
|
clamp,
|
|
1256
1243
|
clone,
|
|
1257
1244
|
compact,
|
|
1258
|
-
concat,
|
|
1259
1245
|
countBy,
|
|
1260
1246
|
debounce,
|
|
1261
1247
|
delay,
|