Skip to content

Commit

Permalink
fix: fix singularizing databases not using correct word
Browse files Browse the repository at this point in the history
fixes #91
  • Loading branch information
p-kuen committed Sep 18, 2022
1 parent 27a4b7a commit e81241c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/inflection.js
Expand Up @@ -352,6 +352,7 @@
children : new RegExp( '(child)ren$' , 'gi' ),
tia : new RegExp( '([ti])a$' , 'gi' ),
analyses : new RegExp( '((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$','gi' ),
databases : new RegExp( '(database)s$' , 'gi' ),
drives : new RegExp( '(drive)s$' , 'gi' ),
hives : new RegExp( '(hi|ti)ves$' , 'gi' ),
curves : new RegExp( '(curve)s$' , 'gi' ),
Expand Down Expand Up @@ -425,6 +426,7 @@
[ regex.plural.children ],
[ regex.plural.tia ],
[ regex.plural.analyses ],
[ regex.plural.databases ],
[ regex.plural.drives ],
[ regex.plural.hives ],
[ regex.plural.curves ],
Expand Down Expand Up @@ -523,6 +525,7 @@
[ regex.plural.men , '$1an' ],
[ regex.plural.people , '$1rson' ],
[ regex.plural.children , '$1' ],
[ regex.plural.databases, '$1'],
[ regex.plural.drives , '$1'],
[ regex.plural.genera , 'genus'],
[ regex.plural.criteria , '$1on'],
Expand Down
2 changes: 2 additions & 0 deletions test/inflection.test.js
Expand Up @@ -58,6 +58,7 @@ describe("test .pluralize", function () {
expect(inflection.pluralize("bonus")).toEqual("bonuses");
expect(inflection.pluralize("grammar")).toEqual("grammars");
expect(inflection.pluralize("drive")).toEqual("drives");
expect(inflection.pluralize("database")).toEqual("databases");
});
});

Expand Down Expand Up @@ -107,6 +108,7 @@ describe("test .singularize", function () {
expect(inflection.singularize("bonuses")).toEqual("bonus");
expect(inflection.singularize("grammars")).toEqual("grammar");
expect(inflection.singularize("drives")).toEqual("drive");
expect(inflection.singularize("databases")).toEqual("database");
});
});

Expand Down

0 comments on commit e81241c

Please sign in to comment.