Comparing version 1.1.7 to 1.1.8
11
index.js
@@ -165,3 +165,3 @@ 'use strict' | ||
emit (ev, data, ...args) { | ||
emit (ev, data) { | ||
if (ev === 'data') { | ||
@@ -191,4 +191,11 @@ if (this[DECODER]) | ||
const args = [ ev, data ] | ||
if (arguments.length > 2) { | ||
for (let i = 2; i < arguments.length; i++) { | ||
args[i] = arguments[i] | ||
} | ||
} | ||
try { | ||
return super.emit(ev, data, ...args) | ||
return super.emit.apply(this, args) | ||
} finally { | ||
@@ -195,0 +202,0 @@ if (ev !== 'end') |
{ | ||
"name": "minipass", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "minimal implementation of a PassThrough stream", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -218,1 +218,11 @@ const MiniPass = require('../') | ||
}) | ||
t.test('emit works with many args', t => { | ||
const mp = new MiniPass() | ||
t.plan(2) | ||
mp.on('foo', function (a, b, c, d, e, f, g) { | ||
t.same([a,b,c,d,e,f,g], [1,2,3,4,5,6,7]) | ||
t.equal(arguments.length, 7) | ||
}) | ||
mp.emit('foo', 1, 2, 3, 4, 5, 6, 7) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
141735
871