Add generic type

This commit is contained in:
Jerry Kurian 2019-09-09 15:15:40 -04:00
parent eed36a4fe9
commit d33d8dcad3
2 changed files with 2 additions and 1 deletions

View File

@ -17,7 +17,7 @@ function _accumulator<T>(
const buffer: T[] = []; const buffer: T[] = [];
return new Transform({ return new Transform({
...options, ...options,
transform(data: any, encoding, callback) { transform(data: T, encoding, callback) {
try { try {
accumulateBy(data, buffer, this); accumulateBy(data, buffer, this);
callback(); callback();

View File

@ -118,6 +118,7 @@ class Demux extends Writable {
} }
return this; return this;
} }
public once(event: string, cb: any) { public once(event: string, cb: any) {
switch (eventsTarget[event]) { switch (eventsTarget[event]) {
case EventSubscription.Self: case EventSubscription.Self: