Joi descover

node v10.15.0
version: 1.0.0
endpointsharetweet
const Joi = require("joi") const schema = Joi.object().keys({ password: Joi.string().regex(/^[a-zA-Z0-9]{3,30}$/).required(), email: Joi.string().email({ minDomainAtoms: 2 }).required(), username: Joi.string().alphanum().min(3).max(30).required(), }); const {error} = Joi.validate({username: ""}, Joi.object().keys({ username: Joi.reach(schema, 'username') }))
Loading…

no comments

    sign in to comment