-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Context
- node version: 14.18.1
- module version with issue: 17.5.0
- environment (e.g. node, browser, native): node
- used with (e.g. hapi application, another framework, standalone, ...): standalone
What are you trying to achieve or the steps to reproduce?
The following code will output:
[ 'a', 'b', 0, 'c' ]
[ 'a', 'b', 1, 'c' ]Code:
Joi
.object({
a: Joi.object({
b: Joi.array().items(Joi.object({
c: Joi.custom((value, helpers) => {
console.log(helpers.state.path);
return value;
})
}))
})
})
.validate({ a: { b: [{ c: '1' }, { c: '2' }] } });What was the result you got?
helpers.state.path has type string | undefined (defined here)
What result did you expect?
helpers.state.path has type (string | number)[] | undefined
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
typesTypeScript type definitionsTypeScript type definitions