Fix header row

This commit is contained in:
Fanny Cheung 2024-07-16 17:00:28 +02:00
parent fbf5f8abc9
commit 10bb30b344

View File

@ -248,8 +248,14 @@ export function sheetRawContentToObjects(rawContent){
let [firstRow, ...dataRows] = rawContent
/** @type {string[]} */
//@ts-expect-error this type is correct after the filter
const columns = firstRow.filter(({value}) => typeof value === 'string' && value.length >= 1).map(r => r.value)
const columns = firstRow.map((r, i) => {
if (r.value === undefined || r.value === null || r.value === "") {
return `Column ${i+1}`
}
return r.value
})
return dataRows
.map(row => {