Skip to content

Commit affc0eb

Browse files
committed
docs: update readme.md to reflect current usage and behaviour
1 parent 9ef38a3 commit affc0eb

1 file changed

Lines changed: 3 additions & 39 deletions

File tree

Readme.md

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# inflection
22

3-
A port of inflection-js to node.js module
3+
A package to transform english strings into other forms like the plural form, singular form, camelCase form, etc.
44

55
<a href="https://www.npmjs.com/package/inflection"><img src="https://img.shields.io/npm/v/inflection" alt="NPM Version" /></a>
66

77

88
## Description
9-
[inflection-js](http://code.google.com/p/inflection-js/) is a port of the functionality from Ruby on Rails' Active Support Inflection classes into Javascript. `inflection` is a port of `inflection-js` to node.js npm package. Instead of [extending JavaScript native](http://wonko.com/post/extending-javascript-natives) String object like `inflection-js` does, `inflection` separate the methods to a independent package to avoid unexpected behaviors.
9+
This package was originally a port of [inflection-js](http://code.google.com/p/inflection-js/), which is a port of the functionality from Ruby on Rails' Active Support Inflection classes into Javascript.
1010

1111
Note: This library uses [Wiktionary](http://en.wiktionary.org) as its reference.
1212

@@ -40,7 +40,6 @@ Install inflection through npm
4040

4141
## API
4242

43-
- inflection.indexOf( arr, item, from_index, compare_func );
4443
- inflection.pluralize( str, plural );
4544
- inflection.singularize( str, singular );
4645
- inflection.inflect( str, count, singular, plural );
@@ -63,42 +62,7 @@ Install inflection through npm
6362

6463
> Require the module before using
6564
66-
var inflection = require( 'inflection' );
67-
68-
69-
70-
### inflection.indexOf( arr, item, from_index, compare_func );
71-
72-
This lets us detect if an Array contains a given element.
73-
74-
#### Arguments
75-
76-
> arr
77-
78-
type: Array
79-
desc: The subject array.
80-
81-
> item
82-
83-
type: Object
84-
desc: Object to locate in the Array.
85-
86-
> from_index
87-
88-
type: Number
89-
desc: Starts checking from this position in the Array.(optional)
90-
91-
> compare_func
92-
93-
type: Function
94-
desc: Function used to compare Array item vs passed item.(optional)
95-
96-
#### Example code
97-
98-
var inflection = require( 'inflection' );
99-
100-
inflection.indexOf([ 'hi','there' ], 'guys' ); // === -1
101-
inflection.indexOf([ 'hi','there' ], 'hi' ); // === 0
65+
const inflection = require( 'inflection' );
10266

10367

10468

0 commit comments

Comments
 (0)