@nxtedition/rocksdb 7.0.57 → 7.0.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -341,13 +341,15 @@ class RocksLevel extends AbstractLevel {
341
341
  options.signal?.addEventListener('abort', onAbort)
342
342
  this.on('closing', onAbort)
343
343
 
344
+ const db = this
345
+
344
346
  // HACK: https://github.com/facebook/rocksdb/issues/10476
345
347
  async function* _updates (options) {
346
348
  let first = true
347
- for await (const update of this[kUpdates](options)) {
349
+ for await (const update of db[kUpdates](options)) {
348
350
  if (first) {
349
351
  if (update.sequence > options.since) {
350
- this.emit('warning', `Invalid sequence ${update.sequence} > ${options.since}. Starting from 0.`)
352
+ db.emit('warning', `Invalid sequence ${update.sequence} > ${options.since}. Starting from 0.`)
351
353
  first = null
352
354
  break
353
355
  } else {
@@ -358,7 +360,7 @@ class RocksLevel extends AbstractLevel {
358
360
  }
359
361
 
360
362
  if (first === null) {
361
- for await (const update of this[kUpdates]({ ...options, since: 0 })) {
363
+ for await (const update of db[kUpdates]({ ...options, since: 0 })) {
362
364
  yield update
363
365
  }
364
366
  }
@@ -366,8 +368,6 @@ class RocksLevel extends AbstractLevel {
366
368
 
367
369
  try {
368
370
  let since = options.since
369
-
370
- const db = this
371
371
  while (true) {
372
372
  const buffer = new Readable({
373
373
  signal: ac.signal,
@@ -399,7 +399,7 @@ class RocksLevel extends AbstractLevel {
399
399
  }
400
400
 
401
401
  try {
402
- if (since <= this.sequence) {
402
+ if (since <= db.sequence) {
403
403
  for await (const update of _updates(options)) {
404
404
  if (ac.signal.aborted) {
405
405
  throw new AbortError()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "7.0.57",
3
+ "version": "7.0.58",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",