Socket
Socket
Sign inDemoInstall

minipass

Package Overview
Dependencies
2
Maintainers
9
Versions
94
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.8.6 to 2.9.0

23

index.js

@@ -46,2 +46,10 @@ 'use strict'

const isArrayBuffer = b => b instanceof ArrayBuffer ||
typeof b === 'object' &&
b.constructor &&
b.constructor.name === 'ArrayBuffer' &&
b.byteLength >= 0
const isArrayBufferView = b => !B.isBuffer(b) && ArrayBuffer.isView(b)
module.exports = class Minipass extends EE {

@@ -118,4 +126,15 @@ constructor (options) {

if (typeof chunk !== 'string' && !B.isBuffer(chunk) && !this[OBJECTMODE])
this.objectMode = true
// convert array buffers and typed array views into buffers
// at some point in the future, we may want to do the opposite!
// leave strings and buffers as-is
// anything else switches us into object mode
if (!this[OBJECTMODE] && !B.isBuffer(chunk)) {
if (isArrayBufferView(chunk))
chunk = B.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)
else if (isArrayBuffer(chunk))
chunk = B.from(chunk)
else if (typeof chunk !== 'string')
// use the setter so we throw if we have encoding set
this.objectMode = true
}

@@ -122,0 +141,0 @@ // this ensures at this point that the chunk is a buffer or string

4

package.json
{
"name": "minipass",
"version": "2.8.6",
"version": "2.9.0",
"description": "minimal implementation of a PassThrough stream",

@@ -12,3 +12,3 @@ "main": "index.js",

"end-of-stream": "^1.4.0",
"tap": "^14.6.4",
"tap": "^14.6.5",
"through2": "^2.0.3"

@@ -15,0 +15,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc