diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index 4ecf403a6f..c943fbfa33 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -15,6 +15,7 @@ // Peter Thorson // Will Garcia // Simon Schick +// Alejandro Fernandez Haro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -704,7 +705,7 @@ export interface ArraySchema extends AnySchema { * `schema` - the validation rules required to satisfy the assertion. If the `schema` includes references, they are resolved against * the array item being tested, not the value of the `ref` target. */ - assertItem(schema: SchemaLike): this; + has(schema: SchemaLike): this; /** * Allow this array to be sparse. * enabled can be used with a falsy value to go back to the default behavior. diff --git a/types/joi/joi-tests.ts b/types/joi/joi-tests.ts index 4dbc784756..b4f01cfe56 100644 --- a/types/joi/joi-tests.ts +++ b/types/joi/joi-tests.ts @@ -312,7 +312,7 @@ anySchema = Joi.any(); arrSchema = Joi.array(); -arrSchema = arrSchema.assertItem(Joi.any()); +arrSchema = arrSchema.has(Joi.any()); arrSchema = arrSchema.sparse(); arrSchema = arrSchema.sparse(bool); arrSchema = arrSchema.single();