ObjectMode is now true by default

This commit is contained in:
Lewis Diamond 2020-07-04 10:58:08 -04:00
parent 74ce415118
commit e6fb55eb1a
3 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ import { unbatch } from "./unbatch";
import { compose } from "./compose";
import { demux } from "./demux";
export function strom(defaultOptions?: TransformOptions) {
export function strom(defaultOptions: TransformOptions = { objectMode: true }) {
function withDefaultOptions<T extends any[], R>(
n: number,
fn: (...args: T) => R,

View File

@ -59,7 +59,7 @@ test.cb(
const source = new Readable({ objectMode: false });
source
.pipe(collect())
.pipe(collect({ objectMode: false }))
.on("data", collected => {
expect(collected).to.deep.equal(Buffer.from("abc"));
t.pass();

View File

@ -172,7 +172,7 @@ test.cb(
test.cb("concat() concatenates empty list of readable streams", t => {
t.plan(0);
concat()
.pipe(collect())
.pipe(collect({ objectMode: false }))
.on("data", _ => {
t.fail();
})