BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
900a19ed
Commit
900a19ed
authored
Oct 03, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'winh-fix-sprintf-eslint' into 'master'
Fix linting errors in sprintf See merge request gitlab-org/gitlab-ce!14664
parents
da9d42f2
dae78a55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
sprintf.js
app/assets/javascripts/locale/sprintf.js
+10
-10
No files found.
app/assets/javascripts/locale/sprintf.js
View file @
900a19ed
...
...
@@ -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
;
}
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment