-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
featureNew functionality or improvementNew functionality or improvement
Milestone
Description
In joi.extend, you must define pre as pre(value, state, options). But often it is used just with the value argument. I leave out the remaining unused arguments. But joi throws an error saying 3 arguments are required.
It shouldn't do this because javascript doesn't require a function to have a set number of arguments. And it's common practice to omit trailing arguments that aren't used in the function body.
The final result would be really concise especially with arrow function syntax pre: value => transform(value).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew functionality or improvementNew functionality or improvement