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 753715b commit b426391Copy full SHA for b426391
1 file changed
lib/parse.js
@@ -13,17 +13,17 @@ function parse(input) {
13
return result;
14
}
15
16
+ const inputLength = input.length;
17
let key = "";
18
let value = "";
19
let startingIndex = -1;
20
let equalityIndex = -1;
21
let shouldDecode = false;
22
let hasPlus = false;
- const lastIndex = input.length;
23
24
// Have a boundary of input.length + 1 to access last pair inside the loop.
25
- for (let i = 0; i < lastIndex + 1; i++) {
26
- let c = (i !== lastIndex && input.charCodeAt(i)) || -1;
+ for (let i = 0; i < inputLength + 1; i++) {
+ let c = (i !== inputLength && input.charCodeAt(i)) || -1;
27
28
// Handle '&' and end of line to pass the current values to result
29
if (c === 38 || c === -1) {
0 commit comments