Skip to content

Commit

Permalink
Fixing the type definition for UnparseConfig to allow the quotes prop…
Browse files Browse the repository at this point in the history
…erty to be undefined, a boolean, or an array of booleans per the documentation: https://www.papaparse.com/docs#json-to-csv (DefinitelyTyped#32217)
  • Loading branch information
Bucyruss authored and johnnyreilly committed Jan 17, 2019
1 parent 33f6179 commit 24b35dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions types/papaparse/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions types/papaparse/papaparse-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 24b35dd

Please sign in to comment.