Level / abstract-leveldown

An abstract prototype matching the leveldown API.
MIT License
146 stars 53 forks source link

Add iterator.seek #237

Closed vweevers closed 6 years ago

vweevers commented 6 years ago

Closes #234. I copied over the seek function from leveldown, but without the type checks (because that's up to the implementation).

Can be released as a minor because AFAIK leveldown is the only implementation that supports seeking atm, and it does so by defining seek rather than _seek, so effectively there's no change.

When this lands in leveldown and we rename its seek to _seek, there's one change: the seek target will be serialized. That's fine, because leveldown can only seek to Buffer or strings anyway. It can only be considered a breaking change if someone does seek(3) and is expecting it to throw.

Next step is to copy over tests from leveldown, but I prefer to first land it in leveldown and see that its current tests pass.

cc @peakji