We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4355969 commit f9dfd57Copy full SHA for f9dfd57
1 file changed
modules/RouteNode.js
@@ -4,12 +4,16 @@ let isSerialisable = val => val !== undefined && val !== null && val !== ''
4
5
let removeQueryParamsFromPath = (path, params) => {
6
if (path.indexOf('?') === -1) return path
7
- let [pathPart, searchPart] = path.split('?')
+ const splitPath = path.split('?')
8
+ const pathPart = splitPath[0]
9
+ const searchPart = splitPath[1]
10
11
let remainingSearchParams = searchPart
12
.split('&')
13
.reduce((obj, p) => {
- let [key, val] = p.split('=')
14
+ const splitParam = p.split('=')
15
+ const key = splitParam[0]
16
+ const val = splitParam[1]
17
if (params.indexOf(key) === -1) obj[key] = val || ''
18
return obj
19
}, {})
0 commit comments