Skip to content

Commit

Permalink
fix: use undefined by default
Browse files Browse the repository at this point in the history
  • Loading branch information
GalvinGao committed Feb 17, 2023
1 parent f316dad commit 104cd55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mixins/I18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function transformMessages (messages) {
current[arrayName] = [];
}
if (i === path.length - 1) {
current[arrayName][arrayIndex] = messages[key];
current[arrayName][arrayIndex] = messages[key] || undefined;
} else {
if (!current[arrayName][arrayIndex]) {
current[arrayName][arrayIndex] = {};
Expand All @@ -73,8 +73,8 @@ function transformMessages (messages) {
}
} else {
// object
if (i === path.length - 1) {
current[pathPart] = messages[key];
if (i === path.length - 1) { // last part
current[pathPart] = messages[key] || undefined
} else {
if (!current[pathPart]) {
current[pathPart] = {};
Expand Down

0 comments on commit 104cd55

Please sign in to comment.