-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Context
- node version: v6.11.5
- joi version:13.1.2
- environment (node, browser): node
- used with (hapi, standalone, ...):standalone
What are you trying to achieve or the steps to reproduce ?
const Joi = require('joi');
const test = "edf";
const schema = Joi
.string()
.hex()
.required();
const result = Joi.validate(test, schema);
console.log(result);
if(result.error)
{
console.log('error');
}
else{
const buffer = Buffer.from( result.value , "hex");
}Which result you had ?
Buffer throw error
TypeError: Invalid hex string
What did you expect ?
Joi generate error for length hex invalid
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels