Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const colheaders = Object.keys(rows[0]);
- const errors=[];
- const regexpArray=[];
- rows.forEach((row,rowindex)=>{
- errors[rowindex]=[];
- Object.values(row).forEach((val,colindex)=>{
- if(regexpArray[colindex] && regexpArray[colindex].test(val)){
- errors[rowindex].push(colheaders[colindex]);
- }
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement