abelalvarez89 / xlsx-parse-json

MIT License
13 stars 4 forks source link

Issue related to headers #14

Open wyvern800 opened 1 year ago

wyvern800 commented 1 year ago

Hi, there is an issue: Lets suppose if I have a these columns: ["Name", "Email", "Creation Date"],

and my rows are

const rows = [{
"Name": "Matheus",
"Email": "matheus@test.com",
},
{
"Name": "Matheus",
"Email": "matheus@test.com",
"Creation Date": "10/10/2000"
}
]

If I parse, having the position [0] of the 'rows' array, not containing the "Creation Date", the column "Creation Date" won't appear in any other object, but if I have the "Creation Date" set to object 0 of the 'rows' array, it will work normal for the other rows

What I made was a workaround by returning the column names to every sheet, and then I map the headers, cause I couldn't find a better solution.

Maybe expose getColumnsAndHeaders and make it as be returned for each Sheet by the (file) param. on onFileSelection