Skip to content

Commit

Permalink
Make use of chaining for string wrangling
Browse files Browse the repository at this point in the history
  • Loading branch information
carhartl committed Feb 16, 2018
1 parent 6e42d24 commit d53efd3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js.cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
value = converter.write(value, key);
}

key = encodeURIComponent(String(key));
key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent);
key = key.replace(/[\(\)]/g, escape);
key = encodeURIComponent(String(key))
.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
.replace(/[\(\)]/g, escape);

var stringifiedAttributes = '';
for (var attributeName in attributes) {
Expand Down

0 comments on commit d53efd3

Please sign in to comment.