const generateArticleSlugUrlString = (article) => { let slug = article.content.slug let title = article.content.title if (!slug || slug === "") { slug = title .replace(/[^a-zA-Z0-9 ]/g, "") .replace(/\s/g, "-") .toLowerCase() } return slug } module.exports = { generateArticleSlugUrlString, }