Skip to content

Commit

Permalink
* fixed possible bug
Browse files Browse the repository at this point in the history
* shorter syntax
  • Loading branch information
delfimov committed Mar 22, 2017
1 parent 9f8748b commit f8dd780
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ var cookie = {
},

get: function(k) {
var v = '';
var ke = k+ '=';
var c = document.cookie.split(';');
var v = '',
ke = k+ '=',
c = document.cookie.split(';');
for (var i = 0, l = c.length; i < l; i++) {
while (c[i].charAt(0) === ' ') {
c[i] = c[i].substring(1);
Expand All @@ -43,15 +43,15 @@ var cookie = {
cookie.set(k, '', -1);
},

isEnabled: function() {
var e = (navigator.cookieEnabled) ? true : false;
var t = '_test';
if (typeof navigator.cookieEnabled == "undefined" && !e) {
cookie.set(t, t);
var e = (cookie.get(t) === t) ? true : false;
cookie.remove(t);
}
return e;
}
isEnabled: function() {
var e = !!(navigator.cookieEnabled),
t = '_test';
if (typeof navigator.cookieEnabled == 'undefined' && !e) {
cookie.set(t, t);
e = (cookie.get(t) === t);
cookie.remove(t);
}
return e;
}

};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": {
"email": "elfimov@gmail.com",
"name": "Dmitry Elfimov",
"url": "http://www.elfimov.ru/"
"url": "https://www.elfimov.ru/"
},
"bugs": {
"url": "https://github.com/Groozly/JS-Cookie/issues"
Expand Down

0 comments on commit f8dd780

Please sign in to comment.