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

autobase

Package Overview
Dependencies
Maintainers
2
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autobase - npm Package Compare versions

Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2

test/validation.js

17

index.js
const streamx = require('streamx')
const lock = require('mutexify/promise')
const cenc = require('compact-encoding')
const codecs = require('codecs')

@@ -36,2 +37,4 @@ const RebasedHypercore = require('./lib/rebase')

async _open () {
this._validateInputs()
this.defaultInput = await this._defaultInput

@@ -70,2 +73,14 @@ const inputs = (await this._inputs) || []

_validateInputs () {
for (const input of this._inputs) {
this._validateInput(input)
}
}
_validateInput (input) {
if (input.valueEncoding && input.valueEncoding !== codecs.binary) {
throw new Error('Hypercore inputs must be binary ones')
}
}
async _getInputNode (input, seq, opts = {}) {

@@ -133,2 +148,4 @@ if (seq < 1) return null

async addInput (input) {
this._validateInput(input)
if (!this.opened) await this.ready()

@@ -135,0 +152,0 @@ await input.ready()

5

package.json
{
"name": "autobase",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.2",
"description": "Autobase lets you write concise multiwriter data structures with Hypercore",

@@ -10,2 +10,3 @@ "main": "index.js",

"dependencies": {
"codecs": "^2.2.0",
"compact-encoding": "^2.0.0",

@@ -19,4 +20,4 @@ "debounceify": "^1.0.0",

"corestore": "next",
"hyperbee": "^1.5.3",
"hypercore": "next",
"hyperbee": "^1.5.3",
"latency-stream": "^1.0.0",

@@ -23,0 +24,0 @@ "random-access-memory": "^3.1.2",

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