timed-cache
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -1,1 +0,1 @@ | ||
!function(t,e){if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof module&&module.exports)module.exports=e();else{var n=this,o=e(),i=n[t];o.noConflict=function(){return n[t]=i,o},n[t]=o}}("Cache",function(){var u={},t=function(t){this.defaultTtl=t&&t.defaultTtl?t.defaultTtl:6e4,this.prefix="__cache__"},c=function(t){return"string"!=typeof t?this.prefix+JSON.stringify(t):this.prefix+t};return t.prototype.put=function(t,e,n){var o=(n?n.ttl:void 0)||this.defaultTtl,i=(n?n.callback:void 0)||function(){},r=c(t),a=this,l=u[r];l&&clearTimeout(l.handle);var f=setTimeout(function(){a.remove(t)},o);u[r]={handle:f,data:e,callback:i}},t.prototype.get=function(t){var e=u[c(t)];return e&&e.data},t.prototype.remove=function(t){var e=c(t),n=u[e];n&&(clearTimeout(n.handle),delete u[e],n.callback(t,n.data))},t.prototype.clear=function(){for(var t in u)n=t,null!==(e=u)&&Object.prototype.hasOwnProperty.call(e,n)&&clearTimeout(u[t].handle);var e,n;u={}},t.prototype.size=function(){return Object.keys(u).length},t}); | ||
!function(t,e){if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof module&&module.exports)module.exports=e();else{var n=this,o=e(),i=n[t];o.noConflict=function(){return n[t]=i,o},n[t]=o}}("Cache",function(){function t(t){this.defaultTtl=t&&t.defaultTtl?t.defaultTtl:6e4,this.prefix="__cache__"}function u(t){return"string"!=typeof t?this.prefix+JSON.stringify(t):this.prefix+t}var c={};return t.prototype.put=function(t,e,n){var o=(n?n.ttl:void 0)||this.defaultTtl,i=(n?n.callback:void 0)||function(){},r=u(t),a=this,l=c[r];l&&clearTimeout(l.handle);var f=setTimeout(function(){a.remove(t)},o);c[r]={handle:f,data:e,callback:i}},t.prototype.get=function(t){var e=c[u(t)];return e&&e.data},t.prototype.remove=function(t){var e=u(t),n=c[e];n&&(clearTimeout(n.handle),delete c[e],n.callback(t,n.data))},t.prototype.clear=function(){for(var t in c)n=t,null!==(e=c)&&Object.prototype.hasOwnProperty.call(e,n)&&clearTimeout(c[t].handle);var e,n;c={}},t.prototype.size=function(){return Object.keys(c).length},t}); |
{ | ||
"name": "timed-cache", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A minimalist time-based caching system.", | ||
@@ -26,3 +26,3 @@ "main": "cache.js", | ||
"devDependencies": { | ||
"expect": "^23.6.0", | ||
"expect": "^24.8.0", | ||
"grunt": "^1.0.3", | ||
@@ -34,3 +34,3 @@ "grunt-contrib-clean": "^2.0.0", | ||
"grunt-mocha-test": "^0.13.3", | ||
"load-grunt-tasks": "3.1.0", | ||
"load-grunt-tasks": "^5.0.0", | ||
"mocha": "^5.2.0", | ||
@@ -37,0 +37,0 @@ "time-grunt": "^1.4.0" |
@@ -14,3 +14,3 @@ <p align="center"> | ||
Current version: **1.1.1** | ||
Current version: **1.1.2** | ||
@@ -17,0 +17,0 @@ Lead Maintainer: [Halim Qarroum](mailto:hqm.post@gmail.com) |
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
18684