style: add perf rules (#5413)
This commit is contained in:
@@ -45,10 +45,9 @@ export function useI18N() {
|
||||
return i18n;
|
||||
}
|
||||
|
||||
const resources = LOCALES.reduce<Resource>(
|
||||
(acc, { tag, res }) => ({ ...acc, [tag]: { translation: res } }),
|
||||
{}
|
||||
);
|
||||
const resources = LOCALES.reduce<Resource>((acc, { tag, res }) => {
|
||||
return Object.assign(acc, { [tag]: { translation: res } });
|
||||
}, {});
|
||||
|
||||
const fallbackLng = 'en';
|
||||
const standardizeLocale = (language: string) => {
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}, {});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user