es-toolkit 1.29.0-dev.938 → 1.29.0-dev.939
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/compat/index.js
CHANGED
|
@@ -2795,7 +2795,14 @@ function invokeImpl(object, path, args) {
|
|
|
2795
2795
|
if (parent == null) {
|
|
2796
2796
|
return undefined;
|
|
2797
2797
|
}
|
|
2798
|
-
|
|
2798
|
+
let lastKey = last(path);
|
|
2799
|
+
let lastValue = lastKey?.valueOf();
|
|
2800
|
+
if (typeof lastValue === 'number') {
|
|
2801
|
+
lastKey = toKey(lastValue);
|
|
2802
|
+
}
|
|
2803
|
+
else {
|
|
2804
|
+
lastKey = String(lastKey);
|
|
2805
|
+
}
|
|
2799
2806
|
const func = get(parent, lastKey);
|
|
2800
2807
|
return func?.apply(parent, args);
|
|
2801
2808
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { toPath } from './toPath.mjs';
|
|
2
|
+
import { toKey } from '../_internal/toKey.mjs';
|
|
2
3
|
import { last } from '../array/last.mjs';
|
|
3
4
|
import { get } from '../object/get.mjs';
|
|
4
5
|
|
|
@@ -32,7 +33,14 @@ function invokeImpl(object, path, args) {
|
|
|
32
33
|
if (parent == null) {
|
|
33
34
|
return undefined;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
let lastKey = last(path);
|
|
37
|
+
let lastValue = lastKey?.valueOf();
|
|
38
|
+
if (typeof lastValue === 'number') {
|
|
39
|
+
lastKey = toKey(lastValue);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
lastKey = String(lastKey);
|
|
43
|
+
}
|
|
36
44
|
const func = get(parent, lastKey);
|
|
37
45
|
return func?.apply(parent, args);
|
|
38
46
|
}
|
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.29.0-dev.
|
|
4
|
+
"version": "1.29.0-dev.939+2e3e2bee",
|
|
5
5
|
"homepage": "https://es-toolkit.slash.page",
|
|
6
6
|
"bugs": "https://github.com/toss/es-toolkit/issues",
|
|
7
7
|
"repository": {
|