File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff 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/**
Original file line number Diff line number Diff line change 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 ],
Original file line number Diff line number Diff line change @@ -321,3 +321,12 @@ const parser = new Papa.Parser({});
321321parser . getCharIndex ( ) ;
322322parser . abort ( ) ;
323323parser . 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+ } ) ;
You can’t perform that action at this time.
0 commit comments