Skip to content

Commit

Permalink
Remove unnecessary assignment
Browse files Browse the repository at this point in the history
Reduces size a little further..
  • Loading branch information
carhartl committed Aug 18, 2021
1 parent f06749c commit 0790074
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ function init (converter, defaultAttributes) {
.replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
.replace(/[()]/g, escape)

value = converter.write(value, key)

var stringifiedAttributes = ''
for (var attributeName in attributes) {
if (!attributes[attributeName]) {
Expand All @@ -45,7 +43,8 @@ function init (converter, defaultAttributes) {
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]
}

return (document.cookie = key + '=' + value + stringifiedAttributes)
return (document.cookie =
key + '=' + converter.write(value, key) + stringifiedAttributes)
}

function get (key) {
Expand Down

0 comments on commit 0790074

Please sign in to comment.