diff options
author | Martin Wortschack <mwortschack@gitlab.com> | 2018-10-15 15:32:47 +0200 |
---|---|---|
committer | Martin Wortschack <mwortschack@gitlab.com> | 2018-10-15 15:32:47 +0200 |
commit | d0191e294fd7ac8cafe5b59977de3d03cca5f056 (patch) | |
tree | c1b894e841b640126040c661d2660ba957d75b8e /app/assets/javascripts/lib | |
parent | 280a132e15c8e1f66487312584e734b108b00df7 (diff) | |
download | gitlab-ce-d0191e294fd7ac8cafe5b59977de3d03cca5f056.tar.gz |
Use literal instead of constructor for creating regex
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/utils/text_utility.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/assets/javascripts/lib/utils/text_utility.js b/app/assets/javascripts/lib/utils/text_utility.js index 250980919dd..7cc7cd6d20e 100644 --- a/app/assets/javascripts/lib/utils/text_utility.js +++ b/app/assets/javascripts/lib/utils/text_utility.js @@ -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 |