Skip to content

Commit

Permalink
strip out spaces even if not fixing case
Browse files Browse the repository at this point in the history
  • Loading branch information
emgee3 committed Jan 18, 2014
1 parent 2b2e8a4 commit 987089a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/namecase
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ process.stdin.on('end', function () {
if (NameCase.checkName(str[i])) {
out.push(NameCase(str[i]));
} else {
out.push(str[i]);
out.push(NameCase.normalize(str[i]));
}
}

Expand Down
5 changes: 5 additions & 0 deletions namecase.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@
};


NameCase.normalize = function (name) {
return name.replace(/\s{2,}/g, ' ');
};


if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = NameCase;
Expand Down

0 comments on commit 987089a

Please sign in to comment.