Skip to content

Commit 8676af4

Browse files
committed
Added delete API
1 parent 824fe69 commit 8676af4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,17 @@ SecureStore.prototype.get = function (postfix, key, cb) {
104104
});
105105
};
106106

107+
SecureStore.prototype.delete = function (postfix, key, cb) {
108+
if (typeof cb !== 'function') {
109+
assert(typeof key === 'function', 'must specify a callback');
110+
cb = key;
111+
key = postfix;
112+
postfix = '';
113+
} else {
114+
postfix = ':' + postfix;
115+
}
116+
assert(typeof key === 'string', 'no hash key specified');
117+
this.pool.hdel(this.namespace + postfix, shasum(key), cb);
118+
};
119+
107120
module.exports = SecureStore;

0 commit comments

Comments
 (0)