Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,13 +136,11 @@ exports.parseCookie = function(str){ | |
, key = pair.substr(0, eqlIndex).trim().toLowerCase() | ||
, val = pair.substr(++eqlIndex, pair.length).trim(); | ||
|
||
// Quoted values | ||
if (val[0] === '"') { | ||
val = val.slice(1, -1); | ||
} | ||
// quoted values | ||
if ('"' == val[0]) val = val.slice(1, -1); | ||
|
||
// Only assign once | ||
if (obj[key] === undefined) { | ||
// only assign once | ||
if (undefined == obj[key]) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tj
Author
Member
|
||
val = val.replace(/\+/g, ' '); | ||
This comment has been minimized.
Sorry, something went wrong.
Halicea
|
||
try { | ||
obj[key] = decodeURIComponent(val); | ||
|
i've seen this style elsewhere too (
undefined == variable
). wondering what the motivation is... why notvariable == undefined
?