You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

ipfs-utils

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.3.0

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="0.3.0"></a>
# [0.3.0](https://github.com/ipfs/js-ipfs-utils/compare/v0.2.0...v0.3.0) (2019-09-15)
### Features
* support old school streams ([#12](https://github.com/ipfs/js-ipfs-utils/issues/12)) ([18cfa86](https://github.com/ipfs/js-ipfs-utils/commit/18cfa86))
<a name="0.2.0"></a>

@@ -2,0 +12,0 @@ # [0.2.0](https://github.com/ipfs/js-ipfs-utils/compare/v0.1.0...v0.2.0) (2019-09-06)

5

package.json
{
"name": "ipfs-utils",
"version": "0.2.0",
"version": "0.3.0",
"description": "Package to aggregate shared logic and dependencies for the IPFS ecosystem",

@@ -49,3 +49,4 @@ "main": "src/index.js",

"electron-mocha": "^8.0.3",
"pull-stream": "^3.6.13"
"pull-stream": "^3.6.13",
"readable-stream-2": "npm:readable-stream@^2.0.0"
},

@@ -52,0 +53,0 @@ "contributors": [

@@ -8,2 +8,4 @@ 'use strict'

const globalThis = require('../globalthis')
const { Readable } = require('stream')
const Readable3 = require('readable-stream')

@@ -24,2 +26,3 @@ /*

* { path, content: PullStream<Bytes> } [single file]
* { path, content: Readable<Bytes> } [single file]
* Iterable<Number> [single file]

@@ -36,2 +39,3 @@ * Iterable<Bytes> [single file]

* Iterable<{ path, content: PullStream<Bytes> }> [multiple files]
* Iterable<{ path, content: Readable<Bytes> }> [multiple files]
* AsyncIterable<Bytes> [single file]

@@ -47,2 +51,3 @@ * AsyncIterable<Bloby> [multiple files]

* AsyncIterable<{ path, content: PullStream<Bytes> }> [multiple files]
* AsyncIterable<{ path, content: Readable<Bytes> }> [multiple files]
* PullStream<Bytes> [single file]

@@ -58,2 +63,14 @@ * PullStream<Bloby> [multiple files]

* PullStream<{ path, content: PullStream<Bytes> }> [multiple files]
* PullStream<{ path, content: Readable<Bytes> }> [multiple files]
* Readable<Bytes> [single file]
* Readable<Bloby> [multiple files]
* Readable<String> [multiple files]
* Readable<{ path, content: Bytes }> [multiple files]
* Readable<{ path, content: Bloby }> [multiple files]
* Readable<{ path, content: String }> [multiple files]
* Readable<{ path, content: Iterable<Number> }> [multiple files]
* Readable<{ path, content: Iterable<Bytes> }> [multiple files]
* Readable<{ path, content: AsyncIterable<Bytes> }> [multiple files]
* Readable<{ path, content: PullStream<Bytes> }> [multiple files]
* Readable<{ path, content: Readable<Bytes> }> [multiple files]
* ```

@@ -90,2 +107,7 @@ * Into:

// Readable<?>
if (isOldReadable(input)) {
input = upgradeOldStream(input)
}
// Iterable<?>

@@ -222,2 +244,7 @@ if (input[Symbol.iterator]) {

// Readable<?>
if (isOldReadable(input)) {
input = upgradeOldStream(input)
}
// Iterator<?>

@@ -269,2 +296,10 @@ if (input[Symbol.iterator]) {

function isOldReadable (obj) {
if (obj[Symbol.iterator] || obj[Symbol.asyncIterator]) {
return false
}
return Boolean(obj.readable)
}
function toBuffer (chunk) {

@@ -287,2 +322,13 @@ return isBytes(chunk) ? chunk : Buffer.from(chunk)

function upgradeOldStream (stream) {
if (stream[Symbol.asyncIterator] || stream[Symbol.iterator]) {
return stream
}
// in the browser the stream.Readable is not an async iterator but readble-stream@3 is...
stream[Symbol.asyncIterator] = Readable.prototype[Symbol.asyncIterator] || Readable3.prototype[Symbol.asyncIterator]
return stream
}
function blobToAsyncGenerator (blob) {

@@ -289,0 +335,0 @@ if (typeof blob.stream === 'function') {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc