@tmagic/utils 1.5.21 → 1.5.22
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/tmagic-utils.js +1 -1
- package/dist/tmagic-utils.umd.cjs +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -1
package/dist/tmagic-utils.js
CHANGED
|
@@ -273,7 +273,7 @@ const guid = (digit = 8) => "x".repeat(digit).replace(/[xy]/g, (c) => {
|
|
|
273
273
|
});
|
|
274
274
|
const getKeysArray = (keys) => (
|
|
275
275
|
// 将 array[0] 转成 array.0
|
|
276
|
-
`${keys}`.
|
|
276
|
+
`${keys}`.replace(/\[(\d+)\]/g, ".$1").split(".")
|
|
277
277
|
);
|
|
278
278
|
const getValueByKeyPath = (keys = "", data = {}) => {
|
|
279
279
|
const keyArray = Array.isArray(keys) ? keys : getKeysArray(keys);
|
|
@@ -2646,7 +2646,7 @@
|
|
|
2646
2646
|
});
|
|
2647
2647
|
const getKeysArray = (keys) => (
|
|
2648
2648
|
// 将 array[0] 转成 array.0
|
|
2649
|
-
`${keys}`.
|
|
2649
|
+
`${keys}`.replace(/\[(\d+)\]/g, ".$1").split(".")
|
|
2650
2650
|
);
|
|
2651
2651
|
const getValueByKeyPath = (keys = "", data = {}) => {
|
|
2652
2652
|
const keyArray = Array.isArray(keys) ? keys : getKeysArray(keys);
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.5.
|
|
2
|
+
"version": "1.5.22",
|
|
3
3
|
"name": "@tmagic/utils",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/tmagic-utils.umd.cjs",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"typescript": "*",
|
|
37
|
-
"@tmagic/schema": "1.5.
|
|
37
|
+
"@tmagic/schema": "1.5.22"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"typescript": {
|
package/src/index.ts
CHANGED
|
@@ -296,7 +296,7 @@ export const guid = (digit = 8): string =>
|
|
|
296
296
|
|
|
297
297
|
export const getKeysArray = (keys: string | number) =>
|
|
298
298
|
// 将 array[0] 转成 array.0
|
|
299
|
-
`${keys}`.
|
|
299
|
+
`${keys}`.replace(/\[(\d+)\]/g, '.$1').split('.');
|
|
300
300
|
|
|
301
301
|
export const getValueByKeyPath = (
|
|
302
302
|
keys: number | string | string[] = '',
|