You are viewing a single comment's thread from:
RE: Building A Content Management System Using The MEAN Stack - 1 (Create Server, Config File and Helper Modules)
Thank you for your contribution.
- Please format your code better, if the code is indented it will be easier to read. For example:
module.exports = slugify;
//convert string into slug
function slugify(input) {
if (!input)
return;
//make lower case and trim
var slug = input.toLowerCase().trim();
//replace invalid chars with spaces
slug = slug.replace(/[^a-z0-9\s-]/g, ' ');
//replace multiple spaces or hyphens with a single hyphen
slug = slug.replace(/[\s-]+/g, '-');
return slug;
};
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
Thank you for your review, @portugalcoin!
So far this week you've reviewed 16 contributions. Keep up the good work!
I'll work on that, thanks