feat(import): harden workbook parser boundaries

This commit is contained in:
2026-03-31 22:48:30 +02:00
parent 3e8b1702bc
commit db50e2e555
20 changed files with 936 additions and 174 deletions
+3
View File
@@ -1,4 +1,5 @@
import type { SkillEntry } from "@capakraken/shared";
import { assertHeaderRow, assertTabularMatrixWithinLimits } from "./excel.js";
type ExcelJsModule = typeof import("exceljs");
@@ -80,7 +81,9 @@ function worksheetToRowObjects(
rows.push(cells);
}
assertTabularMatrixWithinLimits(rows, "skill matrix import");
const headers = (rows[0] ?? []).map((header) => header.trim());
assertHeaderRow(headers, "skill matrix import");
if (headers.length === 0) {
return [];
}