Skip to content

Commit

Permalink
ignore empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
broncha committed Mar 24, 2020
1 parent 19be596 commit fdba2b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ exports.changeBaseLocale = function(strs, fromLocale, toLocale) {
exports.updateLocalizedStrings = function(strs, updates) {
var key, match, regularize, str, update, updateMap, value, _i, _j, _len, _len1;
regularize = function(str) {
if (!str) {
return str;
}
return str.replace(/\r/g, "").trim();
};
updateMap = {};
Expand Down
2 changes: 2 additions & 0 deletions src/utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ exports.changeBaseLocale = (strs, fromLocale, toLocale) ->
exports.updateLocalizedStrings = (strs, updates) ->
# Regularize CR/LF and trim
regularize = (str) ->
if not str
return str
return str.replace(/\r/g, "").trim()

# Map updates by key
Expand Down

0 comments on commit fdba2b3

Please sign in to comment.