Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
feat: optimizes translation helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Jan 21, 2020
1 parent cb37f7a commit 3ab8400
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/core/codename-translate-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export class CodenameTranslateHelper {
}
}
}
if (key !== '0') {

if (typeof val === 'object' && val !== null) {
this.replaceIdReferencesWithCodenames(val, allData);
}
}
Expand All @@ -52,7 +53,7 @@ export class CodenameTranslateHelper {
}
}
}
if (key !== '0') {
if (typeof val === 'object' && val !== null) {
this.extractReferencedCodenames(val, allData, foundCodenames);
}
}
Expand All @@ -77,7 +78,7 @@ export class CodenameTranslateHelper {
return codename;
}
}
if (key !== '0') {
if (typeof val === 'object' && val !== null) {
foundCodename = this.tryFindCodenameForId(findId, val, foundCodename);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/id-translate-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class IdTranslateHelper {
}
}

if (key !== '0') {
if (typeof val === 'object' && val !== null) {
this.replaceIdReferencesWithNewId(val, items);
}
}
Expand Down

0 comments on commit 3ab8400

Please sign in to comment.