many-level
many-level copied to clipboard
Update many-level to be compatible with abstract-level 2.0 API
This PR updates many-level to use the API as defined by abstract-level 2.0. It is supporting work for a matching PR on rave-level: https://github.com/Level/rave-level/pull/13
In general, this means everything has been converted from callbacks to promises. Unfortunately it does not encompass all of the work required to update many-level; our use case does not use all of the features of many-level, so due to limited time and competing priorities I had to forego solving several test failures which do not affect our use case.
A few notable changes:
- I updated the minimum node version to 16, matching
abstract-level2.0. - I added a new npm script,
test:stacktrace, which I found invaluable while debugging failing tests. - I did not implement a system for aborting in-flight operations when an Abort error is thrown. This would surely be very useful for some applications, but unfortunately (or fortunately for me?) it was not relevant to our use case. There are a handful of TODO comments in the code relevant to this.
- I have attempted to conform to the prevailing code style, but deviated on a few points:
- I renamed the guest and host iterator classes to be more descriptive, because I repeatedly got confused between the two.
- I did add descriptive comments in several places that were particularly unintuitive. I hope these aren't an issue, because honestly it was quite difficult to gain an initial understanding of several parts of the code when I started working on this.
While this isn't a complete update in and of itself, I hope this serves useful on the road to 2.0!