Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hyperbee

Package Overview
Dependencies
Maintainers
2
Versions
111
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperbee - npm Package Compare versions

Comparing version 0.0.16 to 0.0.17

27

iterators/range.js

@@ -15,2 +15,3 @@ module.exports = class RangeIterator {

this._checkpoint = (opts.checkpoint && opts.checkpoint.length) ? opts.checkpoint : null
this._nexting = false
}

@@ -20,3 +21,5 @@

const checkpoint = []
for (const { node, i } of this.stack) {
for (const s of this.stack) {
let { node, i } = s
if (this._nexting && s === this.stack[this.stack.length - 1]) i = this._reverse ? i + 1 : i - 1
if (!node.block) continue

@@ -59,4 +62,9 @@ if (i < 0) continue

this._nexting = true
let node = await this.db.getRoot()
if (!node) return
if (!node) {
this._nexting = false
return
}

@@ -68,2 +76,3 @@ const incl = this._reverse ? this._lIncl : this._gIncl

this.stack.push({ node, i: this._reverse ? node.keys.length << 1 : 0 })
this._nexting = false
return

@@ -87,3 +96,3 @@ }

this.stack.push(entry)
return
break
}

@@ -99,9 +108,17 @@

if (entry.i >= 0 && entry.i <= (node.keys.length << 1)) this.stack.push(entry)
if (!node.children.length) return
if (!node.children.length) break
node = await node.getChildNode(i)
}
this._nexting = false
}
async next () {
// TODO: this nexting flag is only needed if someone asks for a snapshot during
// a lookup (ie the extension, pretty important...).
// A better solution would be to refactor this so top.i is incremented eagerly
// to get the current block instead of the way it is done now (++i vs i++)
this._nexting = true
const end = this._reverse ? this._gKey : this._lKey

@@ -140,5 +157,7 @@ const incl = this._reverse ? this._gIncl : this._lIncl

if (this._limit > 0) this._limit--
this._nexting = false
return block.final()
}
this._nexting = false
return null

@@ -145,0 +164,0 @@ }

2

package.json
{
"name": "hyperbee",
"version": "0.0.16",
"version": "0.0.17",
"description": "An append-only Btree running on a Hypercore.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc