Files
strom/src/functions/unbatch.ts
2019-12-02 16:05:27 -05:00

14 lines
327 B
TypeScript

import { Transform, TransformOptions } from "stream";
export function unbatch(options?: TransformOptions) {
return new Transform({
...options,
transform(data, encoding, callback) {
for (const d of data) {
this.push(d);
}
callback();
},
});
}