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 1.5.1 to 1.5.2

10

index.js

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

const SEP = Buffer.alloc(1)
const MAX = Buffer.from([255])
const EMPTY = Buffer.alloc(0)

@@ -861,6 +861,12 @@ class Key {

if (opts.sub && !opts.gt && !opts.gte) opts.gt = enc(e, SEP)
if (opts.sub && !opts.lt && !opts.lte) opts.lt = enc(e, MAX)
if (opts.sub && !opts.lt && !opts.lte) opts.lt = bump(enc(e, EMPTY))
return opts
}
function bump (key) {
// key should have been copied by enc above before hitting this
key[key.length - 1]++
return key
}
function enc (e, v) {

@@ -867,0 +873,0 @@ if (v === undefined || v === null) return null

2

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

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

@@ -287,2 +287,3 @@ const tape = require('tape')

const node = await helloSub.get({ key: 'hello' })
t.ok(node)

@@ -292,2 +293,21 @@ t.end()

tape('sub with a key that starts with 0xff', async t => {
t.plan(2)
const db = create({ sep: '!', keyEncoding: 'binary' })
const helloSub = db.sub('hello')
const key = Buffer.from([0xff, 0x01, 0x02])
await helloSub.put(key, 'val')
for await (const data of helloSub.createReadStream()) {
t.same(data.key, key)
}
const node = await helloSub.get(key)
t.ok(node)
t.end()
})
tape('setting read-only flag to false disables header write', async t => {

@@ -294,0 +314,0 @@ const db = create({ readonly: true })

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