node-excel-stream
node-excel-stream copied to clipboard
[ExcelReader] Delegate Schema Validation to consumer ?
Thanks for this tool! I was wondering if it should be possible to not provide schema upfront at all and let the consumer apply schema validation. Sometimes, you just want to parse any excel uploaded without having to worry upfront about the schema.
For example:
import {schema, schemaValidator} from "user-preferred-schema-validator";
const excelReader = new ExcelReader(readableStream); // <=== no schema passed here
...
await excelReader.eachRow(record => {
schemaValidator.validate(record, schema); // <=== user does this validation upon every record
})
what do you think ?