Socket
Socket
Sign inDemoInstall

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 1.2.2 to 1.2.3

7

History.md
# History
## 1.2.3 / 2012-08-02
- [bug fix] Singularize `status` produces `statu`
- [update packages] should->v1.1.0
## 1.2.2 / 2012-07-23

@@ -4,0 +11,0 @@

81

lib/inflection.js

@@ -27,2 +27,31 @@ /*!

var plural_rules = [
// 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' )],
// original rule
[ new RegExp( '(m)an$', 'gi' ), '$1en' ],

@@ -47,30 +76,4 @@ [ new RegExp( '(pe)rson$', 'gi' ), '$1ople' ],

// 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' ],
[ new RegExp( '$', 'gi' ), 's' ]
[ new RegExp( 's$', 'gi' ), 's' ],
[ new RegExp( '$', 'gi' ), 's' ]
];

@@ -83,2 +86,24 @@

var singular_rules = [
// do not replace if its already a singular word
[ new RegExp( '(m)an$', 'gi' )],
[ new RegExp( '(pe)rson$', 'gi' )],
[ new RegExp( '(child)$', 'gi' )],
[ new RegExp( '^(ox)$', 'gi' )],
[ new RegExp( '(ax|test)is$', 'gi' )],
[ new RegExp( '(octop|vir)us$', 'gi' )],
[ new RegExp( '(alias|status)$', 'gi' )],
[ new RegExp( '(bu)s$', 'gi' )],
[ new RegExp( '(buffal|tomat|potat)o$', 'gi' )],
[ new RegExp( '([ti])um$', 'gi' )],
[ new RegExp( 'sis$', 'gi' )],
[ new RegExp( '(?:([^f])fe|([lr])f)$', 'gi' )],
[ new RegExp( '(hive)$', 'gi' )],
[ new RegExp( '([^aeiouy]|qu)y$', 'gi' )],
[ new RegExp( '(x|ch|ss|sh)$', 'gi' )],
[ new RegExp( '(matr|vert|ind)ix|ex$', 'gi' )],
[ new RegExp( '([m|l])ouse$', 'gi' )],
[ new RegExp( '(quiz)$', 'gi' )],
// original rule
[ new RegExp( '(m)en$', 'gi' ), '$1an' ],

@@ -85,0 +110,0 @@ [ new RegExp( '(pe)ople$', 'gi' ), '$1rson' ],

{
"name" : "inflection",
"version" : "1.2.2",
"version" : "1.2.3",
"description": "A port of inflection-js to node.js module",

@@ -19,3 +19,3 @@ "keywords" : [

"node.flow": "1.1.3",
"should" : "1.0.0"
"should" : "1.1.0"
},

@@ -22,0 +22,0 @@ "main" : "./lib/inflection.js",

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