mirror of
https://github.com/strapi/strapi.git
synced 2025-07-15 21:11:28 +00:00
16 lines
335 B
JavaScript
16 lines
335 B
JavaScript
'use strict';
|
|
|
|
const _ = require('lodash');
|
|
const pluralize = require('pluralize');
|
|
|
|
const toPlural = str => pluralize(_.camelCase(str));
|
|
const toSingular = str => _.camelCase(pluralize.singular(str));
|
|
|
|
const toInputName = str => `${_.upperFirst(toSingular(str))}Input`;
|
|
|
|
module.exports = {
|
|
toSingular,
|
|
toPlural,
|
|
toInputName,
|
|
};
|