Merge pull request #33003 from afharo/joi-array.has

Joi: Array.assertItem has been replaced by Array.has
This commit is contained in:
Andrew Casey
2019-02-20 18:21:02 -08:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -15,6 +15,7 @@
// Peter Thorson <https://github.com/zaphoyd>
// Will Garcia <https://github.com/thewillg>
// Simon Schick <https://github.com/SimonSchick>
// Alejandro Fernandez Haro <https://github.com/afharo>
// 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.
+1 -1
View File
@@ -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();