File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,10 +25,10 @@ function createValidator(workbook: WorkBook, opts?: ValidatorOptions) {
2525 header : options . header ,
2626 } )
2727
28- const parse = async ( row : any , schema : ZodSchema ) => {
28+ const parse = ( row : any , schema : ZodSchema ) => {
2929 const data = toObject ( row , header )
3030 try {
31- await schema . parseAsync ( data )
31+ schema . parse ( data )
3232 options . onValid && options . onValid ( data )
3333 return { issues : [ ] , isValid : true , data }
3434 } catch ( error ) {
@@ -40,10 +40,8 @@ function createValidator(workbook: WorkBook, opts?: ValidatorOptions) {
4040 }
4141 }
4242
43- const validate = async ( schema : ZodSchema ) : Promise < Result > => {
44- const promises = rows . map ( ( row ) => parse ( row , schema ) )
45-
46- const result = await Promise . all ( promises )
43+ const validate = ( schema : ZodSchema ) : Result => {
44+ const result = rows . map ( ( row ) => parse ( row , schema ) )
4745
4846 return {
4947 valid : result . filter ( ( r ) => r . isValid ) ,
You can’t perform that action at this time.
0 commit comments