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

hyperdrive

Package Overview
Dependencies
Maintainers
0
Versions
273
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperdrive - npm Package Compare versions

Comparing version 11.10.0 to 11.11.0

36

index.js

@@ -425,3 +425,5 @@ const Hyperbee = require('hyperbee')

entries (range, opts) {
return this.db.createReadStream(range, { ...opts, keyEncoding })
const stream = this.db.createReadStream(range, { ...opts, keyEncoding })
if (opts && opts.ignore) stream._readableState.map = createStreamMapIgnore(opts.ignore)
return stream
}

@@ -458,3 +460,3 @@

// atm always recursive, but we should add some depth thing to it
list (folder, opts) {
list (folder, opts = {}) {
if (typeof folder === 'object') return this.list(undefined, folder)

@@ -464,5 +466,5 @@

if (opts && opts.recursive === false) return shallowReadStream(this.db, folder, false)
return this.entries(prefixRange(folder))
const ignore = opts.ignore ? normalizeIgnore(opts.ignore) : null
const stream = opts && opts.recursive === false ? shallowReadStream(this.db, folder, false, ignore) : this.entries(prefixRange(folder), { ignore })
return stream
}

@@ -472,3 +474,3 @@

folder = std(folder || '/', true)
return shallowReadStream(this.db, folder, true)
return shallowReadStream(this.db, folder, true, null)
}

@@ -611,3 +613,3 @@

function shallowReadStream (files, folder, keys) {
function shallowReadStream (files, folder, keys, ignore) {
let prev = '/'

@@ -644,2 +646,8 @@ let prevName = ''

prevName = name
if (ignore && isIgnored(node.key, ignore)) {
this._read(cb)
return
}
this.push(keys ? name : node)

@@ -718,1 +726,15 @@ cb(null)

}
function normalizeIgnore (ignore) {
return [].concat(ignore).map(e => unixPathResolve('/', e))
}
function isIgnored (key, ignore) {
return ignore.some(e => e === key || key.startsWith(e + '/'))
}
function createStreamMapIgnore (ignore) {
return (node) => {
return isIgnored(node.key, ignore) ? null : node
}
}

2

package.json
{
"name": "hyperdrive",
"version": "11.10.0",
"version": "11.11.0",
"description": "Hyperdrive is a secure, real-time distributed file system",

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

@@ -222,3 +222,4 @@ # Hyperdrive

{
recursive: true | false // Whether to descend into all subfolders or not
recursive: true | false // Whether to descend into all subfolders or not,
ignore: String || Array // Ignore files and folders by name.
}

@@ -225,0 +226,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