From a5bf4368e27d6ba6f6ba31152c2cc076826481c6 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Mon, 1 Aug 2016 12:46:21 -0400 Subject: [PATCH 1/2] Allow `Object` type as argument to `Stringifier.write` When using the stringifier in NodeJS streaming mode, it is perfectly acceptable to send in an `Object` as well; this is actually my favorite use case for this library. --- csv-stringify/csv-stringify.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csv-stringify/csv-stringify.d.ts b/csv-stringify/csv-stringify.d.ts index a1cc16a15b..77264e48bf 100644 --- a/csv-stringify/csv-stringify.d.ts +++ b/csv-stringify/csv-stringify.d.ts @@ -59,7 +59,7 @@ declare module "csv-stringify" { interface Stringifier extends NodeJS.ReadWriteStream { // Stringifier stream takes array of strings - write(line: string[]): boolean; + write(line: string[] | Object): boolean; // repeat declarations from NodeJS.WritableStream to avoid compile error write(buffer: Buffer, cb?: Function): boolean; From 7605b76d91192f9b4e9c57a973d216d3d8392fcf Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Mon, 1 Aug 2016 17:14:11 -0400 Subject: [PATCH 2/2] amend comment for Stringifier.write Change comment on `Stringifier.write` to reflect that argument is of type `string[] | Object` --- csv-stringify/csv-stringify.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csv-stringify/csv-stringify.d.ts b/csv-stringify/csv-stringify.d.ts index 77264e48bf..1effe84f61 100644 --- a/csv-stringify/csv-stringify.d.ts +++ b/csv-stringify/csv-stringify.d.ts @@ -58,7 +58,7 @@ declare module "csv-stringify" { interface Stringifier extends NodeJS.ReadWriteStream { - // Stringifier stream takes array of strings + // Stringifier stream takes array of strings or Object write(line: string[] | Object): boolean; // repeat declarations from NodeJS.WritableStream to avoid compile error