postgrelize / useInflection
Function: useInflection() ​
useInflection(
custom):void
Defined in: src/model/inflector.ts:38
Replaces the inflection library used to singularize and pluralize association names and to underscore column names (Sequelize v6 useInflection). Call it before defining models.
Parameters ​
custom ​
Library with singularize, pluralize and underscore.
Returns ​
void
See ​
Example ​
ts
useInflection({
singularize: (word) => word.replace(/s$/, ''),
pluralize: (word) => `${word}s`,
underscore: (word) => word.replace(/([A-Z])/g, '_$1').toLowerCase(),
});