From 24b35dd9915b061e962bbacf996b422db09e52c9 Mon Sep 17 00:00:00 2001 From: Bucyruss Date: Thu, 17 Jan 2019 00:55:47 -0600 Subject: [PATCH] Fixing the type definition for UnparseConfig to allow the quotes property to be undefined, a boolean, or an array of booleans per the documentation: https://www.papaparse.com/docs#json-to-csv (#32217) --- types/papaparse/index.d.ts | 12 ++++++------ types/papaparse/papaparse-tests.ts | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/types/papaparse/index.d.ts b/types/papaparse/index.d.ts index 3dc209a3df..fc97ef210c 100644 --- a/types/papaparse/index.d.ts +++ b/types/papaparse/index.d.ts @@ -117,12 +117,12 @@ export interface ParseConfig { } export interface UnparseConfig { - quotes?: boolean; // default: false - quoteChar?: string; // default: '"' - escapeChar?: string; // default: '"' - delimiter?: string; // default: "," - header?: boolean; // default: true - newline?: string; // default: "\r\n" + quotes?: boolean | boolean[]; // default: false + quoteChar?: string; // default: '"' + escapeChar?: string; // default: '"' + delimiter?: string; // default: "," + header?: boolean; // default: true + newline?: string; // default: "\r\n" } export interface UnparseObject { diff --git a/types/papaparse/papaparse-tests.ts b/types/papaparse/papaparse-tests.ts index 57115dc0d5..50929ff512 100644 --- a/types/papaparse/papaparse-tests.ts +++ b/types/papaparse/papaparse-tests.ts @@ -66,6 +66,7 @@ Papa.unparse({ }); Papa.unparse([{ a: 1, b: 1, c: 1 }], { quotes: false }); +Papa.unparse([{ a: 1, b: 1, c: 1 }], { quotes: [false, true, true] }); Papa.unparse([[1, 2, 3], [4, 5, 6]], { delimiter: "," }); Papa.unparse({ fields: ["3"],