Permalink
Browse files

Merge branch 'master' of github.com:mde/utilities

  • Loading branch information...
mde
mde committed Dec 7, 2012
2 parents fa31901 + 32b8f61 commit 0b3bd262430a7d14e88f97e7abed7dabd942954a
Showing with 4 additions and 2 deletions.
  1. +1 −0 lib/inflection.js
  2. +3 −2 lib/string.js
View
@@ -119,6 +119,7 @@ var inflection = new (function () {
setPlural(/(quiz)$/i, "$1zes");
setSingular(/s$/i, "")
+ setSingular(/ss$/i, "ss")
setSingular(/(n)ews$/i, "$1ews")
setSingular(/([ti])a$/i, "$1um")
setSingular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, "$1$2sis")
View
@@ -412,7 +412,7 @@ string = new (function () {
}
else {
returnString = str.substring(0, last) + opts.omission;
- returnString += callback ? callback() : '';
+ returnString += callback && typeof callback === 'function' ? callback() : '';
return returnString;
}
};
@@ -719,7 +719,8 @@ string = new (function () {
initialCap = opts.initialCap;
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)
, namePlural = inflection.pluralize(normalizedName);

0 comments on commit 0b3bd26

Please sign in to comment.