File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -7,26 +7,20 @@ function parseQueryString(queryString) {
77 const keyValuePairs = queryString . split ( "&" ) ;
88
99 for ( const pair of keyValuePairs ) {
10- if ( pair === "" ) {
11- continue
10+ if ( ! pair ) {
11+ continue ;
1212 }
13- const equalIndex = pair . indexOf ( "=" )
13+ const equalIndex = pair . indexOf ( "=" ) ;
1414 if ( equalIndex === - 1 ) {
15- queryParams [ pair ] = "" ;
16- continue
15+ queryParams [ pair ] = "" ;
16+ continue ;
1717 }
18- const key = pair . substring ( 0 , equalIndex )
19- const value = pair . substring ( equalIndex + 1 )
20- queryParams [ key ] = value
21-
18+ const key = pair . substring ( 0 , equalIndex ) ;
19+ const value = pair . substring ( equalIndex + 1 ) ;
20+ queryParams [ key ] = value ;
2221 }
2322
2423 return queryParams ;
2524}
26- //console.log(parseQueryString("equationxy+1"));
2725
2826module . exports = parseQueryString ;
29-
30-
31-
32-
You can’t perform that action at this time.
0 commit comments