Socket
Socket
Sign inDemoInstall

hyperbee

Package Overview
Dependencies
Maintainers
1
Versions
108
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.1 to 0.0.2

iterators/diff.js

5

index.js

@@ -274,3 +274,3 @@ const codecs = require('codecs')

await this.ready()
if (this._checkout !== 0 && !this.feed.writable && (opts && opts.update) !== false) await this.update()
if (this._checkout === 0 && !this.feed.writable && (opts && opts.update) !== false) await this.update()
const len = this._checkout || this.feed.length

@@ -482,4 +482,3 @@ if (len < 2) return null

let root
let node = root = await this.getRoot()
let node = await this.getRoot()
if (!node) return

@@ -486,0 +485,0 @@

17

iterators/history.js

@@ -6,12 +6,25 @@ module.exports = class HistoryIterator {

this.live = !!opts.live
this.since = opts.since || 1
this.since = opts.since || 0
this.end = 0
this.reverse = !!opts.reverse
this.limit = typeof opts.limit === 'number' ? opts.limit : -1
}
async open () {
await this.db.ready()
await this.db.getRoot() // does the update dance
this.end = this.live ? Infinity : this.db.version
if (this.since) return
if (this.reverse) this.since = this.end - 1
else this.since = 1
}
async next () {
if (this._limit === 0) return null
if (this._limit > 0) this._limit--
if (this.reverse) {
if (this.since < 1) return null
return this.db.getBlock(this.since--, this.options)
}
if (this.since >= this.end) return null

@@ -18,0 +31,0 @@ return this.db.getBlock(this.since++, this.options)

{
"name": "hyperbee",
"version": "0.0.1",
"version": "0.0.2",
"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