New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cypsela/sailplane-node

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cypsela/sailplane-node - npm Package Compare versions

Comparing version

to
1.0.3

2

package.json
{
"name": "@cypsela/sailplane-node",
"version": "1.0.2",
"version": "1.0.3",
"description": "collaborative file system on ipfs",

@@ -5,0 +5,0 @@ "files": [

@@ -39,5 +39,5 @@

// improvement: remove uncalled, queued promises on add of new promise
this._updateQueue = new PQueue()
this._onDbUpdate = () => this._updateQueue.add(() => this._getCid())
this._updateQueue = new PQueue({ concurrency: 1 })
this._onDbUpdate = () =>
this._updateQueue.size === 0 && this._updateQueue.add(() => this._getCid())

@@ -136,4 +136,15 @@ this.running = null

function useCidClass (CID) {
return function validCid (cid) {
try {
return !!new CID(cid)
} catch (e) {
return false
}
}
}
async function * ipfsTree (path) {
const emptyFile = await last(this._ipfs.add(''))
const validCid = useCidClass(emptyFile.cid.constructor)
const fsStruct = [path, ...this.fs.tree(path)]

@@ -143,3 +154,6 @@ .map((p) => ({

content: this.fs.content(p) === 'file'
? this._ipfs.cat(this.fs.read(p) || emptyFile.cid)
? this._ipfs.cat(
(validCid(this.fs.read(p)) && this.fs.read(p)) ||
emptyFile.cid
)
: undefined

@@ -146,0 +160,0 @@ }))