DefinitelyTyped/types/through2-concurrent/through2-concurrent-tests.ts
2018-09-06 13:46:31 +01:00

28 lines
684 B
TypeScript

import * as through2 from 'through2-concurrent';
import { Transform } from 'stream';
let str: Transform;
const transformFn = (err: any, data: any) => {};
function flushCb(this: Transform, cb: () => void) {
cb();
}
const opts = {
allowHalfOpen: false,
maxConcurrency: 5
};
str = through2();
str = through2(opts);
str = through2(transformFn);
str = through2(opts, transformFn);
str = through2(transformFn, flushCb);
str = through2(opts, transformFn, flushCb);
str = through2.obj();
str = through2.obj(opts);
str = through2.obj(transformFn);
str = through2.obj(opts, transformFn);
str = through2.obj(transformFn, flushCb);
str = through2.obj(opts, transformFn, flushCb);