inflection
Advanced tools
Comparing version 0.0.1 to 1.0.0
@@ -0,3 +1,11 @@ | ||
## 1.0.0 / 2012-02-08 | ||
- Remove make file | ||
- Add pluralize rules | ||
- Add pluralize tests | ||
- Use object.jey instead of for in | ||
## 0.0.1 / 2012-01-16 | ||
- Initial release |
@@ -43,2 +43,28 @@ /*! | ||
[ new RegExp( '(quiz)$', 'gi' ), '$1zes' ], | ||
// do not replace if its already a plural word | ||
[ new RegExp( '(m)en$', 'gi' )], | ||
[ new RegExp( '(pe)ople$', 'gi' )], | ||
[ new RegExp( '(child)ren$', 'gi' )], | ||
[ new RegExp( '([ti])a$', 'gi' )], | ||
[ new RegExp( '((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$','gi' )], | ||
[ new RegExp( '(hive)s$', 'gi' )], | ||
[ new RegExp( '(tive)s$', 'gi' )], | ||
[ new RegExp( '(curve)s$', 'gi' )], | ||
[ new RegExp( '([lr])ves$', 'gi' )], | ||
[ new RegExp( '([^fo])ves$', 'gi' )], | ||
[ new RegExp( '([^aeiouy]|qu)ies$', 'gi' )], | ||
[ new RegExp( '(s)eries$', 'gi' )], | ||
[ new RegExp( '(m)ovies$', 'gi' )], | ||
[ new RegExp( '(x|ch|ss|sh)es$', 'gi' )], | ||
[ new RegExp( '([m|l])ice$', 'gi' )], | ||
[ new RegExp( '(bus)es$', 'gi' )], | ||
[ new RegExp( '(o)es$', 'gi' )], | ||
[ new RegExp( '(shoe)s$', 'gi' )], | ||
[ new RegExp( '(cris|ax|test)es$', 'gi' )], | ||
[ new RegExp( '(octop|vir)i$', 'gi' )], | ||
[ new RegExp( '(alias|status)es$', 'gi' )], | ||
[ new RegExp( '^(ox)en', 'gi' )], | ||
[ new RegExp( '(vert|ind)ices$', 'gi' )], | ||
[ new RegExp( '(matr)ices$', 'gi' )], | ||
[ new RegExp( '(quiz)zes$', 'gi' )], | ||
[ new RegExp( 's$', 'gi' ), 's' ], | ||
@@ -106,5 +132,5 @@ [ new RegExp( '$', 'gi' ), 's' ] | ||
* @public | ||
* @version 0.0.1 | ||
* @version 1.0.0 | ||
*/ | ||
version : '0.0.1', | ||
version : '1.0.0', | ||
@@ -127,21 +153,23 @@ | ||
_apply_rules : function( str, rules, skip, override ){ | ||
if( override ){ | ||
str = override; | ||
}else{ | ||
var ignore = ( this.indexOf( skip, str.toLowerCase()) > -1 ); | ||
if( override ){ | ||
str = override; | ||
}else{ | ||
var ignore = ( this.indexOf( skip, str.toLowerCase()) > -1 ); | ||
if( !ignore ){ | ||
var i = 0; | ||
var j = rules.length; | ||
if( !ignore ){ | ||
var i = 0; | ||
var j = rules.length; | ||
for( ; i < j; i++ ){ | ||
if( str.match( rules[ i ][ 0 ])){ | ||
for( ; i < j; i++ ){ | ||
if( str.match( rules[ i ][ 0 ])){ | ||
if( rules[ i ][ 1 ] !== undefined ){ | ||
str = str.replace( rules[ i ][ 0 ], rules[ i ][ 1 ]); | ||
break; | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
return str; | ||
return str; | ||
}, | ||
@@ -148,0 +176,0 @@ |
{ | ||
"name" : "inflection", | ||
"version" : "0.0.1", | ||
"description" : "A port of inflection-js to node.js module", | ||
"keywords" : [ | ||
"inflection", "inflections", "inflection-js", "pluralize" , "singularize", | ||
"camelize", "underscore", "humanize", "capitalize", "dasherize", "titleize", | ||
"name" : "inflection", | ||
"version" : "1.0.0", | ||
"description": "A port of inflection-js to node.js module", | ||
"keywords" : [ | ||
"inflection", "inflections", "inflection-js", "pluralize" , "singularize", | ||
"camelize", "underscore", "humanize", "capitalize", "dasherize", "titleize", | ||
"demodulize", "tableize", "classify", "foreign_key", "ordinalize" | ||
], | ||
"author" : "dreamerslab <ben@dreamerslab.com>", | ||
"dependencies" : {}, | ||
"devDependencies" : { | ||
"node.flow" : "0.0.3", | ||
"should" : "0.5.1" | ||
"author" : "dreamerslab <ben@dreamerslab.com>", | ||
"dependencies" : {}, | ||
"devDependencies": { | ||
"node.flow": "0.0.3", | ||
"should" : "0.5.1" | ||
}, | ||
"main" : "index", | ||
"repository" : { | ||
"type" : "git", | ||
"main" : "index", | ||
"repository": { | ||
"type": "git", | ||
"url" : "https://github.com/dreamerslab/node.inflection.git" | ||
@@ -20,0 +20,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
28260
480
1
6