Skip to content
Snippets Groups Projects
Commit d0191e29 authored by Martin Wortschack's avatar Martin Wortschack
Browse files

Use literal instead of constructor for creating regex

parent 280a132e
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Loading
Loading
@@ -53,10 +53,7 @@ export const slugify = str => str.trim().toLowerCase();
* @param {String} str
* @returns {String}
*/
export const slugifyWithHyphens = str => {
const regex = new RegExp(/\s+/, 'g');
return str.toLowerCase().replace(regex, '-');
};
export const slugifyWithHyphens = str => str.toLowerCase().replace(/\s+/g, '-');
 
/**
* Truncates given text
Loading
Loading
---
title: Use literal instead of constructor for creating regex
merge_request: 22367
author:
type: other
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment