es-toolkit 1.45.1 → 1.46.0-dev.1788
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/CHANGELOG.md +14 -0
- package/README.md +18 -1
- package/dist/_internal/globalThis.js +14 -0
- package/dist/_internal/globalThis.mjs +10 -0
- package/dist/array/fill.d.mts +12 -15
- package/dist/array/fill.d.ts +12 -15
- package/dist/browser.global.js +1 -1
- package/dist/compat/array/dropWhile.d.mts +2 -2
- package/dist/compat/array/dropWhile.d.ts +2 -2
- package/dist/compat/array/invokeMap.js +1 -0
- package/dist/compat/array/invokeMap.mjs +1 -0
- package/dist/compat/array/lastIndexOf.d.mts +1 -1
- package/dist/compat/array/lastIndexOf.d.ts +1 -1
- package/dist/compat/array/sortedLastIndex.d.mts +1 -1
- package/dist/compat/array/sortedLastIndex.d.ts +1 -1
- package/dist/compat/object/mergeWith.js +2 -1
- package/dist/compat/object/mergeWith.mjs +2 -1
- package/dist/compat/object/setWith.d.mts +2 -2
- package/dist/compat/object/setWith.d.ts +2 -2
- package/dist/compat/predicate/isEmpty.js +2 -1
- package/dist/compat/predicate/isEmpty.mjs +2 -1
- package/dist/compat/util/over.d.mts +1 -1
- package/dist/compat/util/over.d.ts +1 -1
- package/dist/error/AbortError.d.mts +2 -2
- package/dist/error/AbortError.d.ts +2 -2
- package/dist/error/AbortError.js +1 -2
- package/dist/error/AbortError.mjs +1 -2
- package/dist/error/TimeoutError.d.mts +3 -3
- package/dist/error/TimeoutError.d.ts +3 -3
- package/dist/error/TimeoutError.js +1 -2
- package/dist/error/TimeoutError.mjs +1 -2
- package/dist/function/memoize.d.mts +1 -1
- package/dist/function/memoize.d.ts +1 -1
- package/dist/function/partial.d.mts +69 -0
- package/dist/function/partial.d.ts +69 -0
- package/dist/map/index.d.mts +1 -0
- package/dist/map/index.d.ts +1 -0
- package/dist/map/index.js +2 -0
- package/dist/map/index.mjs +1 -0
- package/dist/map/keyBy.d.mts +31 -0
- package/dist/map/keyBy.d.ts +31 -0
- package/dist/map/keyBy.js +14 -0
- package/dist/map/keyBy.mjs +10 -0
- package/dist/object/cloneDeepWith.js +2 -1
- package/dist/object/cloneDeepWith.mjs +2 -1
- package/dist/predicate/isBuffer.js +3 -1
- package/dist/predicate/isBuffer.mjs +3 -1
- package/dist/predicate/isEqualWith.js +2 -1
- package/dist/predicate/isEqualWith.mjs +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# es-toolkit Changelog
|
|
2
2
|
|
|
3
|
+
## Version v1.46.0
|
|
4
|
+
|
|
5
|
+
Released on April 22th, 2026.
|
|
6
|
+
|
|
7
|
+
- Changed `AbortError` and `TimeoutError` to extend `DOMException`. ([#1660])
|
|
8
|
+
- Added `keyBy` to the `map` entrypoint exports. ([#1650])
|
|
9
|
+
- Added Claude Code plugin marketplace and es-toolkit usage skills. ([#1644])
|
|
10
|
+
- Fixed `isBuffer` to add a browser export condition to avoid a 44KB Buffer polyfill. ([#1671])
|
|
11
|
+
- Fixed `toCamelCaseKeys` and `toSnakeCaseKeys` to be exported from `compat` for the browser bundle. ([#1685])
|
|
12
|
+
- Fixed `partial` by adding missing full-application overloads for 2/3/4 arguments. ([#1684])
|
|
13
|
+
- Added Agent Skills and Claude Code Plugin guide to the AI Integration page. ([#1664])
|
|
14
|
+
|
|
15
|
+
We sincerely thank @raon0211, @jantimon, @jaydeep-pipaliya, @ethanresnick, @zaewc, @minsoo-web, @wondonghwi, @xxxxxxjun, @jiji-hoon96, @james-rae, @Gamez0, and @dayongkr for their contributions. We appreciate your great efforts!
|
|
16
|
+
|
|
3
17
|
## Version v1.45.1
|
|
4
18
|
|
|
5
19
|
Released on March 4th, 2026.
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ es-toolkit is a state-of-the-art, high-performance JavaScript utility library wi
|
|
|
11
11
|
- es-toolkit supports tree shaking out of the box, and [reduces JavaScript code by up to 97%](https://es-toolkit.dev/bundle-size.html) compared to other libraries.
|
|
12
12
|
- es-toolkit offers a complete compatibility layer to seamlessly replace lodash, available as [es-toolkit/compat](https://es-toolkit.dev/compatibility.html).
|
|
13
13
|
- es-toolkit includes built-in TypeScript support, with straightforward yet robust types. It also provides useful type guards such as [isNotNil](https://es-toolkit.dev/reference/predicate/isNotNil.html).
|
|
14
|
-
- es-toolkit is trusted and used by popular open-source projects like [Storybook](https://github.com/storybookjs/storybook/blob/9d862798d666678cc4822e857c00bbd744169ced/code/core/package.json#L358), Recharts, ink, and CKEditor.
|
|
14
|
+
- es-toolkit is trusted and used by popular open-source projects like [Storybook](https://github.com/storybookjs/storybook/blob/9d862798d666678cc4822e857c00bbd744169ced/code/core/package.json#L358), [Recharts](https://github.com/recharts/recharts/blob/0fa4cc325da403b6fa1c6be0f820896ed92f806a/package.json#L94), [ink](https://github.com/vadimdemedes/ink/blob/2090ad9779be59dea71d173eb49785b7bd4495d0/package.json#L55), and [CKEditor](https://github.com/ckeditor/ckeditor5/blob/60d5fac804643cb4d359767ee2f94e3d92d1fcc5/packages/ckeditor5-core/package.json#L53).
|
|
15
15
|
- es-toolkit is battle-tested with 100% test coverage, ensuring reliability and robustness.
|
|
16
16
|
|
|
17
17
|
## Examples
|
|
@@ -34,6 +34,23 @@ console.log(chunkedArray);
|
|
|
34
34
|
// Output: [[1, 2], [3, 4], [5, 6]]
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
+
## AI Integration
|
|
38
|
+
|
|
39
|
+
es-toolkit provides [Agent Skills](https://skills.sh) for AI coding tools like Claude Code, Cursor, and Copilot.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx skills add toss/es-toolkit
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For Claude Code, you can also install via the plugin marketplace:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
/plugin marketplace add toss/es-toolkit
|
|
49
|
+
/plugin install es-toolkit@es-toolkit-plugin
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
For more details, see the [AI Integration guide](https://es-toolkit.dev/ai-integration.html).
|
|
53
|
+
|
|
37
54
|
## Contributing
|
|
38
55
|
|
|
39
56
|
We welcome contribution from everyone in the community. Read below for detailed contribution guide.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const globalThis_ = (typeof globalThis === 'object' && globalThis) ||
|
|
6
|
+
(typeof window === 'object' && window) ||
|
|
7
|
+
(typeof self === 'object' && self) ||
|
|
8
|
+
(typeof global === 'object' && global) ||
|
|
9
|
+
(function () {
|
|
10
|
+
return this;
|
|
11
|
+
})() ||
|
|
12
|
+
Function('return this')();
|
|
13
|
+
|
|
14
|
+
exports.globalThis = globalThis_;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const globalThis_ = (typeof globalThis === 'object' && globalThis) ||
|
|
2
|
+
(typeof window === 'object' && window) ||
|
|
3
|
+
(typeof self === 'object' && self) ||
|
|
4
|
+
(typeof global === 'object' && global) ||
|
|
5
|
+
(function () {
|
|
6
|
+
return this;
|
|
7
|
+
})() ||
|
|
8
|
+
Function('return this')();
|
|
9
|
+
|
|
10
|
+
export { globalThis_ as globalThis };
|
package/dist/array/fill.d.mts
CHANGED
|
@@ -11,17 +11,16 @@
|
|
|
11
11
|
* @returns {T[]} The array with the filled values.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
|
-
*
|
|
15
|
-
* const result = fill(array, 'a');
|
|
14
|
+
* fill([1, 2, 3], 'a');
|
|
16
15
|
* // => ['a', 'a', 'a']
|
|
17
16
|
*
|
|
18
|
-
*
|
|
17
|
+
* fill(Array(3), 2);
|
|
19
18
|
* // => [2, 2, 2]
|
|
20
19
|
*
|
|
21
|
-
*
|
|
20
|
+
* fill([4, 6, 8, 10], '*', 1, 3);
|
|
22
21
|
* // => [4, '*', '*', 10]
|
|
23
22
|
*
|
|
24
|
-
*
|
|
23
|
+
* fill([1, 2, 3], '*', -2, -1);
|
|
25
24
|
* // => [1, '*', 3]
|
|
26
25
|
*/
|
|
27
26
|
declare function fill<T>(array: unknown[], value: T): T[];
|
|
@@ -40,17 +39,16 @@ declare function fill<T>(array: unknown[], value: T): T[];
|
|
|
40
39
|
* @returns {Array<T | U>} The array with the filled values.
|
|
41
40
|
*
|
|
42
41
|
* @example
|
|
43
|
-
*
|
|
44
|
-
* const result = fill(array, 'a');
|
|
42
|
+
* fill([1, 2, 3], 'a');
|
|
45
43
|
* // => ['a', 'a', 'a']
|
|
46
44
|
*
|
|
47
|
-
*
|
|
45
|
+
* fill(Array(3), 2);
|
|
48
46
|
* // => [2, 2, 2]
|
|
49
47
|
*
|
|
50
|
-
*
|
|
48
|
+
* fill([4, 6, 8, 10], '*', 1, 3);
|
|
51
49
|
* // => [4, '*', '*', 10]
|
|
52
50
|
*
|
|
53
|
-
*
|
|
51
|
+
* fill([1, 2, 3], '*', -2, -1);
|
|
54
52
|
* // => [1, '*', 3]
|
|
55
53
|
*/
|
|
56
54
|
declare function fill<T, U>(array: Array<T | U>, value: U, start: number): Array<T | U>;
|
|
@@ -70,17 +68,16 @@ declare function fill<T, U>(array: Array<T | U>, value: U, start: number): Array
|
|
|
70
68
|
* @returns {Array<T | U>} The array with the filled values.
|
|
71
69
|
*
|
|
72
70
|
* @example
|
|
73
|
-
*
|
|
74
|
-
* const result = fill(array, 'a');
|
|
71
|
+
* fill([1, 2, 3], 'a');
|
|
75
72
|
* // => ['a', 'a', 'a']
|
|
76
73
|
*
|
|
77
|
-
*
|
|
74
|
+
* fill(Array(3), 2);
|
|
78
75
|
* // => [2, 2, 2]
|
|
79
76
|
*
|
|
80
|
-
*
|
|
77
|
+
* fill([4, 6, 8, 10], '*', 1, 3);
|
|
81
78
|
* // => [4, '*', '*', 10]
|
|
82
79
|
*
|
|
83
|
-
*
|
|
80
|
+
* fill([1, 2, 3], '*', -2, -1);
|
|
84
81
|
* // => [1, '*', 3]
|
|
85
82
|
*/
|
|
86
83
|
declare function fill<T, U>(array: Array<T | U>, value: U, start: number, end: number): Array<T | U>;
|
package/dist/array/fill.d.ts
CHANGED
|
@@ -11,17 +11,16 @@
|
|
|
11
11
|
* @returns {T[]} The array with the filled values.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
|
-
*
|
|
15
|
-
* const result = fill(array, 'a');
|
|
14
|
+
* fill([1, 2, 3], 'a');
|
|
16
15
|
* // => ['a', 'a', 'a']
|
|
17
16
|
*
|
|
18
|
-
*
|
|
17
|
+
* fill(Array(3), 2);
|
|
19
18
|
* // => [2, 2, 2]
|
|
20
19
|
*
|
|
21
|
-
*
|
|
20
|
+
* fill([4, 6, 8, 10], '*', 1, 3);
|
|
22
21
|
* // => [4, '*', '*', 10]
|
|
23
22
|
*
|
|
24
|
-
*
|
|
23
|
+
* fill([1, 2, 3], '*', -2, -1);
|
|
25
24
|
* // => [1, '*', 3]
|
|
26
25
|
*/
|
|
27
26
|
declare function fill<T>(array: unknown[], value: T): T[];
|
|
@@ -40,17 +39,16 @@ declare function fill<T>(array: unknown[], value: T): T[];
|
|
|
40
39
|
* @returns {Array<T | U>} The array with the filled values.
|
|
41
40
|
*
|
|
42
41
|
* @example
|
|
43
|
-
*
|
|
44
|
-
* const result = fill(array, 'a');
|
|
42
|
+
* fill([1, 2, 3], 'a');
|
|
45
43
|
* // => ['a', 'a', 'a']
|
|
46
44
|
*
|
|
47
|
-
*
|
|
45
|
+
* fill(Array(3), 2);
|
|
48
46
|
* // => [2, 2, 2]
|
|
49
47
|
*
|
|
50
|
-
*
|
|
48
|
+
* fill([4, 6, 8, 10], '*', 1, 3);
|
|
51
49
|
* // => [4, '*', '*', 10]
|
|
52
50
|
*
|
|
53
|
-
*
|
|
51
|
+
* fill([1, 2, 3], '*', -2, -1);
|
|
54
52
|
* // => [1, '*', 3]
|
|
55
53
|
*/
|
|
56
54
|
declare function fill<T, U>(array: Array<T | U>, value: U, start: number): Array<T | U>;
|
|
@@ -70,17 +68,16 @@ declare function fill<T, U>(array: Array<T | U>, value: U, start: number): Array
|
|
|
70
68
|
* @returns {Array<T | U>} The array with the filled values.
|
|
71
69
|
*
|
|
72
70
|
* @example
|
|
73
|
-
*
|
|
74
|
-
* const result = fill(array, 'a');
|
|
71
|
+
* fill([1, 2, 3], 'a');
|
|
75
72
|
* // => ['a', 'a', 'a']
|
|
76
73
|
*
|
|
77
|
-
*
|
|
74
|
+
* fill(Array(3), 2);
|
|
78
75
|
* // => [2, 2, 2]
|
|
79
76
|
*
|
|
80
|
-
*
|
|
77
|
+
* fill([4, 6, 8, 10], '*', 1, 3);
|
|
81
78
|
* // => [4, '*', '*', 10]
|
|
82
79
|
*
|
|
83
|
-
*
|
|
80
|
+
* fill([1, 2, 3], '*', -2, -1);
|
|
84
81
|
* // => [1, '*', 3]
|
|
85
82
|
*/
|
|
86
83
|
declare function fill<T, U>(array: Array<T | U>, value: U, start: number, end: number): Array<T | U>;
|