Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2
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() |
{ | ||
"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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93858
20
2427
6
1
+ Addedcodecs@^2.2.0
+ Addedcodecs@2.2.0(transitive)