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 1.2.6 to 1.2.7

13

History.md
# History
## 1.2.7 / 2013-12-11
- [new feature] Added transform, thnaks to `luk3thomas`
- [update packages] should->v2.1.1
## 1.2.6 / 2013-05-24
- [bug fix] Use instance instead of `this`
## 1.2.5 / 2013-01-09

@@ -4,0 +17,0 @@

36

lib/inflection.js

@@ -244,3 +244,3 @@ /*!

* inflection.pluralize( 'person' ); // === 'people'
* inflection.pluralize( 'octopus' ); // === "octopi"
* inflection.pluralize( 'octopus' ); // === 'octopi'
* inflection.pluralize( 'Hat' ); // === 'Hats'

@@ -267,3 +267,3 @@ * inflection.pluralize( 'person', 'guys' ); // === 'guys'

* inflection.singularize( 'people' ); // === 'person'
* inflection.singularize( 'octopi' ); // === "octopus"
* inflection.singularize( 'octopi' ); // === 'octopus'
* inflection.singularize( 'Hats' ); // === 'Hat'

@@ -552,3 +552,3 @@ * inflection.singularize( 'guys', 'person' ); // === 'person'

* @param {String} str The subject string.
* @returns {String} Return all found numbers their sequence like "22nd".
* @returns {String} Return all found numbers their sequence like '22nd'.
* @example

@@ -588,2 +588,30 @@ *

return str_arr.join( ' ' );
},
/**
* This function performs multiple inflection methods on a string
* @public
* @function
* @param {String} str The subject string.
* @param {Array} arr An array of inflection methods.
* @returns {String}
* @example
*
* var inflection = require( 'inflection' );
*
* inflection.transform( 'all job', [ 'pluralize', 'capitalize', 'dasherize' ]); // === 'All-jobs'
*/
transform : function ( str, arr ){
var i = 0;
var j = arr.length;
for( ;i < j; i++ ){
var method = arr[ i ];
if( this.hasOwnProperty( method )){
str = this[ method ]( str );
}
}
return str;
}

@@ -597,3 +625,3 @@ };

*/
inflector.version = "1.2.5";
inflector.version = '1.2.7';
/**

@@ -600,0 +628,0 @@ * Exports module.

4

package.json
{
"name" : "inflection",
"version" : "1.2.6",
"version" : "1.2.7",
"description": "A port of inflection-js to node.js module",

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

"node.flow": "1.2.2",
"should" : "1.2.2"
"should" : "2.1.1"
},

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

@@ -42,2 +42,3 @@ # inflection

- inflection.ordinalize( str );
- inflection.transform( str, arr );

@@ -383,2 +384,26 @@

### inflection.transform( str, arr );
This function performs multiple inflection methods on a string.
#### Arguments
> str
type: String
desc: The subject string.
> arr
type: Array
desc: An array of inflection methods.
#### Example code
var inflection = require( 'inflection' );
inflection.transform( 'all job', [ 'pluralize', 'capitalize', 'dasherize' ]); // === 'All-jobs'
## Credit

@@ -389,5 +414,5 @@

- brandondewitt
- luk3thomas
## License

@@ -394,0 +419,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