inflection-extended
inflection-extended
is a Javascript library that can contains different inflection functions.
inflection-extended
can be used as a monad library that be be incorporated into extended
or used standalone.
var inflect = ; inflect; //helloWorld
Or
var myextended = ; myExtended; //helloWorld
Installation
npm install inflection-extended
Or download the source (minified)
Usage
camelize
Converts a underscored string to camelcase
//as a functioninflect; //helloWorldinflect; //columnNameinflect; //columnNameinflect; //nullinflect; //undefined //as a monadvalue; //helloWorldvalue; //columnNamevalue; //columnName
underscore
Converts a camelcase string to the underscored string.
//as a functioninflect; //hello_worldinflect; //column_nameinflect; //column_nameinflect; //nullinflect; //undefined //as a monadvalue; //hello_worldvalue; //column_namevalue; //column_name
classify
Singularizes and camelizes a string. Also strips out all characters preceding and including a period (".").
//as a functioninflect; //eggAndHaminflect; //postinflect; //post //as a monadvalue; //eggAndHamvalue; //postvalue; //post
singularize
The reverse of pluralize, returns the singular form of a word.
//as a functioninflect; //postinflect; //octopusinflect; //sheepinflect; //wordinflect; //the blue mailmaninflect; //CamelOctopus //as a monadvalue; //postvalue; //octopusvalue; //sheepvalue; //wordvalue; //the blue mailmanvalue; //CamelOctopus
pluralize
Returns the plural form of the word.
//as a functioninflect; //postsinflect; //octopiinflect; //sheepinflect; //wordsinflect; //the blue mailmeninflect; //CamelOctopi //as a monadvalue; //postsvalue; //octopivalue; //sheepvalue; //wordsvalue; //the blue mailmenvalue; //CamelOctopi