Skip to content

Commit 54fb0aa

Browse files
committed
Minor changes
1 parent 2888965 commit 54fb0aa

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

plugins/google-sheets/src/sheets.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ function processSheet(rows: Row[], processRowParams: Omit<ProcessSheetRowParams,
484484
)
485485
const collectionItems = result.filter(isDefined)
486486

487-
// Detect duplicate slugs and report errors
487+
// Detect duplicate slugs and report error if any are found
488488
const slugCounts = new Map<string, number>()
489489
const duplicateSlugs = new Set<string>()
490490

@@ -542,16 +542,12 @@ export async function syncSheet({
542542
const uniqueHeaderRowNames = generateUniqueNames(headerRow)
543543
const headerRowHash = generateHeaderRowHash(headerRow, ignoredColumns)
544544

545-
const ignoredFieldColumnIndexes = ignoredColumns.map(col => uniqueHeaderRowNames.indexOf(col))
546-
547-
// Find the longest row length to check for cases where any sheet rows are longer than the header row
545+
// Find the longest row length to check if any sheet rows are longer than the header row
548546
const maxRowLength = Math.max(...sheet.values.map(row => row.length))
549547

550548
// Check for empty header row cells and collect all empty columns
551549
const emptyHeaderColumns: string[] = []
552550
for (let i = 0; i < maxRowLength; i++) {
553-
if (ignoredFieldColumnIndexes.includes(i)) continue
554-
555551
const header = headerRow[i]
556552
if (!isDefined(header) || header.trim() === "") {
557553
const columnLetter = columnToLetter(i + 1)
@@ -571,7 +567,7 @@ export async function syncSheet({
571567
const { collectionItems, status } = processSheet(rows, {
572568
uniqueHeaderRowNames,
573569
fieldTypes: colFieldTypes,
574-
ignoredFieldColumnIndexes,
570+
ignoredFieldColumnIndexes: ignoredColumns.map(col => uniqueHeaderRowNames.indexOf(col)),
575571
slugFieldColumnIndex: slugColumn ? uniqueHeaderRowNames.indexOf(slugColumn) : -1,
576572
rowLength: headerRow.length,
577573
})

0 commit comments

Comments
 (0)