Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions types/papaparse/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ export interface ParseMeta {
/** Whether preview consumed all input */
truncated: boolean;
cursor: number;
/** Headers that are automatically renamed by the library to avoid duplication.
* {Column 1_1: 'Column 1'} the later header 'Column 1' was renamed to 'Column 1_1'}**/
renamedHeaders?: Record<string, string>;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion types/papaparse/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/papaparse",
"version": "5.3.9999",
"version": "5.5.9999",
"projects": [
"https://github.com/mholt/PapaParse"
],
Expand Down
9 changes: 9 additions & 0 deletions types/papaparse/papaparse-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,12 @@ const parser = new Papa.Parser({});
parser.getCharIndex();
parser.abort();
parser.parse("", 0, false);

Papa.parse("a,a,b,c", {
complete(results) {
// $ExpectType Record<string, string> | undefined
results.meta.renamedHeaders;
// $ExpectType string | undefined
const maybe = results.meta.renamedHeaders?.a;
},
});