excel import leading and trailing whitespace (#902)

* add test for leading and trailing whitespace

* trim whitespace
This commit is contained in:
Alex Christoffer Rasmussen
2024-04-19 19:36:06 +01:00
committed by GitHub
parent c4136a0ec7
commit b14ac07568
2 changed files with 35 additions and 2 deletions
+2 -2
View File
@@ -74,7 +74,7 @@ export const parseExcel = (excelData: unknown[][], options?: Partial<ImportMap>)
for (const [key, value] of Object.entries(importMap)) {
if (typeof value === 'string') {
importMap[key] = value.toLocaleLowerCase();
importMap[key] = value.toLocaleLowerCase().trim();
}
}
@@ -222,7 +222,7 @@ export const parseExcel = (excelData: unknown[][], options?: Partial<ImportMap>)
if (column.length === 0) {
continue;
}
const columnText = column.toLowerCase();
const columnText = column.toLowerCase().trim();
// check if it is an ontime column
if (handlers[columnText]) {