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)

This commit is contained in:
Bucyruss
2019-01-17 06:55:47 +00:00
committed by John Reilly
parent 33f6179e0f
commit 24b35dd991
2 changed files with 7 additions and 6 deletions
+6 -6
View File
@@ -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 {
+1
View File
@@ -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"],