style: add perf rules (#5413)

This commit is contained in:
LongYinan
2023-12-28 05:09:30 +00:00
parent 4fcf589fe7
commit 3148f93ee7
7 changed files with 46 additions and 50 deletions

View File

@@ -27,9 +27,9 @@ export const flattenTranslation = (
if (!(obj instanceof Object)) return { [path ?? '']: obj };
return Object.keys(obj).reduce((output, key) => {
return {
...output,
...flattenTranslation(obj[key], path ? path + '.' + key : key),
};
return Object.assign(
output,
flattenTranslation(obj[key], path ? path + '.' + key : key)
);
}, {});
};