fix(Google Sheets Node): Fix for auto-range detection

This commit is contained in:
Michael Kret
2023-01-06 00:25:28 +02:00
committed by GitHub
parent acfb3518ad
commit 77031a2950
2 changed files with 12 additions and 1 deletions

View File

@@ -134,6 +134,10 @@ export function removeEmptyColumns(data: SheetRangeData) {
const longestRow = data.reduce((a, b) => (a.length > b.length ? a : b), []).length;
for (let col = 0; col < longestRow; col++) {
const column = data.map((row) => row[col]);
if (column[0] !== '') {
returnData.push(column);
continue;
}
const hasData = column.slice(1).some((cell) => cell || typeof cell === 'number');
if (hasData) {
returnData.push(column);