Huge News!Announcing our $40M Series B led by Abstract Ventures.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 2.0.0 to 2.1.0

2

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

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

@@ -12,5 +12,3 @@

pathExistNo: (path) => new Error(`path '${path}' does not exist`),
pathExistYes: (path) => new Error(`path '${path}' already exists`),
pathDirNo: (path) => new Error(`path '${path}' is not a directory`),
pathFileNo: (path) => new Error(`path '${path}' is not a file`)
pathDirNo: (path) => new Error(`path '${path}' is not a directory`)
}

@@ -106,3 +104,3 @@

async upload (path, source) {
async upload (path, source, options = {}) {
if (this.fs.content(path) !== 'dir') throw errors.pathDirNo(path)

@@ -114,3 +112,3 @@

try {
const ipfsUpload = await all(this._ipfs.add(source, ipfsAddConfig))
const ipfsUpload = await all(this._ipfs.add(source, ipfsAddConfig, options))
const batch = this._db.batch()

@@ -155,6 +153,2 @@

async mkdir (path, name) {
if (!this.fs.exists(path)) throw errors.pathExistNo(path)
if (this.fs.exists(this.fs.joinPath(path, name))) {
throw errors.pathExistYes(this.fs.joinPath(path, name))
}
await this._db.mkdir(path, name)

@@ -165,6 +159,2 @@ this.events.emit('mkdir')

async mkfile (path, name) {
if (!this.fs.exists(path)) throw errors.pathExistNo(path)
if (this.fs.exists(this.fs.joinPath(path, name))) {
throw errors.pathExistYes(this.fs.joinPath(path, name))
}
await this._db.mk(path, name)

@@ -175,4 +165,2 @@ this.events.emit('mkfile')

async write (path, cid) {
if (!this.fs.exists(path)) throw errors.pathExistNo(path)
if (this.fs.content(path) !== 'file') throw errors.pathFileNo(path)
if (!validCid(this._CID, cid)) throw new Error('invalid cid')

@@ -184,3 +172,2 @@ await this._db.write(path, cid.toString())

async read (path) {
if (!this.fs.exists(path)) throw errors.pathExistNo(path)
return this._getCid(path)

@@ -187,0 +174,0 @@ }

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