mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 15:39:24 +08:00
fix: correct key handling in revertEscape function for arrays and objects
This commit is contained in:
parent
553688f316
commit
5d641bd123
@ -47,10 +47,12 @@ export function revertEscape(input) {
|
|||||||
if (isArray(input)) {
|
if (isArray(input)) {
|
||||||
const result = [];
|
const result = [];
|
||||||
Object.keys(input).forEach((key) => {
|
Object.keys(input).forEach((key) => {
|
||||||
result[escape(key)] = revertEscape(input[key]);
|
result[revertEscape(key)] = revertEscape(input[key]);
|
||||||
});
|
});
|
||||||
return input.map(revertEscape);
|
return result;
|
||||||
} else if (isObject(input)) {
|
|
||||||
|
// check keys number of object to skip the object like new Date()
|
||||||
|
} else if (isObject(input && Object.keys(input).length > 0)) {
|
||||||
return mapKeys(mapValues(input, revertEscape), (value, key) => revertEscape(key));
|
return mapKeys(mapValues(input, revertEscape), (value, key) => revertEscape(key));
|
||||||
} else if (isString(input)) {
|
} else if (isString(input)) {
|
||||||
return revertEscapeSpecialChars(input);
|
return revertEscapeSpecialChars(input);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user