Skip to content

Commit 8c21322

Browse files
authored
Merge branch 'master' into patch-1
2 parents 68cb1a3 + 125b337 commit 8c21322

File tree

9 files changed

+2066
-50
lines changed

9 files changed

+2066
-50
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: test
2+
on: [push, pull_request]
3+
jobs:
4+
run-tests:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-node@v2
9+
- run: npm install
10+
- run: npm test
11+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
22
node_modules
3+
.vscode
34
*.sock
45
*.sw[op]
File renamed without changes.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 dreamerslab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Readme.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
A port of inflection-js to node.js module
44

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

67

78
## Description
@@ -184,9 +185,9 @@ This function will pluralize or singularlize a String appropriately based on an
184185

185186
var inflection = require( 'inflection' );
186187

187-
inflection.inflect( 'people' 1 ); // === 'person'
188-
inflection.inflect( 'octopi' 1 ); // === 'octopus'
189-
inflection.inflect( 'Hats' 1 ); // === 'Hat'
188+
inflection.inflect( 'people', 1 ); // === 'person'
189+
inflection.inflect( 'octopi', 1 ); // === 'octopus'
190+
inflection.inflect( 'Hats', 1 ); // === 'Hat'
190191
inflection.inflect( 'guys', 1 , 'person' ); // === 'person'
191192
inflection.inflect( 'person', 2 ); // === 'people'
192193
inflection.inflect( 'octopus', 2 ); // === 'octopi'

lib/inflection.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,9 @@
366366
oes : new RegExp( '(o)es$' , 'gi' ),
367367
shoes : new RegExp( '(shoe)s$' , 'gi' ),
368368
crises : new RegExp( '(cris|ax|test)es$' , 'gi' ),
369-
octopi : new RegExp( '(octop|vir)i$' , 'gi' ),
369+
octopuses : new RegExp( '(octop|vir)uses$' , 'gi' ),
370370
aliases : new RegExp( '(alias|canvas|status|campus)es$', 'gi' ),
371-
summonses : new RegExp( '^(summons)es$' , 'gi' ),
371+
summonses : new RegExp( '^(summons|bonus)es$' , 'gi' ),
372372
oxen : new RegExp( '^(ox)en' , 'gi' ),
373373
matrices : new RegExp( '(matr)ices$' , 'gi' ),
374374
vertices : new RegExp( '(vert|ind)ices$' , 'gi' ),
@@ -391,7 +391,7 @@
391391
axis : new RegExp( '(ax|test)is$' , 'gi' ),
392392
octopus : new RegExp( '(octop|vir)us$' , 'gi' ),
393393
alias : new RegExp( '(alias|status|canvas|campus)$', 'gi' ),
394-
summons : new RegExp( '^(summons)$' , 'gi' ),
394+
summons : new RegExp( '^(summons|bonus)$' , 'gi' ),
395395
bus : new RegExp( '(bu)s$' , 'gi' ),
396396
buffalo : new RegExp( '(buffal|tomat|potat)o$' , 'gi' ),
397397
tium : new RegExp( '([ti])um$' , 'gi' ),
@@ -436,7 +436,7 @@
436436
[ regex.plural.oes ],
437437
[ regex.plural.shoes ],
438438
[ regex.plural.crises ],
439-
[ regex.plural.octopi ],
439+
[ regex.plural.octopuses ],
440440
[ regex.plural.aliases ],
441441
[ regex.plural.summonses ],
442442
[ regex.plural.oxen ],
@@ -455,7 +455,7 @@
455455
[ regex.singular.child , '$1ren' ],
456456
[ regex.singular.ox , '$1en' ],
457457
[ regex.singular.axis , '$1es' ],
458-
[ regex.singular.octopus , '$1i' ],
458+
[ regex.singular.octopus , '$1uses' ],
459459
[ regex.singular.alias , '$1es' ],
460460
[ regex.singular.summons , '$1es' ],
461461
[ regex.singular.bus , '$1ses' ],
@@ -536,7 +536,7 @@
536536
[ regex.plural.oes , '$1' ],
537537
[ regex.plural.shoes , '$1' ],
538538
[ regex.plural.crises , '$1is' ],
539-
[ regex.plural.octopi , '$1us' ],
539+
[ regex.plural.octopuses, '$1us' ],
540540
[ regex.plural.aliases , '$1' ],
541541
[ regex.plural.summonses, '$1' ],
542542
[ regex.plural.oxen , '$1' ],
@@ -661,7 +661,7 @@
661661
* var inflection = require( 'inflection' );
662662
*
663663
* inflection.pluralize( 'person' ); // === 'people'
664-
* inflection.pluralize( 'octopus' ); // === 'octopi'
664+
* inflection.pluralize( 'octopus' ); // === 'octopuses'
665665
* inflection.pluralize( 'Hat' ); // === 'Hats'
666666
* inflection.pluralize( 'person', 'guys' ); // === 'guys'
667667
*/
@@ -683,7 +683,7 @@
683683
* var inflection = require( 'inflection' );
684684
*
685685
* inflection.singularize( 'people' ); // === 'person'
686-
* inflection.singularize( 'octopi' ); // === 'octopus'
686+
* inflection.singularize( 'octopuses' ); // === 'octopus'
687687
* inflection.singularize( 'Hats' ); // === 'Hat'
688688
* inflection.singularize( 'guys', 'person' ); // === 'person'
689689
*/
@@ -706,11 +706,11 @@
706706
* var inflection = require( 'inflection' );
707707
*
708708
* inflection.inflect( 'people' 1 ); // === 'person'
709-
* inflection.inflect( 'octopi' 1 ); // === 'octopus'
709+
* inflection.inflect( 'octopuses' 1 ); // === 'octopus'
710710
* inflection.inflect( 'Hats' 1 ); // === 'Hat'
711711
* inflection.inflect( 'guys', 1 , 'person' ); // === 'person'
712712
* inflection.inflect( 'person', 2 ); // === 'people'
713-
* inflection.inflect( 'octopus', 2 ); // === 'octopi'
713+
* inflection.inflect( 'octopus', 2 ); // === 'octopuses'
714714
* inflection.inflect( 'Hat', 2 ); // === 'Hats'
715715
* inflection.inflect( 'person', 2, null, 'guys' ); // === 'guys'
716716
*/

0 commit comments

Comments
 (0)