We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 577ae89 commit 99caad7Copy full SHA for 99caad7
Sprint-2/implement/querystring.js
@@ -3,14 +3,30 @@ function parseQueryString(queryString) {
3
if (queryString.length === 0) {
4
return queryParams;
5
}
6
+
7
const keyValuePairs = queryString.split("&");
8
9
for (const pair of keyValuePairs) {
- const [key, value] = pair.split("=");
10
- queryParams[key] = value;
+ if(pair===""){
11
+ continue
12
+ }
13
+ const equalIndex=pair.indexOf("=")
14
+ if (equalIndex === -1) {
15
+ queryParams[pair]="";
16
17
18
+ const key=pair.substring(0,equalIndex)
19
+ const value=pair.substring(equalIndex+1)
20
+ queryParams[key]=value
21
22
23
24
25
26
+//console.log(parseQueryString("equationxy+1"));
27
28
module.exports = parseQueryString;
29
30
31
32
0 commit comments