Skip to content

Commit 0790074

Browse files
committed
Remove unnecessary assignment
Reduces size a little further..
1 parent f06749c commit 0790074

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/api.mjs

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ function init (converter, defaultAttributes) {
2121
.replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)
2222
.replace(/[()]/g, escape)
2323

24-
value = converter.write(value, key)
25-
2624
var stringifiedAttributes = ''
2725
for (var attributeName in attributes) {
2826
if (!attributes[attributeName]) {
@@ -45,7 +43,8 @@ function init (converter, defaultAttributes) {
4543
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]
4644
}
4745

48-
return (document.cookie = key + '=' + value + stringifiedAttributes)
46+
return (document.cookie =
47+
key + '=' + converter.write(value, key) + stringifiedAttributes)
4948
}
5049

5150
function get (key) {

0 commit comments

Comments
 (0)