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 04be428 commit 009b3cbCopy full SHA for 009b3cb
HISTORY.md
@@ -1,6 +1,7 @@
1
unreleased
2
==========
3
4
+ * pref: read value only when assigning in parse
5
* pref: remove unnecessary regexp in parse
6
7
0.4.1 / 2020-04-21
index.js
@@ -65,15 +65,16 @@ function parse(str, options) {
65
}
66
67
var key = pair.substring(0, index).trim()
68
- var val = pair.substring(index + 1, pair.length).trim()
69
-
70
- // quoted values
71
- if ('"' == val[0]) {
72
- val = val.slice(1, -1);
73
- }
74
75
// only assign once
76
if (undefined == obj[key]) {
+ var val = pair.substring(index + 1, pair.length).trim()
+
+ // quoted values
+ if (val[0] === '"') {
+ val = val.slice(1, -1)
+ }
77
78
obj[key] = tryDecode(val, dec);
79
80
0 commit comments