csval
Advanced tools
Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "csval", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Check CSV files against a set of validation rules.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -14,3 +14,5 @@ # csval | ||
- Regex pattern matching | ||
- Much more. Check the [JSON Schema reference](https://json-schema.org/understanding-json-schema/reference/index.html) for more information | ||
- Much more. Check the [JSON Schema | ||
reference](https://json-schema.org/understanding-json-schema/reference/index.html) | ||
for more information | ||
@@ -17,0 +19,0 @@ ## CLI Installation |
@@ -10,4 +10,8 @@ const Enjoi = require("enjoi"); | ||
parsed.data.forEach((row, i) => { | ||
Joi.validate(row, schema, err => { | ||
if (err) errors.push(`Row ${i + 2}: ${err.message}`); | ||
Joi.validate(row, schema, { abortEarly: false }, err => { | ||
if (err) { | ||
err.details.forEach(errorDetail => { | ||
errors.push(`Row ${i + 2}: ${errorDetail.message}`); | ||
}); | ||
} | ||
}); | ||
@@ -14,0 +18,0 @@ }); |
10203
103
266