Comparing version 4.0.0 to 4.0.1
{ | ||
"name": "keyv", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Simple key-value storage with support for multiple backends", | ||
@@ -47,4 +47,4 @@ "main": "src/index.js", | ||
"timekeeper": "^2.0.0", | ||
"xo": "^0.24.0" | ||
"xo": "^0.25.3" | ||
} | ||
} |
@@ -54,6 +54,6 @@ 'use strict'; | ||
get(key, opts) { | ||
key = this._getKeyPrefix(key); | ||
const keyPrefixed = this._getKeyPrefix(key); | ||
const { store } = this.opts; | ||
return Promise.resolve() | ||
.then(() => store.get(key)) | ||
.then(() => store.get(keyPrefixed)) | ||
.then(data => { | ||
@@ -77,3 +77,3 @@ return (typeof data === 'string') ? this.opts.deserialize(data) : data; | ||
set(key, value, ttl) { | ||
key = this._getKeyPrefix(key); | ||
const keyPrefixed = this._getKeyPrefix(key); | ||
if (typeof ttl === 'undefined') { | ||
@@ -95,3 +95,3 @@ ttl = this.opts.ttl; | ||
}) | ||
.then(value => store.set(key, value, ttl)) | ||
.then(value => store.set(keyPrefixed, value, ttl)) | ||
.then(() => true); | ||
@@ -101,6 +101,6 @@ } | ||
delete(key) { | ||
key = this._getKeyPrefix(key); | ||
const keyPrefixed = this._getKeyPrefix(key); | ||
const { store } = this.opts; | ||
return Promise.resolve() | ||
.then(() => store.delete(key)); | ||
.then(() => store.delete(keyPrefixed)); | ||
} | ||
@@ -107,0 +107,0 @@ |
15463