Skip to content

Commit

Permalink
Merge pull request #27 from tuvistavie/jeremyruppel_underscore.inflec…
Browse files Browse the repository at this point in the history
…tion_26

Add singular rule for words ending with 'ss'.
  • Loading branch information
jeremyruppel committed Apr 3, 2016
2 parents 6cefc3f + 53bae99 commit b9c1020
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/underscore.inflection.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
this.singular(/([^aeiouy]|qu)ies$/, '$1y');
this.singular(/(s)eries$/, '$1eries');
this.singular(/(m)ovies$/, '$1ovie');
this.singular(/(ss)$/, '$1');
this.singular(/(x|ch|ss|sh)es$/, '$1');
this.singular(/([m|l])ice$/, '$1ouse');
this.singular(/(bus)es$/, '$1');
Expand Down
3 changes: 3 additions & 0 deletions test/inflector.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('inflector', function() {
['loaf', 'loaves'],
['thief', 'thieves'],
['hive', 'hives'],
['boss', 'bosses'],
['soliloquy', 'soliloquies'],
['wish', 'wishes'],
['vertex', 'vertices'],
Expand All @@ -47,6 +48,8 @@ describe('inflector', function() {
['mice', 'mouse'],
['buses', 'bus'],
['shoes', 'shoe'],
['bosses', 'boss'],
['boss', 'boss'],
['crises', 'crisis'],
['viri', 'virus'],
['statuses', 'status'],
Expand Down

0 comments on commit b9c1020

Please sign in to comment.