From 1700468e2d16946aaff040a84c735e3bcd78cdeb Mon Sep 17 00:00:00 2001 From: Nodari Chkuaselidze Date: Tue, 2 May 2023 15:22:24 +0400 Subject: [PATCH] memdb/browserdb: deprecate start/end iterator options. --- lib/level-browser.js | 10 ++-------- lib/memdb.js | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) 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) {