add batch.clear to bst.

This commit is contained in:
Christopher Jeffrey 2016-04-03 03:02:19 -07:00
parent 32e94429d3
commit d329d6e92f
2 changed files with 7 additions and 2 deletions

View File

@ -493,6 +493,12 @@ Batch.prototype.write = function write(callback) {
return this;
};
Batch.prototype.clear = function clear(callback) {
assert(this.tree, 'Already written.');
this.ops.length = 0;
return this;
};
/**
* Iterator
*/
@ -560,7 +566,7 @@ Iterator.prototype.next = function(callback) {
if (this.options.valueAsBuffer === false)
value = value.toString('utf8');
return utils.asyncify(callback)(null, key, value);
utils.asyncify(callback)(null, key, value);
};
Iterator.prototype.seek = function seek(key) {

View File

@ -40,7 +40,6 @@
"browserify": "13.0.0",
"hash.js": "1.0.3",
"level-js": "2.2.3",
"memdown": "1.1.2",
"mocha": "1.21.5",
"uglify-js": "2.6.1",
"v8-profiler": "5.6.0"