diff --git a/lib/level-browser.js b/lib/level-browser.js index 506df2d..53b0f43 100644 --- a/lib/level-browser.js +++ b/lib/level-browser.js @@ -608,12 +608,6 @@ class IteratorOptions { this.values = options.values; } - if (options.start != null) - this.start = options.start; - - if (options.end != null) - this.end = options.end; - if (options.gte != null) this.start = options.gte; @@ -633,13 +627,13 @@ class IteratorOptions { if (this.start != null) { if (typeof this.start === 'string') this.start = Buffer.from(this.start, 'utf8'); - assert(Buffer.isBuffer(this.start), '`start` must be a Buffer.'); + assert(Buffer.isBuffer(this.start), '`gt(e)` must be a Buffer.'); } if (this.end != null) { if (typeof this.end === 'string') this.end = Buffer.from(this.end, 'utf8'); - assert(Buffer.isBuffer(this.end), '`end` must be a Buffer.'); + assert(Buffer.isBuffer(this.end), '`lt(e)` must be a Buffer.'); } if (options.keyAsBuffer != null) { diff --git a/lib/memdb.js b/lib/memdb.js index b7a657e..87cc845 100644 --- a/lib/memdb.js +++ b/lib/memdb.js @@ -616,12 +616,6 @@ class IteratorOptions { this.values = options.values; } - if (options.start != null) - this.start = options.start; - - if (options.end != null) - this.end = options.end; - if (options.gte != null) this.start = options.gte; @@ -641,13 +635,13 @@ class IteratorOptions { if (this.start != null) { if (typeof this.start === 'string') this.start = Buffer.from(this.start, 'utf8'); - assert(Buffer.isBuffer(this.start), '`start` must be a Buffer.'); + assert(Buffer.isBuffer(this.start), '`gt(e)` must be a Buffer.'); } if (this.end != null) { if (typeof this.end === 'string') this.end = Buffer.from(this.end, 'utf8'); - assert(Buffer.isBuffer(this.end), '`end` must be a Buffer.'); + assert(Buffer.isBuffer(this.end), '`lt(e)` must be a Buffer.'); } if (options.keyAsBuffer != null) {