将excel的header强制小写

This commit is contained in:
zhl 2023-04-19 15:30:33 +08:00
parent 60b39eb5a1
commit be797b1d22

View File

@ -7,7 +7,7 @@ export function excelToJson(filePath: string) {
throw new Error('excelToJson: no sheet found')
}
const sheet = workSheetsFromFile[0]
const header = sheet.data[0] as string[]
const header = (sheet.data[0] as string[]).map(item => item.toLowerCase())
let arr = []
for (let i = 1, l = sheet.data.length; i < l; i++) {
let row = sheet.data[i] as []