illuminate-validator
v1.0.6
Published
A library to handle validation for your datas. Inspired by laravel validation
Downloads
34
Readme
Validator
const validator = createValidator({
data: {
key: 'my_value'
},
rules: {
key: 'required|string',
},
attributes: {
key: 'custom rename',
}
}).validate()
validator.fails
// List error messages
validator.errors().list
validator.errors().any
// Has any key errors
validator.errors().has('key')
Lang available : EN/FR
Tests
Run test =>
npm run test
Run test with coverage =>
npm run test-cover