Socket
Socket
Sign inDemoInstall

minipass-flush

Package Overview
Dependencies
3
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

14

index.js
const Minipass = require('minipass')
const _flush = Symbol('_flush')
const _flushed = Symbol('_flushed')
const _flushing = Symbol('_flushing')
class Flush extends Minipass {

@@ -18,7 +20,15 @@ constructor (opt = {}) {

emit (ev, ...data) {
if (ev !== 'end')
if (ev !== 'end' || this[_flushed])
return super.emit(ev, ...data)
const afterFlush = er => er ? super.emit('error', er) : super.emit('end')
if (this[_flushing])
return
this[_flushing] = true
const afterFlush = er => {
this[_flushed] = true
er ? super.emit('error', er) : super.emit('end')
}
const ret = this[_flush](afterFlush)

@@ -25,0 +35,0 @@ if (ret && ret.then)

4

package.json
{
"name": "minipass-flush",
"version": "1.0.1",
"version": "1.0.2",
"description": "A Minipass stream that calls a flush function before emitting 'end'",

@@ -21,3 +21,3 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)",

"dependencies": {
"minipass": "^2.5.1"
"minipass": "^2.6.2"
},

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

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