node-excel-stream icon indicating copy to clipboard operation
node-excel-stream copied to clipboard

[ExcelReader] Delegate Schema Validation to consumer ?

Open vikramkamath opened this issue 3 years ago • 0 comments

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 ?

vikramkamath avatar Apr 19 '21 14:04 vikramkamath