Skip to content

Commit

Permalink
Replace 0 nullish values
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilsWebbod committed Jul 10, 2020
1 parent 801b598 commit 3a2ec29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default class Translate {
return text;
}
return text.replace(VARIABLE_REGEXP, (word, group) => {
return String(variables[group] || word);
return String(variables[group] ?? word);
});
}

Expand Down

0 comments on commit 3a2ec29

Please sign in to comment.