Navigation Menu

Skip to content

Commit

Permalink
Singularize before attempting a Pluralize
Browse files Browse the repository at this point in the history
  • Loading branch information
Qard committed Jul 26, 2011
1 parent ca62211 commit e349257
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Expand Up @@ -12,6 +12,9 @@
// Make singular words plural.
exports.plural = function(str, keep_case) {
var s = this.trim(str);

// It's easier to avoid multipluralization by singularizing first.
s = this.singular(str);
if ( ! keep_case) { s = s.toLowerCase(); }
switch (s.substr(-1)) {
case 'y':
Expand Down

0 comments on commit e349257

Please sign in to comment.