Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mde/utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Dec 7, 2012
2 parents fa31901 + 32b8f61 commit 0b3bd26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/inflection.js
Expand Up @@ -119,6 +119,7 @@ var inflection = new (function () {
setPlural(/(quiz)$/i, "$1zes"); setPlural(/(quiz)$/i, "$1zes");


setSingular(/s$/i, "") setSingular(/s$/i, "")
setSingular(/ss$/i, "ss")
setSingular(/(n)ews$/i, "$1ews") setSingular(/(n)ews$/i, "$1ews")
setSingular(/([ti])a$/i, "$1um") setSingular(/([ti])a$/i, "$1um")
setSingular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, "$1$2sis") setSingular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, "$1$2sis")
Expand Down
5 changes: 3 additions & 2 deletions lib/string.js
Expand Up @@ -412,7 +412,7 @@ string = new (function () {
} }
else { else {
returnString = str.substring(0, last) + opts.omission; returnString = str.substring(0, last) + opts.omission;
returnString += callback ? callback() : ''; returnString += callback && typeof callback === 'function' ? callback() : '';
return returnString; return returnString;
} }
}; };
Expand Down Expand Up @@ -719,7 +719,8 @@ string = new (function () {
initialCap = opts.initialCap; initialCap = opts.initialCap;


var self = this var self = this
, normalizedName = this.snakeize(name) // Use plural version to fix possible mistakes(e,g,. thingie instead of thingy)
, normalizedName = this.snakeize(inflection.pluralize(name))
, nameSingular = inflection.singularize(normalizedName) , nameSingular = inflection.singularize(normalizedName)
, namePlural = inflection.pluralize(normalizedName); , namePlural = inflection.pluralize(normalizedName);


Expand Down

0 comments on commit 0b3bd26

Please sign in to comment.