sequelize-simple-cache
Advanced tools
Comparing version 1.0.0-beta.8 to 1.0.0-beta.9
{ | ||
"name": "sequelize-simple-cache", | ||
"version": "1.0.0-beta.8", | ||
"version": "1.0.0-beta.9", | ||
"description": "A simple, transparent, client-side, in-memory cache for Sequelize", | ||
@@ -5,0 +5,0 @@ "main": "src/SequelizeSimpleCache.js", |
@@ -16,4 +16,8 @@ const md5 = require('md5'); | ||
}), {}); | ||
const { debug = false } = options; | ||
const { | ||
debug = false, // eslint-disable-next-line no-console | ||
delegate = (event, details) => console.debug(`CACHE ${event.toUpperCase()}`, details), | ||
} = options; | ||
this.debug = debug; | ||
this.delegate = delegate; | ||
this.cache = new Map(); | ||
@@ -105,6 +109,6 @@ this.stats = { hit: 0, miss: 0, load: 0 }; | ||
log(tag, details) { | ||
log(event, details) { | ||
// stats | ||
if (['hit', 'miss', 'load'].includes(tag)) { | ||
this.stats[tag] += 1; | ||
if (['hit', 'miss', 'load'].includes(event)) { | ||
this.stats[event] += 1; | ||
} | ||
@@ -123,3 +127,3 @@ // debug logging | ||
out.size = this.cache.size; | ||
console.debug(`>>> CACHE ${tag.toUpperCase()} >>>`, out); // eslint-disable-line no-console | ||
this.delegate(event, out); | ||
} | ||
@@ -126,0 +130,0 @@ } |
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
25579
454