Comparing version 0.0.4 to 0.0.5
16
index.js
@@ -30,4 +30,4 @@ 'use strict'; | ||
} | ||
this.cache.get(this.prefix+key, function (err, value) { | ||
err || !value ? reject(err) : resolve(value) | ||
this.cache.get(this.prefix+key, function (err, val) { | ||
err ? reject('memcached is not runing!') : resolve(val) | ||
}) | ||
@@ -50,4 +50,4 @@ }) | ||
// memcached return callback value | ||
this.cache.set(this.prefix+key, value, {expires}, function (err, value) { | ||
err || !value ? reject(err) : resolve(value) | ||
this.cache.set(this.prefix+key, value, {expires}, function (err, val) { | ||
err ? resolve(value) : resolve(val) | ||
}) | ||
@@ -71,11 +71,5 @@ }) | ||
Cache.prototype.memcached = () => { | ||
try { | ||
return memcached.Client.create(); | ||
} catch (e) { | ||
console.log('memcached client does not exist!, switched to lru cache') | ||
this.type = 'lru' | ||
return this.lru() | ||
} | ||
}; | ||
module.exports = Cache; | ||
module.exports = Cache; |
{ | ||
"name": "ssr-cache", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Api Serve-Side Cache Wrapper for Lru and Memcached", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
0
2844
68