From d0191e294fd7ac8cafe5b59977de3d03cca5f056 Mon Sep 17 00:00:00 2001 From: Martin Wortschack Date: Mon, 15 Oct 2018 15:32:47 +0200 Subject: [PATCH] Use literal instead of constructor for creating regex --- app/assets/javascripts/lib/utils/text_utility.js | 5 +---- .../52686-project-slug-does-not-auto-populate-in-ie11.yml | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 changelogs/unreleased/52686-project-slug-does-not-auto-populate-in-ie11.yml 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 diff --git a/changelogs/unreleased/52686-project-slug-does-not-auto-populate-in-ie11.yml b/changelogs/unreleased/52686-project-slug-does-not-auto-populate-in-ie11.yml new file mode 100644 index 00000000000..5a30317babf --- /dev/null +++ b/changelogs/unreleased/52686-project-slug-does-not-auto-populate-in-ie11.yml @@ -0,0 +1,5 @@ +--- +title: Use literal instead of constructor for creating regex +merge_request: 22367 +author: +type: other