Skip to content

Commit

Permalink
Allow arrays of arrays in intoStream.object TypeScript type definit…
Browse files Browse the repository at this point in the history
…ion (#15)
  • Loading branch information
aheuermann authored Aug 4, 2020
1 parent c1210b4 commit ef2b8dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ declare namespace intoStream {
| Iterable<Buffer | string>;

type InputObject =
| {[key: string]: any}
| Iterable<{[key: string]: any}>;
| object
| Iterable<object>;
}

declare const intoStream: {
Expand Down
3 changes: 3 additions & 0 deletions index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit ef2b8dc

Please # to comment.