14 lines
298 B
JavaScript
14 lines
298 B
JavaScript
const { pascalCase } = require('change-case-all')
|
|
|
|
const prefix = 'IGraphQL'
|
|
function GraphQLNamingConvention(str) {
|
|
|
|
|
|
if (str && str.toLowerCase().startsWith(prefix.toLowerCase())) {
|
|
return str;
|
|
}
|
|
return prefix + pascalCase(str) || str;
|
|
}
|
|
|
|
module.exports = GraphQLNamingConvention;
|