File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -3,20 +3,21 @@ function parseQueryString(queryString) {
33 const queryParams = { } ;
44 if ( ! queryString ) return queryParams ;
55
6- const keyValuePairs = queryString . split ( "&" ) ;
6+ const keyValuePairs = queryString . split ( "&" ) ;
77
8- for ( const pair of keyValuePairs ) {
9- const index = pair . indexOf ( "=" ) ;
10- if ( index === - 1 ) {
8+ for ( const pair of keyValuePairs ) {
9+ const index = pair . indexOf ( "=" ) ;
10+ if ( index === - 1 ) {
1111 queryParams [ decodeURIComponent ( pair ) ] = undefined
12- } else {
13- const key = pair . slice ( 0 , index ) ;
14- const value = pair . slice ( index + 1 ) ;
12+ } else {
13+ const key = decodeURIComponent ( pair . slice ( 0 , index ) ) ;
14+ const value = decodeURIComponent ( pair . slice ( index + 1 ) ) ;
1515 queryParams [ key ] = value ;
16- }
17- return queryParams ;
16+ }
17+
18+ return queryParams ;
1819
19- }
20+ }
2021}
2122
2223 module . exports = parseQueryString ;
You can’t perform that action at this time.
0 commit comments