Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cto
g1
Commits
122ba198
Commit
122ba198
authored
Apr 15, 2018
by
S Anand
Browse files
ENH: FormHandler namespaces. Fixes
#28
parent
8258e5ab
Pipeline
#46203
passed with stage
in 2 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/url.js
View file @
122ba198
...
...
@@ -256,3 +256,21 @@ export function update(args, mode) {
self
.
search
=
qparts
.
join
(
'
&
'
)
return
self
}
export
function
namespace
(
search
,
name
)
{
// Return an object with all keys in search that begin with `<name>:` or
// do not have a `:` in them.
// If name is false-y, return search
if
(
!
name
)
return
search
var
result
=
{}
for
(
var
key
in
search
)
{
var
parts
=
key
.
split
(
'
:
'
)
if
(
parts
.
length
==
1
)
result
[
parts
[
0
]]
=
search
[
key
]
else
if
(
parts
[
0
]
===
name
)
result
[
parts
[
1
]]
=
search
[
key
]
}
return
result
}
Tejesh
🖖
@tejesh.p
mentioned in commit
a2354ba8
·
May 24, 2018
mentioned in commit
a2354ba8
mentioned in commit a2354ba8606bda2d2da7842432b0f8c14722e352
Toggle commit list
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