strapi/packages/strapi-utils/lib/stringFormatting.js
Pierre Noël be6517c02d refacto strapi-generate-* + move nameToSlug to strapi-utils
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
2020-03-23 10:42:34 +01:00

13 lines
262 B
JavaScript

'use strict';
const slugify = require('@sindresorhus/slugify');
const nameToSlug = name => slugify(name, { separator: '-' });
const nameToCollectionName = name => slugify(name, { separator: '_' });
module.exports = {
nameToSlug,
nameToCollectionName,
};