You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to extend the joi object using base, which works fine when static properties are assigned like .min(20), but how can I pass a param to .regex(PARAM) when calling this with joi.customregex(regexParam)?
It doesn't look like base can be a function so I don't see how it could work using just base.
I could create a validate function then use the params argument to manually check the regex myself, but then I'm duplicating the functionality of Joi's .regex() validator.
What's the recommended way to do this? The regex example is just an example, I'd like to use this method of extending joi in many different ways.
The text was updated successfully, but these errors were encountered:
I'm trying to extend the joi object using
base
, which works fine when static properties are assigned like.min(20)
, but how can I pass a param to.regex(PARAM)
when calling this withjoi.customregex(regexParam)
?It doesn't look like
base
can be a function so I don't see how it could work using justbase
.I could create a
validate
function then use theparams
argument to manually check the regex myself, but then I'm duplicating the functionality of Joi's.regex()
validator.What's the recommended way to do this? The regex example is just an example, I'd like to use this method of extending joi in many different ways.
The text was updated successfully, but these errors were encountered: