Skip to content

Commit

Permalink
Merge f144622 into 57c03a4
Browse files Browse the repository at this point in the history
  • Loading branch information
soundstep committed May 4, 2020
2 parents 57c03a4 + f144622 commit 8ef1b06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ class Keyv extends EventEmitter {
}

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 => {
return (typeof data === 'string') ? this.opts.deserialize(data) : data;
})
Expand Down
1 change: 1 addition & 0 deletions test/keyv.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ test.serial('Keyv respects default tll option', async t => {
t.is(await keyv.get('foo'), 'bar');
tk.freeze(Date.now() + 150);
t.is(await keyv.get('foo'), undefined);
t.is(store.size, 0);
tk.reset();
});

Expand Down

0 comments on commit 8ef1b06

Please sign in to comment.