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

@tabcat/orbit-db-fsstore

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tabcat/orbit-db-fsstore - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

2

package.json
{
"name": "@tabcat/orbit-db-fsstore",
"version": "2.0.0",
"version": "3.0.0",
"description": "a custom orbit-db store representing a file system",

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

@@ -39,7 +39,13 @@

function joinPath (path, ...names) {
if (!names.every(nameValid)) throw new Error('invalid name supplied')
return `${path}/${names.join('/')}`
function joinPath (path, name) {
if (!pathValid(path)) throw errors.pathValidNo(path)
if (!nameValid(name)) throw errors.nameValidNo(name)
return `${path}/${name}`
}
function pathName (path) {
if (!pathValid(path)) throw errors.pathValidNo(path)
return path.split('/')[path.split('/').length - 1]
}
function tree (fs, path) {

@@ -170,2 +176,9 @@ const a = []

const errors = {
pathValidNo: (path) => new Error(`path ${path} is not valid`),
nameValidNo: (name) => new Error(`name ${name} is not valid`),
pathExistNo: (path) => new Error(`path '${path}' does not exist`),
pathExistYes: (path) => new Error(`path '${path}' already exists`)
}
const ops = {

@@ -185,2 +198,3 @@ mkdir,

module.exports = {
errors,
ops,

@@ -198,3 +212,4 @@ create,

nameValid,
joinPath
joinPath,
pathName
}

@@ -6,11 +6,5 @@

const FSIndex = require('./FSIndex')
const { joinPath, pathValid, nameValid, opcodes, ...fs } = require('./FS')
const FS = require('./FS')
const { joinPath, pathName, pathValid, nameValid, opcodes, errors, ...fs } = FS
const errors = {
pathValidNo: (path) => new Error(`path ${path} is not valid`),
nameValidNo: (name) => new Error(`name ${name} is not valid`),
pathExistNo: (path) => new Error(`path '${path}' does not exist`),
pathExistYes: (path) => new Error(`path '${path}' already exists`)
}
const paramCheckKeys = {

@@ -70,2 +64,3 @@ path: 'path',

this.joinPath = joinPath
this.pathName = pathName
this.exists = (path = '') => fs.exists(this._index.get(), path)

@@ -142,2 +137,5 @@ this.content = (path = '') => fs.content(this._index.get(), path)

FSStore.prototype.FS = FS
FSStore.prototype.FSIndex = FSIndex
module.exports = FSStore
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