es-toolkit 1.12.0-dev.271 → 1.12.0-dev.273
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 +19 -19
- package/dist/compat/index.d.mts +30 -1
- package/dist/compat/index.d.ts +30 -1
- package/dist/compat/index.js +7 -0
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/index.mjs +25 -19
- package/dist/compat/index.mjs.map +1 -1
- package/dist/index.mjs +19 -19
- package/package.json +1 -1
package/dist/array/index.mjs
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import "../chunk-DDH7K4QM.mjs";
|
|
2
|
+
import {
|
|
3
|
+
zipWith
|
|
4
|
+
} from "../chunk-4KYXHZ4R.mjs";
|
|
5
|
+
import {
|
|
6
|
+
unzip
|
|
7
|
+
} from "../chunk-UYZKMBDO.mjs";
|
|
2
8
|
import {
|
|
3
9
|
unzipWith
|
|
4
10
|
} from "../chunk-IFNXROZR.mjs";
|
|
@@ -21,8 +27,8 @@ import {
|
|
|
21
27
|
zipObject
|
|
22
28
|
} from "../chunk-6GWEY5EL.mjs";
|
|
23
29
|
import {
|
|
24
|
-
|
|
25
|
-
} from "../chunk-
|
|
30
|
+
takeWhile
|
|
31
|
+
} from "../chunk-2IXFGSUA.mjs";
|
|
26
32
|
import {
|
|
27
33
|
toFilled
|
|
28
34
|
} from "../chunk-OP4OAKQJ.mjs";
|
|
@@ -45,8 +51,8 @@ import {
|
|
|
45
51
|
uniqWith
|
|
46
52
|
} from "../chunk-237HGSZS.mjs";
|
|
47
53
|
import {
|
|
48
|
-
|
|
49
|
-
} from "../chunk-
|
|
54
|
+
partition
|
|
55
|
+
} from "../chunk-DN3NOZ3H.mjs";
|
|
50
56
|
import {
|
|
51
57
|
sample
|
|
52
58
|
} from "../chunk-2KNLZB7V.mjs";
|
|
@@ -71,8 +77,8 @@ import {
|
|
|
71
77
|
takeRightWhile
|
|
72
78
|
} from "../chunk-NTLX2MPV.mjs";
|
|
73
79
|
import {
|
|
74
|
-
|
|
75
|
-
} from "../chunk-
|
|
80
|
+
intersection
|
|
81
|
+
} from "../chunk-FVVSE2F2.mjs";
|
|
76
82
|
import {
|
|
77
83
|
intersectionBy
|
|
78
84
|
} from "../chunk-O6UXZR3U.mjs";
|
|
@@ -95,11 +101,14 @@ import {
|
|
|
95
101
|
orderBy
|
|
96
102
|
} from "../chunk-7B7W36UP.mjs";
|
|
97
103
|
import {
|
|
98
|
-
|
|
99
|
-
} from "../chunk-
|
|
104
|
+
flatMap
|
|
105
|
+
} from "../chunk-UY76KTPE.mjs";
|
|
100
106
|
import {
|
|
101
107
|
flattenDeep
|
|
102
108
|
} from "../chunk-ML727RRJ.mjs";
|
|
109
|
+
import {
|
|
110
|
+
flatten
|
|
111
|
+
} from "../chunk-33MSBDC6.mjs";
|
|
103
112
|
import {
|
|
104
113
|
forEachRight
|
|
105
114
|
} from "../chunk-IEA53J7P.mjs";
|
|
@@ -113,8 +122,8 @@ import {
|
|
|
113
122
|
initial
|
|
114
123
|
} from "../chunk-XPSOKBRZ.mjs";
|
|
115
124
|
import {
|
|
116
|
-
|
|
117
|
-
} from "../chunk-
|
|
125
|
+
difference
|
|
126
|
+
} from "../chunk-JPUKH67K.mjs";
|
|
118
127
|
import {
|
|
119
128
|
differenceBy
|
|
120
129
|
} from "../chunk-LVWX5B43.mjs";
|
|
@@ -136,12 +145,6 @@ import {
|
|
|
136
145
|
import {
|
|
137
146
|
fill
|
|
138
147
|
} from "../chunk-YFN6KOC4.mjs";
|
|
139
|
-
import {
|
|
140
|
-
flatMap
|
|
141
|
-
} from "../chunk-UY76KTPE.mjs";
|
|
142
|
-
import {
|
|
143
|
-
flatten
|
|
144
|
-
} from "../chunk-33MSBDC6.mjs";
|
|
145
148
|
import {
|
|
146
149
|
chunk
|
|
147
150
|
} from "../chunk-E6C5EZQA.mjs";
|
|
@@ -151,9 +154,6 @@ import {
|
|
|
151
154
|
import {
|
|
152
155
|
countBy
|
|
153
156
|
} from "../chunk-CRSKT4WW.mjs";
|
|
154
|
-
import {
|
|
155
|
-
difference
|
|
156
|
-
} from "../chunk-JPUKH67K.mjs";
|
|
157
157
|
import "../chunk-424M7IR7.mjs";
|
|
158
158
|
export {
|
|
159
159
|
chunk,
|
package/dist/compat/index.d.mts
CHANGED
|
@@ -109,6 +109,35 @@ export { capitalize } from '../string/capitalize.mjs';
|
|
|
109
109
|
*/
|
|
110
110
|
declare function chunk<T>(arr: readonly T[], size?: number): T[][];
|
|
111
111
|
|
|
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
|
+
|
|
112
141
|
declare function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[];
|
|
113
142
|
|
|
114
143
|
/**
|
|
@@ -498,4 +527,4 @@ declare function max<T>(items?: readonly T[]): T;
|
|
|
498
527
|
*/
|
|
499
528
|
declare function min<T>(items?: readonly T[]): T;
|
|
500
529
|
|
|
501
|
-
export { chunk, difference, endsWith, get, max, min, set, startsWith, zipObjectDeep };
|
|
530
|
+
export { chunk, concat, difference, endsWith, get, max, min, set, startsWith, zipObjectDeep };
|
package/dist/compat/index.d.ts
CHANGED
|
@@ -109,6 +109,35 @@ export { capitalize } from '../string/capitalize.js';
|
|
|
109
109
|
*/
|
|
110
110
|
declare function chunk<T>(arr: readonly T[], size?: number): T[][];
|
|
111
111
|
|
|
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
|
+
|
|
112
141
|
declare function difference<T>(arr: readonly T[], ...values: Array<readonly T[]>): T[];
|
|
113
142
|
|
|
114
143
|
/**
|
|
@@ -498,4 +527,4 @@ declare function max<T>(items?: readonly T[]): T;
|
|
|
498
527
|
*/
|
|
499
528
|
declare function min<T>(items?: readonly T[]): T;
|
|
500
529
|
|
|
501
|
-
export { chunk, difference, endsWith, get, max, min, set, startsWith, zipObjectDeep };
|
|
530
|
+
export { chunk, concat, difference, endsWith, get, max, min, set, startsWith, zipObjectDeep };
|
package/dist/compat/index.js
CHANGED
|
@@ -62,6 +62,7 @@ __export(compat_exports, {
|
|
|
62
62
|
clamp: () => clamp,
|
|
63
63
|
clone: () => clone,
|
|
64
64
|
compact: () => compact,
|
|
65
|
+
concat: () => concat,
|
|
65
66
|
countBy: () => countBy,
|
|
66
67
|
debounce: () => debounce,
|
|
67
68
|
delay: () => delay,
|
|
@@ -1076,6 +1077,11 @@ function chunk2(arr, size = 1) {
|
|
|
1076
1077
|
return chunk(arr, size);
|
|
1077
1078
|
}
|
|
1078
1079
|
|
|
1080
|
+
// src/compat/array/concat.ts
|
|
1081
|
+
function concat(...values) {
|
|
1082
|
+
return flatten(values);
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1079
1085
|
// src/compat/array/difference.ts
|
|
1080
1086
|
function difference2(arr, ...values) {
|
|
1081
1087
|
const arr1 = arr;
|
|
@@ -1249,6 +1255,7 @@ function min(items = []) {
|
|
|
1249
1255
|
clamp,
|
|
1250
1256
|
clone,
|
|
1251
1257
|
compact,
|
|
1258
|
+
concat,
|
|
1252
1259
|
countBy,
|
|
1253
1260
|
debounce,
|
|
1254
1261
|
delay,
|