Alexandre Bodin b06e6d5c93 Refactor graphql plugin
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-02-10 21:38:09 +01:00

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,
};