-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Hey,
The below throws an error, this should return :
'the value of username is not allowed to be undefined'
var Joi = require('joi');
var schema = {
username: Joi.string().required().email()
};
var error = Joi.validate({}, schema, {abortEarly : false});
console.log(error);
Throws the following error:
joi/lib/string.js:168
if (value.match(regex)) {
^
TypeError: Cannot call method 'match' of undefined
This will also throw an error
var Joi = require('joi');
var schema = {
password: Joi.string().required().min(6).max(10)
};
var error = Joi.validate({}, schema, {abortEarly : false});
console.log(error);
Produces the following error:
joi/lib/string.js:75
value.length <= limit) {
^
TypeError: Cannot read property 'length' of undefined
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBug or defectBug or defect