mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
adjust decompression when type of key is number (#4856)
This commit is contained in:
committed by
Weiliang Wang
parent
f3f4745d80
commit
05613fa38f
@@ -49,9 +49,8 @@ export function decompressJson (data, keys) {
|
||||
else if (typeof data === 'object') {
|
||||
for (var key in data) {
|
||||
decompressJson(data[key], keys);
|
||||
var newKey = keys[key];
|
||||
if (newKey) {
|
||||
data[newKey] = data[key];
|
||||
if (!Number.isNaN(Number(key)))
|
||||
data[keys[key]] = data[key];
|
||||
delete data[key];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user