From ef2b8dcd41d8fbb982ec0bbed1b0db734c08b06f Mon Sep 17 00:00:00 2001 From: Andrew Heuermann Date: Tue, 4 Aug 2020 11:41:56 -0500 Subject: [PATCH] Allow arrays of arrays in `intoStream.object` TypeScript type definition (#15) --- index.d.ts | 4 ++-- index.test-d.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index fa90177..39af31b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -10,8 +10,8 @@ declare namespace intoStream { | Iterable; type InputObject = - | {[key: string]: any} - | Iterable<{[key: string]: any}>; + | object + | Iterable; } declare const intoStream: { diff --git a/index.test-d.ts b/index.test-d.ts index d60efe9..482a255 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -25,10 +25,13 @@ intoStream(Promise.resolve(new Uint8Array(Buffer.from('unicorn').buffer))).pipe( const object = {foo: true}; const objectArray = new Set([object, {bar: true}]); const objectIterable = new Set(objectArray); +const arrayOfArrays = [[object]]; intoStream.object(object).pipe(process.stdout); intoStream.object(objectArray).pipe(process.stdout); intoStream.object(objectIterable).pipe(process.stdout); +intoStream.object(arrayOfArrays).pipe(process.stdout); intoStream.object(Promise.resolve(object)).pipe(process.stdout); intoStream.object(Promise.resolve(objectArray)).pipe(process.stdout); intoStream.object(Promise.resolve(objectIterable)).pipe(process.stdout); +intoStream.object(Promise.resolve(arrayOfArrays)).pipe(process.stdout);