From 10bb30b34473af99734e3928e611a997d2032336 Mon Sep 17 00:00:00 2001 From: Fanny Cheung Date: Tue, 16 Jul 2024 17:00:28 +0200 Subject: [PATCH] Fix header row --- scripts/shared.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/shared.js b/scripts/shared.js index 840695a..e996da6 100644 --- a/scripts/shared.js +++ b/scripts/shared.js @@ -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 => {