plain-design 1.0.0-beta.58 → 1.0.0-beta.59
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -185,7 +185,12 @@ export const i18n = (() => {
|
|
185
185
|
hooks.onUpdateLangs.exec(undefined);
|
186
186
|
};
|
187
187
|
|
188
|
-
const mergeLangs = (lang1: PlainObject, lang2: PlainObject, merge: (val1: PlainObject, val2: PlainObject) => PlainObject): PlainObject => {
|
188
|
+
const mergeLangs = (lang1: PlainObject | undefined, lang2: PlainObject | undefined, merge: (val1: PlainObject, val2: PlainObject) => PlainObject | undefined): PlainObject | undefined => {
|
189
|
+
|
190
|
+
if (!lang1 || !lang2) {
|
191
|
+
return lang1 || lang2;
|
192
|
+
}
|
193
|
+
|
189
194
|
const keys = new Set<string>();
|
190
195
|
Object.keys(lang1).forEach(key => {keys.add(key);});
|
191
196
|
Object.keys(lang2).forEach(key => {keys.add(key);});
|