vuex-cache
Advanced tools
Comparing version 3.1.1 to 3.2.0
# CHANGELOG | ||
## 3.2.0 | ||
- Upgrade devDependencies. | ||
## 3.1.1 | ||
@@ -4,0 +8,0 @@ |
@@ -1,6 +0,1 @@ | ||
/*! | ||
* vuex-cache v3.1.1 | ||
* (c) superwf@gmail.com | ||
* Released under the MIT License. | ||
*/ | ||
/** | ||
@@ -7,0 +2,0 @@ * Check if value is an object. |
@@ -1,6 +0,1 @@ | ||
/*! | ||
* vuex-cache v3.1.1 | ||
* (c) superwf@gmail.com | ||
* Released under the MIT License. | ||
*/ | ||
'use strict'; | ||
@@ -7,0 +2,0 @@ |
@@ -1,6 +0,1 @@ | ||
/*! | ||
* vuex-cache v3.1.1 | ||
* (c) superwf@gmail.com | ||
* Released under the MIT License. | ||
*/ | ||
(function (global, factory) { | ||
@@ -10,3 +5,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
(global = global || self, factory(global.VuexCache = {})); | ||
}(this, function (exports) { 'use strict'; | ||
}(this, (function (exports) { 'use strict'; | ||
@@ -264,3 +259,3 @@ /** | ||
if (process.env.NODE_ENV !== 'production' && !module) { | ||
if ( !module) { | ||
console.error(("[vuex-cache] module namespace not found in " + helper + "(): " + namespace)); | ||
@@ -363,2 +358,2 @@ } | ||
})); | ||
}))); |
@@ -1,7 +0,2 @@ | ||
/*! | ||
* vuex-cache v3.1.1 | ||
* (c) superwf@gmail.com | ||
* Released under the MIT License. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).VuexCache={})}(this,function(e){"use strict";var t,n=function(e){return!!e&&"object"==typeof e},r=new Error("Can't generate key from parameters."),a=function(e){try{var t=function(e){return n(e[0])?[e[0].type,e[0],e[1]]:e}(e),a=t[0],c=t[1];return a+":"+(n(o=c)?JSON.stringify(o):String(o))}catch(e){return r}var o},c=function(e){return n(e)&&"number"==typeof e.timeout},o=function(e){return!!e&&Date.now()>e},u=new Map,i=function(e,t){var i={dispatch:function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];var f=a(n);if(f===r)return e.dispatch.apply(e,n);var p=u.get(f)||{},l=p.value,s=p.expiresIn;if(l&&!o(s))return l;var h=function(e,t){var n="string"==typeof e[0]?e[2]:e[0];return c(n)?n.timeout:c(t)?t.timeout:0}(n,t),v={expiresIn:h?Date.now()+h:void 0,value:e.dispatch.apply(e,n)};return u.set(f,v),v.value.catch(function(e){return u.delete(f),Promise.reject(e)})},has:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var c=a(e);if(c===r)return!1;var i=u.get(c);return n(i)&&!o(i.expiresIn)},clear:function(){return u.clear()},delete:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=a(e);return n!==r&&u.delete(n)}};for(var p in Object.defineProperty(e,"cache",{value:i,writable:!1,enumerable:!0,configurable:!1}),e._modulesNamespaceMap){var l=f(e,"mapCacheActions",p);Object.defineProperty(l.context,"cache",{value:i,writable:!1,enumerable:!0,configurable:!1})}},f=function(e,t,n){var r=e._modulesNamespaceMap[n];return"production"===process.env.NODE_ENV||r||console.error("[vuex-cache] module namespace not found in "+t+"(): "+n),r},p=(t=function(e,t){var n,r={};return(n=t,Array.isArray(n)?n.map(function(e){return{key:e,val:e}}):Object.keys(n).map(function(e){return{key:e,val:n[e]}})).forEach(function(t){var n=t.key,a=t.val;r[n]=function(){for(var t=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];var c=this.$store.cache.dispatch;if(e){var o=f(this.$store,"mapCacheActions",e);if(!o)return;c="function"==typeof a?function(n){for(var r,a=[],c=arguments.length-1;c-- >0;)a[c]=arguments[c+1];(r=o.context.cache.dispatch).call.apply(r,[t.$store.cache,""+e+n].concat(a))}:o.context.cache.dispatch}return"function"==typeof a?a.call.apply(a,[this,c].concat(n)):c.call.apply(c,[this.$store.cache,""+e+a].concat(n))}}),r},function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)});e.cacheAction=function(e,t){return function(n,r){return i(n,t),e.call(this,n,r)}},e.default=function(e){return function(t){return i(t,e)}},e.mapCacheActions=p,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).VuexCache={})}(this,(function(e){"use strict";var t,n=function(e){return!!e&&"object"==typeof e},r=new Error("Can't generate key from parameters."),a=function(e){try{var t=function(e){return n(e[0])?[e[0].type,e[0],e[1]]:e}(e),a=t[0],c=t[1];return a+":"+(n(o=c)?JSON.stringify(o):String(o))}catch(e){return r}var o},c=function(e){return n(e)&&"number"==typeof e.timeout},o=function(e,t){var n="string"==typeof e[0]?e[2]:e[0];return c(n)?n.timeout:c(t)?t.timeout:0},i=function(e){return!!e&&Date.now()>e},u=new Map,f=function(e,t){var c={dispatch:function(){for(var n=[],c=arguments.length;c--;)n[c]=arguments[c];var f=a(n);if(f===r)return e.dispatch.apply(e,n);var p=u.get(f)||{},l=p.value,s=p.expiresIn;if(l&&!i(s))return l;var h=o(n,t),v={expiresIn:h?Date.now()+h:void 0,value:e.dispatch.apply(e,n)};return u.set(f,v),v.value.catch((function(e){return u.delete(f),Promise.reject(e)}))},has:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var c=a(e);if(c===r)return!1;var o=u.get(c);return n(o)&&!i(o.expiresIn)},clear:function(){return u.clear()},delete:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=a(e);return n!==r&&u.delete(n)}};for(var f in Object.defineProperty(e,"cache",{value:c,writable:!1,enumerable:!0,configurable:!1}),e._modulesNamespaceMap){var l=p(e,"mapCacheActions",f);Object.defineProperty(l.context,"cache",{value:c,writable:!1,enumerable:!0,configurable:!1})}},p=function(e,t,n){return e._modulesNamespaceMap[n]},l=(t=function(e,t){var n,r={};return(n=t,Array.isArray(n)?n.map((function(e){return{key:e,val:e}})):Object.keys(n).map((function(e){return{key:e,val:n[e]}}))).forEach((function(t){var n=t.key,a=t.val;r[n]=function(){for(var t=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];var c=this.$store.cache.dispatch;if(e){var o=p(this.$store,"mapCacheActions",e);if(!o)return;c="function"==typeof a?function(n){for(var r,a=[],c=arguments.length-1;c-- >0;)a[c]=arguments[c+1];(r=o.context.cache.dispatch).call.apply(r,[t.$store.cache,""+e+n].concat(a))}:o.context.cache.dispatch}return"function"==typeof a?a.call.apply(a,[this,c].concat(n)):c.call.apply(c,[this.$store.cache,""+e+a].concat(n))}})),r},function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)});e.cacheAction=function(e,t){return function(n,r){return f(n,t),e.call(this,n,r)}},e.default=function(e){return function(t){return f(t,e)}},e.mapCacheActions=l,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=vuex-cache.umd.min.js.map |
{ | ||
"name": "vuex-cache", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "Cache dispatched actions and prevent repeated requests and heavy actions.", | ||
@@ -31,4 +31,4 @@ "cdn": "dist/vuex-cache.umd.min.js", | ||
"lint": "eslint src/vuex-cache.js", | ||
"build": "bili src/vuex-cache.js --format es,cjs,umd,umd-min --module-name VuexCache --minimal --banner", | ||
"prepublish": "yarn lint && yarn build && yarn cover" | ||
"build": "bili src/vuex-cache.js --format es,cjs,umd,umd-min --module-name VuexCache --minimal", | ||
"prepublishOnly": "yarn lint && yarn build && yarn cover" | ||
}, | ||
@@ -42,23 +42,23 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "^7.4.3", | ||
"@babel/plugin-transform-runtime": "^7.4.3", | ||
"@babel/preset-env": "^7.4.3", | ||
"@babel/runtime": "^7.4.3", | ||
"@babel/core": "^7.9.6", | ||
"@babel/plugin-transform-runtime": "^7.9.6", | ||
"@babel/preset-env": "^7.9.6", | ||
"@babel/runtime": "^7.9.6", | ||
"babel-core": "^6.26.3", | ||
"babel-eslint": "^10.0.1", | ||
"babel-jest": "^24.7.1", | ||
"bili": "^4.7.3", | ||
"eslint": "^5.16.0", | ||
"eslint-config-prettier": "^4.1.0", | ||
"eslint-config-standard": "^12.0.0", | ||
"eslint-plugin-import": "^2.16.0", | ||
"eslint-plugin-jest": "^22.4.1", | ||
"eslint-plugin-node": "^8.0.1", | ||
"eslint-plugin-prettier": "^3.0.1", | ||
"eslint-plugin-promise": "^4.1.1", | ||
"eslint-plugin-standard": "^4.0.0", | ||
"jest": "^24.7.1", | ||
"prettier": "^1.16.4", | ||
"vue": "^2.6.10", | ||
"vuex": "^3.1.0" | ||
"babel-eslint": "^10.1.0", | ||
"babel-jest": "^26.0.1", | ||
"bili": "^4.10.0", | ||
"eslint": "^7.0.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-config-standard": "^14.1.1", | ||
"eslint-plugin-import": "^2.20.2", | ||
"eslint-plugin-jest": "^23.11.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^4.0.1", | ||
"jest": "^26.0.1", | ||
"prettier": "^2.0.5", | ||
"vue": "^2.6.11", | ||
"vuex": "^3.4.0" | ||
}, | ||
@@ -65,0 +65,0 @@ "jest": { |
@@ -0,0 +0,0 @@ # vuex-cache |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62231
971