Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ This function adds foreign key support to every String object.
> low_first_letter

type: Boolean
desc: Default is to seperate id with an underbar at the end of the class name, you can pass true to skip it.(optional)
desc: Default is to separate id with an underbar at the end of the class name, you can pass true to skip it.(optional)

#### Example code
```js
Expand Down
6 changes: 5 additions & 1 deletion src/inflection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ const uncountableWords = [
'aircraft',
'alcohol',
'anger',
'any',
'applause',
'arithmetic',
// 'art',
'assistance',
'athletics',
// 'attention',
'aws',

'bacon',
'baggage',
Expand Down Expand Up @@ -184,6 +186,7 @@ const uncountableWords = [
'mayonnaise',
'measles',
// 'meat',
'media',
// 'metal',
'methane',
'milk',
Expand Down Expand Up @@ -213,6 +216,7 @@ const uncountableWords = [
// 'permission',
'physics',
'poetry',
'police',
'pollution',
'poverty',
// 'power',
Expand Down Expand Up @@ -917,7 +921,7 @@ export function classify(str: string) {
/**
* This function adds foreign key support to every String object.
* @param str The subject string.
* @param dropIdUbar Default is to seperate id with an underbar at the end of the class name,
* @param dropIdUbar Default is to separate id with an underbar at the end of the class name,
you can pass true to skip it.(optional)
* @returns Underscored plural nouns become the camel cased singular form.
* @example
Expand Down
8 changes: 8 additions & 0 deletions test/inflection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ describe('test .pluralize', function () {
expect(inflection.pluralize('grammar')).toEqual('grammars');
expect(inflection.pluralize('drive')).toEqual('drives');
expect(inflection.pluralize('database')).toEqual('databases');
expect(inflection.pluralize('any')).toEqual('any');
expect(inflection.pluralize('aws')).toEqual('aws');
expect(inflection.pluralize('media')).toEqual('media');
expect(inflection.pluralize('police')).toEqual('police');
});
});

Expand Down Expand Up @@ -97,6 +101,10 @@ describe('test .singularize', function () {
expect(inflection.singularize('grammars')).toEqual('grammar');
expect(inflection.singularize('drives')).toEqual('drive');
expect(inflection.singularize('databases')).toEqual('database');
expect(inflection.singularize('any')).toEqual('any');
expect(inflection.singularize('aws')).toEqual('aws');
expect(inflection.singularize('media')).toEqual('media');
expect(inflection.singularize('police')).toEqual('police');
});
});

Expand Down
Loading