Skip to content

Commit 2243b87

Browse files
authored
🤖 Merge PR DefinitelyTyped#73942 Adding renamedHeaders to papaparse ParesMeta. to align with papaparse 5.5.3 by @paven
1 parent 52da2c9 commit 2243b87

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

‎types/papaparse/index.d.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ export interface ParseMeta {
450450
/** Whether preview consumed all input */
451451
truncated: boolean;
452452
cursor: number;
453+
/** Headers that are automatically renamed by the library to avoid duplication.
454+
* {Column 1_1: 'Column 1'} the later header 'Column 1' was renamed to 'Column 1_1'}**/
455+
renamedHeaders?: Record<string, string>;
453456
}
454457

455458
/**

‎types/papaparse/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/papaparse",
4-
"version": "5.3.9999",
4+
"version": "5.5.9999",
55
"projects": [
66
"https://github.com/mholt/PapaParse"
77
],

‎types/papaparse/papaparse-tests.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,3 +321,12 @@ const parser = new Papa.Parser({});
321321
parser.getCharIndex();
322322
parser.abort();
323323
parser.parse("", 0, false);
324+
325+
Papa.parse("a,a,b,c", {
326+
complete(results) {
327+
// $ExpectType Record<string, string> | undefined
328+
results.meta.renamedHeaders;
329+
// $ExpectType string | undefined
330+
const maybe = results.meta.renamedHeaders?.a;
331+
},
332+
});

0 commit comments

Comments
 (0)