Skip to content

Commit

Permalink
Improve testing if cookie has been found before
Browse files Browse the repository at this point in the history
E.g. allow falsy values returned by a custom decoder.
  • Loading branch information
carhartl committed Jun 24, 2023
1 parent aecb4b3 commit b754561
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ function init(converter, defaultAttributes) {

try {
var found = decodeURIComponent(parts[0])
if (!jar[found]) jar[found] = converter.read(value, found)

if (!(found in jar)) jar[found] = converter.read(value, found)
if (name === found) {
break
}
Expand Down

0 comments on commit b754561

Please sign in to comment.