Comparing version
@@ -1,2 +0,2 @@ | ||
/*! js-cookie v3.0.0-beta.2 | MIT */ | ||
/*! js-cookie v3.0.0-beta.3 | MIT */ | ||
; | ||
@@ -111,23 +111,27 @@ (function (global, factory) { | ||
return { | ||
set: set, | ||
get: get, | ||
remove: function (key, attributes) { | ||
set( | ||
key, | ||
'', | ||
assign({}, attributes, { | ||
expires: -1 | ||
}) | ||
); | ||
return Object.create( | ||
{ | ||
set: set, | ||
get: get, | ||
remove: function (key, attributes) { | ||
set( | ||
key, | ||
'', | ||
assign({}, attributes, { | ||
expires: -1 | ||
}) | ||
); | ||
}, | ||
withAttributes: function (attributes) { | ||
return init(this.converter, assign({}, this.attributes, attributes)) | ||
}, | ||
withConverter: function (converter) { | ||
return init(assign({}, this.converter, converter), this.attributes) | ||
} | ||
}, | ||
withAttributes: function (attributes) { | ||
return init(this.converter, assign({}, this.attributes, attributes)) | ||
}, | ||
withConverter: function (converter) { | ||
return init(assign({}, this.converter, converter), this.attributes) | ||
}, | ||
attributes: Object.freeze(defaultAttributes), | ||
converter: Object.freeze(converter) | ||
} | ||
{ | ||
attributes: { value: Object.freeze(defaultAttributes) }, | ||
converter: { value: Object.freeze(converter) } | ||
} | ||
) | ||
} | ||
@@ -134,0 +138,0 @@ |
@@ -1,2 +0,2 @@ | ||
/*! js-cookie v3.0.0-beta.2 | MIT */ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,r=e.Cookies=t();r.noConflict=function(){return e.Cookies=n,r}}())}(this,function(){"use strict";var e={read:function(e){return e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}return function n(r,o){function i(e,n,i){if("undefined"!=typeof document){"number"==typeof(i=t({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),n=r.write(n,e),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=e+"="+n+c}}return{set:i,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],o={},i=0;i<n.length;i++){var c=n[i].split("="),u=c.slice(1).join("=");'"'===u[0]&&(u=u.slice(1,-1));try{var f=e.read(c[0]);if(o[f]=r.read(u,f),t===f)break}catch(e){}}return t?o[t]:o}},remove:function(e,n){i(e,"",t({},n,{expires:-1}))},withAttributes:function(e){return n(this.converter,t({},this.attributes,e))},withConverter:function(e){return n(t({},this.converter,e),this.attributes)},attributes:Object.freeze(o),converter:Object.freeze(r)}}(e,{path:"/"})}); | ||
/*! js-cookie v3.0.0-beta.3 | MIT */ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,r=e.Cookies=t();r.noConflict=function(){return e.Cookies=n,r}}())}(this,function(){"use strict";var e={read:function(e){return e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function t(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}return function n(r,o){function i(e,n,i){if("undefined"!=typeof document){"number"==typeof(i=t({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),n=r.write(n,e),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=e+"="+n+c}}return Object.create({set:i,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var n=document.cookie?document.cookie.split("; "):[],o={},i=0;i<n.length;i++){var c=n[i].split("="),u=c.slice(1).join("=");'"'===u[0]&&(u=u.slice(1,-1));try{var f=e.read(c[0]);if(o[f]=r.read(u,f),t===f)break}catch(e){}}return t?o[t]:o}},remove:function(e,n){i(e,"",t({},n,{expires:-1}))},withAttributes:function(e){return n(this.converter,t({},this.attributes,e))},withConverter:function(e){return n(t({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(r)}})}(e,{path:"/"})}); |
{ | ||
"name": "js-cookie", | ||
"version": "3.0.0-beta.2", | ||
"version": "3.0.0-beta.3", | ||
"description": "A simple, lightweight JavaScript API for handling cookies", | ||
@@ -31,2 +31,3 @@ "browser": "dist/js.cookie.js", | ||
"files": [ | ||
"index.js", | ||
"dist/**/*" | ||
@@ -33,0 +34,0 @@ ], |
@@ -80,6 +80,2 @@ <p align="center"> | ||
**Never include the source directly from GitHub (http://raw.github.com/...).** The file | ||
is being served as text/plain and as such may be blocked because of the wrong MIME type. | ||
Bottom line: GitHub is not a CDN. | ||
## ES Module | ||
@@ -86,0 +82,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26977
0.44%8
14.29%245
3.81%365
-1.08%