Merge pull request #32676 from wingsbob/joi-object-schema

[@types/joi] Add missing Joi object schema
This commit is contained in:
Pranav Senthilnathan
2019-01-31 10:34:26 -08:00
committed by GitHub
2 changed files with 7 additions and 1 deletions
+5 -1
View File
@@ -488,7 +488,6 @@ export interface BooleanSchema extends AnySchema {
/**
* Allows the values provided to truthy and falsy as well as the "true" and "false" default conversion
* (when not in strict() mode) to be matched in a case insensitive manner.
* @param enabled
*/
insensitive(enabled?: boolean): this;
}
@@ -792,6 +791,11 @@ export interface ObjectSchema extends AnySchema {
*/
length(limit: number): this;
/**
* Requires the object to be a Joi schema instance.
*/
schema(): this;
/**
* Specify validation rules for unknown keys matching a pattern.
*
+2
View File
@@ -706,6 +706,8 @@ objSchema = objSchema.nand(str, str);
objSchema = objSchema.nand(str, str, str);
objSchema = objSchema.nand(strArr);
objSchema = objSchema.schema();
objSchema = objSchema.or(str);
objSchema = objSchema.or(str, str);
objSchema = objSchema.or(str, str, str);