Skip to content

Commit e81241c

Browse files
committed
fix: fix singularizing databases not using correct word
fixes #91
1 parent 27a4b7a commit e81241c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/inflection.js

+3
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@
352352
children : new RegExp( '(child)ren$' , 'gi' ),
353353
tia : new RegExp( '([ti])a$' , 'gi' ),
354354
analyses : new RegExp( '((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$','gi' ),
355+
databases : new RegExp( '(database)s$' , 'gi' ),
355356
drives : new RegExp( '(drive)s$' , 'gi' ),
356357
hives : new RegExp( '(hi|ti)ves$' , 'gi' ),
357358
curves : new RegExp( '(curve)s$' , 'gi' ),
@@ -425,6 +426,7 @@
425426
[ regex.plural.children ],
426427
[ regex.plural.tia ],
427428
[ regex.plural.analyses ],
429+
[ regex.plural.databases ],
428430
[ regex.plural.drives ],
429431
[ regex.plural.hives ],
430432
[ regex.plural.curves ],
@@ -523,6 +525,7 @@
523525
[ regex.plural.men , '$1an' ],
524526
[ regex.plural.people , '$1rson' ],
525527
[ regex.plural.children , '$1' ],
528+
[ regex.plural.databases, '$1'],
526529
[ regex.plural.drives , '$1'],
527530
[ regex.plural.genera , 'genus'],
528531
[ regex.plural.criteria , '$1on'],

test/inflection.test.js

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ describe("test .pluralize", function () {
5858
expect(inflection.pluralize("bonus")).toEqual("bonuses");
5959
expect(inflection.pluralize("grammar")).toEqual("grammars");
6060
expect(inflection.pluralize("drive")).toEqual("drives");
61+
expect(inflection.pluralize("database")).toEqual("databases");
6162
});
6263
});
6364

@@ -107,6 +108,7 @@ describe("test .singularize", function () {
107108
expect(inflection.singularize("bonuses")).toEqual("bonus");
108109
expect(inflection.singularize("grammars")).toEqual("grammar");
109110
expect(inflection.singularize("drives")).toEqual("drive");
111+
expect(inflection.singularize("databases")).toEqual("database");
110112
});
111113
});
112114

0 commit comments

Comments
 (0)