diff --git a/dist/jquery-ajax-cache.js b/dist/jquery-ajax-cache.js index 53dfb9e..352c992 100644 --- a/dist/jquery-ajax-cache.js +++ b/dist/jquery-ajax-cache.js @@ -639,11 +639,11 @@ return /******/ (function(modules) { // webpackBootstrap var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! web-storage-cache -- Added `expires` attribute and serialize data with `JSON.parse` for the localStorage and sessionStorage. - Version 0.0.3 + Version 1.0.1 https://github.com/WQTeam/web-storage-cache - (c) 2013-2015 WQTeam, MIT license + (c) 2013-2016 WQTeam, MIT license */ - !function(a,b){ true?!(__WEBPACK_AMD_DEFINE_FACTORY__ = (b), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):"object"==typeof exports?module.exports=b():a.WebStorageCache=b()}(this,function(){"use strict";function a(a,b){for(var c in b)a[c]=b[c];return a}function b(a){var b=!1;if(a&&a.setItem){b=!0;var c="__"+Math.round(1e7*Math.random());try{a.setItem(c,c),a.removeItem(c)}catch(d){b=!1}}return b}function c(a){var b=typeof a;return"string"===b?window[a]:a}function d(a){return"[object Date]"===Object.prototype.toString.call(a)&&!isNaN(a.getTime())}function e(a,b){if(b=b||new Date,"number"==typeof a?a=a===1/0?l:new Date(b.getTime()+1e3*a):"string"==typeof a&&(a=new Date(a)),a&&!d(a))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return a}function f(a){var b=!1;if(a)if(a.code)switch(a.code){case 22:b=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===a.name&&(b=!0)}else-2147024882===a.number&&(b=!0);return b}function g(a,b){this.c=(new Date).getTime(),b=b||l;var c=e(b);this.e=c.getTime(),this.v=a}function h(a){return a&&"c"in a&&"e"in a&&"v"in a?!0:!1}function i(a){var b=(new Date).getTime();return bd;d++){var e=this.storage.key(d),f=null;try{f=m.deserialize(this.storage.getItem(e))}catch(g){}if(null!==f&&void 0!==f.e){var h=(new Date).getTime();h>=f.e&&b.push(e)}}return b.forEach(function(a){c["delete"](a)}),b},clear:function(){this.storage.clear()},add:function(b,c,d){b=j(b),d=a({force:!0},d);try{var e=m.deserialize(this.storage.getItem(b));if(!h(e)||!i(e))return this.set(b,c,d),!0}catch(f){return this.set(b,c,d),!0}return!1},replace:function(a,b,c){a=j(a);var d=null;try{d=m.deserialize(this.storage.getItem(a))}catch(e){return!1}if(h(d)){if(i(d))return this.set(a,b,c),!0;this["delete"](a)}return!1},touch:function(a,b){a=j(a);var c=(this.storage.getItem(a),null);try{c=m.deserialize(this.storage.getItem(a))}catch(d){return!1}if(h(c)){if(i(c))return this.set(a,this.get(a),{exp:b}),!0;this["delete"](a)}return!1}};return k.prototype=o,k}); + !function(a,b){ true?!(__WEBPACK_AMD_DEFINE_FACTORY__ = (b), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):"object"==typeof exports?module.exports=b():a.WebStorageCache=b()}(this,function(){"use strict";function a(a,b){for(var c in b)a[c]=b[c];return a}function b(a){var b=!1;if(a&&a.setItem){b=!0;var c="__"+Math.round(1e7*Math.random());try{a.setItem(c,c),a.removeItem(c)}catch(d){b=!1}}return b}function c(a){var b=typeof a;return"string"===b&&window[a]instanceof Storage?window[a]:a}function d(a){return"[object Date]"===Object.prototype.toString.call(a)&&!isNaN(a.getTime())}function e(a,b){if(b=b||new Date,"number"==typeof a?a=a===1/0?l:new Date(b.getTime()+1e3*a):"string"==typeof a&&(a=new Date(a)),a&&!d(a))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return a}function f(a){var b=!1;if(a)if(a.code)switch(a.code){case 22:b=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===a.name&&(b=!0)}else-2147024882===a.number&&(b=!0);return b}function g(a,b){this.c=(new Date).getTime(),b=b||l;var c=e(b);this.e=c.getTime(),this.v=a}function h(a){return"object"!=typeof a?!1:a&&"c"in a&&"e"in a&&"v"in a?!0:!1}function i(a){var b=(new Date).getTime();return bd;d++){var e=this.storage.key(d),f=null;try{f=m.deserialize(this.storage.getItem(e))}catch(g){}if(null!==f&&void 0!==f.e){var h=(new Date).getTime();h>=f.e&&b.push(e)}}return b.forEach(function(a){c["delete"](a)}),b},clear:function(){this.storage.clear()},add:function(b,c,d){b=j(b),d=a({force:!0},d);try{var e=m.deserialize(this.storage.getItem(b));if(!h(e)||!i(e))return this.set(b,c,d),!0}catch(f){return this.set(b,c,d),!0}return!1},replace:function(a,b,c){a=j(a);var d=null;try{d=m.deserialize(this.storage.getItem(a))}catch(e){return!1}if(h(d)){if(i(d))return this.set(a,b,c),!0;this["delete"](a)}return!1},touch:function(a,b){a=j(a);var c=null;try{c=m.deserialize(this.storage.getItem(a))}catch(d){return!1}if(h(c)){if(i(c))return this.set(a,this.get(a),{exp:b}),!0;this["delete"](a)}return!1}};return k.prototype=o,k}); /***/ } /******/ ]) diff --git a/dist/jquery-ajax-cache.min.js b/dist/jquery-ajax-cache.min.js index a057091..dcd993f 100644 --- a/dist/jquery-ajax-cache.min.js +++ b/dist/jquery-ajax-cache.min.js @@ -5,4 +5,4 @@ * (c) 2013-2015 WQTeam, MIT license * */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.$ajaxCache=t():e.$ajaxCache=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var n=r(1);e.exports=new n.AjaxCache},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r>16)+(t>>16)+(r>>16);return n<<16|65535&r}function i(e,t){return e<>>32-t}function c(e,t,r,n,o,c){return a(i(a(a(t,e),a(n,c)),o),r)}function u(e,t,r,n,o,a,i){return c(t&r|~t&n,e,t,o,a,i)}function s(e,t,r,n,o,a,i){return c(t&n|r&~n,e,t,o,a,i)}function f(e,t,r,n,o,a,i){return c(t^r^n,e,t,o,a,i)}function l(e,t,r,n,o,a,i){return c(r^(t|~n),e,t,o,a,i)}function h(e,t){e[t>>5]|=128<>>9<<4)+14]=t;var r,n,o,i,c,h=1732584193,d=-271733879,g=-1732584194,p=271733878;for(r=0;r>5]>>>t%32&255);return r}function g(e){var t,r=[];for(r[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<16&&(o=h(o,8*e.length)),r=0;16>r;r+=1)a[r]=909522486^o[r],i[r]=1549556828^o[r];return n=h(a.concat(g(t)),512+8*t.length),d(h(i.concat(n),640))}function y(e){var t,r,n="0123456789abcdef",o="";for(r=0;r>>4&15)+n.charAt(15&t);return o}function x(e){return unescape(encodeURIComponent(e))}function m(e){return p(x(e))}function C(e){return y(m(e))}function b(e,t){return v(x(e),x(t))}function w(e,t){return y(b(e,t))}function j(e,t,r){return t?r?b(t,e):w(t,e):r?m(e):C(e)}n=function(){return j}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))}(this)},function(e,t,r){var n,o;!function(a,i){n=i,o="function"==typeof n?n.call(t,r,t,e):n,!(void 0!==o&&(e.exports=o))}(this,function(){"use strict";function e(e,t){for(var r in t)e[r]=t[r];return e}function t(e){var t=!1;if(e&&e.setItem){t=!0;var r="__"+Math.round(1e7*Math.random());try{e.setItem(r,r),e.removeItem(r)}catch(n){t=!1}}return t}function r(e){var t=typeof e;return"string"===t?window[e]:e}function n(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())}function o(e,t){if(t=t||new Date,"number"==typeof e?e=e===1/0?l:new Date(t.getTime()+1e3*e):"string"==typeof e&&(e=new Date(e)),e&&!n(e))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return e}function a(e){var t=!1;if(e)if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t}function i(e,t){this.c=(new Date).getTime(),t=t||l;var r=o(t);this.e=r.getTime(),this.v=e}function c(e){return e&&"c"in e&&"e"in e&&"v"in e?!0:!1}function u(e){var t=(new Date).getTime();return tn;n++){var o=this.storage.key(n),a=null;try{a=h.deserialize(this.storage.getItem(o))}catch(i){}if(null!==a&&void 0!==a.e){var c=(new Date).getTime();c>=a.e&&t.push(o)}}return t.forEach(function(e){r["delete"](e)}),t},clear:function(){this.storage.clear()},add:function(t,r,n){t=s(t),n=e({force:!0},n);try{var o=h.deserialize(this.storage.getItem(t));if(!c(o)||!u(o))return this.set(t,r,n),!0}catch(a){return this.set(t,r,n),!0}return!1},replace:function(e,t,r){e=s(e);var n=null;try{n=h.deserialize(this.storage.getItem(e))}catch(o){return!1}if(c(n)){if(u(n))return this.set(e,t,r),!0;this["delete"](e)}return!1},touch:function(e,t){e=s(e);var r=(this.storage.getItem(e),null);try{r=h.deserialize(this.storage.getItem(e))}catch(n){return!1}if(c(r)){if(u(r))return this.set(e,this.get(e),{exp:t}),!0;this["delete"](e)}return!1}};return f.prototype=g,f})}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.$ajaxCache=t():e.$ajaxCache=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var n=r(1);e.exports=new n.AjaxCache},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var r=0;r>16)+(t>>16)+(r>>16);return n<<16|65535&r}function i(e,t){return e<>>32-t}function c(e,t,r,n,o,c){return a(i(a(a(t,e),a(n,c)),o),r)}function u(e,t,r,n,o,a,i){return c(t&r|~t&n,e,t,o,a,i)}function s(e,t,r,n,o,a,i){return c(t&n|r&~n,e,t,o,a,i)}function f(e,t,r,n,o,a,i){return c(t^r^n,e,t,o,a,i)}function l(e,t,r,n,o,a,i){return c(r^(t|~n),e,t,o,a,i)}function h(e,t){e[t>>5]|=128<>>9<<4)+14]=t;var r,n,o,i,c,h=1732584193,d=-271733879,g=-1732584194,p=271733878;for(r=0;r>5]>>>t%32&255);return r}function g(e){var t,r=[];for(r[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<16&&(o=h(o,8*e.length)),r=0;16>r;r+=1)a[r]=909522486^o[r],i[r]=1549556828^o[r];return n=h(a.concat(g(t)),512+8*t.length),d(h(i.concat(n),640))}function y(e){var t,r,n="0123456789abcdef",o="";for(r=0;r>>4&15)+n.charAt(15&t);return o}function x(e){return unescape(encodeURIComponent(e))}function m(e){return p(x(e))}function C(e){return y(m(e))}function w(e,t){return v(x(e),x(t))}function b(e,t){return y(w(e,t))}function j(e,t,r){return t?r?w(t,e):b(t,e):r?m(e):C(e)}n=function(){return j}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))}(this)},function(e,t,r){var n,o;!function(a,i){n=i,o="function"==typeof n?n.call(t,r,t,e):n,!(void 0!==o&&(e.exports=o))}(this,function(){"use strict";function e(e,t){for(var r in t)e[r]=t[r];return e}function t(e){var t=!1;if(e&&e.setItem){t=!0;var r="__"+Math.round(1e7*Math.random());try{e.setItem(r,r),e.removeItem(r)}catch(n){t=!1}}return t}function r(e){var t=typeof e;return"string"===t&&window[e]instanceof Storage?window[e]:e}function n(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())}function o(e,t){if(t=t||new Date,"number"==typeof e?e=e===1/0?l:new Date(t.getTime()+1e3*e):"string"==typeof e&&(e=new Date(e)),e&&!n(e))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return e}function a(e){var t=!1;if(e)if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t}function i(e,t){this.c=(new Date).getTime(),t=t||l;var r=o(t);this.e=r.getTime(),this.v=e}function c(e){return"object"!=typeof e?!1:e&&"c"in e&&"e"in e&&"v"in e?!0:!1}function u(e){var t=(new Date).getTime();return tn;n++){var o=this.storage.key(n),a=null;try{a=h.deserialize(this.storage.getItem(o))}catch(i){}if(null!==a&&void 0!==a.e){var c=(new Date).getTime();c>=a.e&&t.push(o)}}return t.forEach(function(e){r["delete"](e)}),t},clear:function(){this.storage.clear()},add:function(t,r,n){t=s(t),n=e({force:!0},n);try{var o=h.deserialize(this.storage.getItem(t));if(!c(o)||!u(o))return this.set(t,r,n),!0}catch(a){return this.set(t,r,n),!0}return!1},replace:function(e,t,r){e=s(e);var n=null;try{n=h.deserialize(this.storage.getItem(e))}catch(o){return!1}if(c(n)){if(u(n))return this.set(e,t,r),!0;this["delete"](e)}return!1},touch:function(e,t){e=s(e);var r=null;try{r=h.deserialize(this.storage.getItem(e))}catch(n){return!1}if(c(r)){if(u(r))return this.set(e,this.get(e),{exp:t}),!0;this["delete"](e)}return!1}};return f.prototype=g,f})}])}); \ No newline at end of file diff --git a/package.json b/package.json index 0c0f8c6..319c063 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "license": "MIT", "author": "wuchangming", "description": "Ajax Cache plugin backed by localStorage or sessionStorage for jQuery", - "version": "2.0.0", + "version": "2.0.1", "repository": { "type": "git", "url": "https://github.com/WQTeam/jquery-ajax-cache" @@ -26,7 +26,7 @@ "mocha": "^2.3.4", "sinon": "^1.17.2", "sinon-chai": "^2.8.0", - "web-storage-cache": "^0.0.3", + "web-storage-cache": "1.0.1", "webpack": "^1.12.9" } }