Skip to content

Commit

Permalink
Implemented return of raw object
Browse files Browse the repository at this point in the history
Return of raw object is implemented in get function as requested in
issue jaredwray#39.

Ref: jaredwray#39
  • Loading branch information
dusansimic committed Dec 9, 2017
1 parent 4c6f3fe commit 26ff585
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ test/testdb.sqlite
#npm5
package-lock.json

#yarn
yarn.lock

# Logs
logs
*.log
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Keyv extends EventEmitter {
return `${this.opts.namespace}:${key}`;
}

get(key) {
get(key, opts) {
key = this._getKeyPrefix(key);
const store = this.opts.store;
return Promise.resolve()
Expand All @@ -63,6 +63,9 @@ class Keyv extends EventEmitter {
this.delete(key);
return undefined;
}
if (opts && opts.raw) {
return data;
}
return data.value;
});
}
Expand Down

0 comments on commit 26ff585

Please sign in to comment.