Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
fe829def
Commit
fe829def
authored
Aug 14, 2018
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix lint
parent
3f016fe7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
app/assets/javascripts/lib/utils/common_utils.js
app/assets/javascripts/lib/utils/common_utils.js
+13
-12
No files found.
app/assets/javascripts/lib/utils/common_utils.js
View file @
fe829def
...
...
@@ -132,21 +132,23 @@ export const parseUrlPathname = url => {
return
parsedUrl
.
pathname
.
charAt
(
0
)
===
'
/
'
?
parsedUrl
.
pathname
:
`/
${
parsedUrl
.
pathname
}
`
;
};
export
const
urlParamsToArray
=
(
path
=
''
)
=>
{
function
splitPath
(
path
)
{
return
path
.
slice
(
1
)
// Remove the first character of search as it is always ?
.
split
(
'
&
'
)
.
filter
(
param
=>
param
.
length
>
0
)
.
map
(
param
=>
{
const
split
=
param
.
split
(
'
=
'
);
return
[
decodeURI
(
split
[
0
]),
split
[
1
]].
join
(
'
=
'
);
});
};
.
replace
(
/^
\?
/
,
''
)
.
split
(
'
&
'
);
}
export
const
urlParamsToArray
=
(
path
=
''
)
=>
splitPath
(
path
)
.
filter
(
param
=>
param
.
length
>
0
)
.
map
(
param
=>
{
const
split
=
param
.
split
(
'
=
'
);
return
[
decodeURI
(
split
[
0
]),
split
[
1
]].
join
(
'
=
'
);
});
export
const
getUrlParamsArray
=
()
=>
urlParamsToArray
(
window
.
location
.
search
);
export
const
urlParamsToObject
=
(
path
=
''
)
=>
{
return
path
.
split
(
'
&
'
)
.
reduce
((
dataParam
,
filterParam
)
=>
{
export
const
urlParamsToObject
=
(
path
=
''
)
=>
splitPath
(
path
)
.
reduce
((
dataParam
,
filterParam
)
=>
{
if
(
filterParam
===
''
)
return
dataParam
;
const
data
=
dataParam
;
...
...
@@ -167,7 +169,6 @@ export const urlParamsToObject = (path = '') => {
return
data
;
},
{});
};
export
const
isMetaKey
=
e
=>
e
.
metaKey
||
e
.
ctrlKey
||
e
.
altKey
||
e
.
shiftKey
;
...
...
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