DefaultOptions implemented as module factory

This commit is contained in:
Lewis Diamond
2019-12-02 16:02:40 -05:00
parent c690185ab7
commit a85054fd82
40 changed files with 357 additions and 316 deletions

View File

@@ -3,9 +3,7 @@ import { Transform, TransformOptions } from "stream";
export function batch(
batchSize: number = 1000,
maxBatchAge: number = 500,
options: TransformOptions = {
objectMode: true,
},
options: TransformOptions = {},
): Transform {
let buffer: any[] = [];
let timer: NodeJS.Timer | null = null;