diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2017-10-03 20:14:01 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2017-10-03 20:14:01 +0000 |
commit | 900a19edfc1d9021557d264df558194dedad0a8c (patch) | |
tree | 91f759037644fb8a9683d8779cd194f21938c3cd | |
parent | da9d42f2b31c6e8263365de8b326a082ab9506ac (diff) | |
parent | dae78a5598cd4890d1e922c5721e0e646cae9462 (diff) | |
download | gitlab-ce-900a19edfc1d9021557d264df558194dedad0a8c.tar.gz |
Merge branch 'winh-fix-sprintf-eslint' into 'master'
Fix linting errors in sprintf
See merge request gitlab-org/gitlab-ce!14664
-rw-r--r-- | app/assets/javascripts/locale/sprintf.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/app/assets/javascripts/locale/sprintf.js b/app/assets/javascripts/locale/sprintf.js index 003cbe820d6..5f4a053f98e 100644 --- a/app/assets/javascripts/locale/sprintf.js +++ b/app/assets/javascripts/locale/sprintf.js @@ -12,15 +12,15 @@ import _ from 'underscore'; @see https://gitlab.com/gitlab-org/gitlab-ce/issues/37992 **/ export default (input, parameters, escapeParameters = true) => { - let output = input; + let output = input; - if (parameters) { - Object.keys(parameters).forEach((parameterName) => { - const parameterValue = parameters[parameterName]; - const escapedParameterValue = escapeParameters ? _.escape(parameterValue) : parameterValue; - output = output.replace(new RegExp(`%{${parameterName}}`, 'g'), escapedParameterValue); - }); - } + if (parameters) { + Object.keys(parameters).forEach((parameterName) => { + const parameterValue = parameters[parameterName]; + const escapedParameterValue = escapeParameters ? _.escape(parameterValue) : parameterValue; + output = output.replace(new RegExp(`%{${parameterName}}`, 'g'), escapedParameterValue); + }); + } - return output; -} + return output; +}; |