Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inflection

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inflection - npm Package Compare versions

Comparing version 0.0.1 to 1.0.0

8

History.md

@@ -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

54

lib/inflection.js

@@ -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 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc