README
OBJECTIVE:
Helper Module for Object Validation
DESCRIPTION:
With this module you can create object scheme for object and validate it.
When the validation fails the module throws ArgumentError.
INSTALLATION
npm install domain-validation
USEAGE EXAMPLE
validator.validate(smsOptions, {
phone: {
required: 'please add phone number',
numericString: 'this field must be numbers'
},
text: {
required: 'please add text'
}
});
VALIDATORS
required: ERROR_MESSAGE
numericString: ERROR_MESSAGE
email: ERROR_MESSAGE
numric: ERROR_MESSAGE
ip: ERROR_MESSAGE
any:
options: ['array', 'of', 'options']
msg: ERROR_MESSAGE