diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index 12aa17b643..2f6b8679f6 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -1122,7 +1122,7 @@ export function ref(key: string, options?: ReferenceOptions): Reference; export function isRef(ref: any): ref is Reference; /** - * Get a sub-schema of an existing schema based on a `path` that can be either a string or an array + * Get a sub-schema of an existing schema based on a `path` that can be either a string or an array * of strings For string values path separator is a dot (`.`) */ export function reach(schema: ObjectSchema, path: string): Schema; @@ -1189,6 +1189,11 @@ export function not(values: any[]): Schema; */ export function required(): Schema; +/** + * Alias of `required`. + */ +export function exist(): Schema; + /** * Marks a key as optional which will allow undefined as values. Used to annotate the schema for readability as all keys are optional by default. */ diff --git a/types/joi/joi-tests.ts b/types/joi/joi-tests.ts index def9eaafd4..6eb7950682 100644 --- a/types/joi/joi-tests.ts +++ b/types/joi/joi-tests.ts @@ -1110,6 +1110,7 @@ schema = Joi.not(x, x); schema = Joi.not([x, x, x]); schema = Joi.required(); +schema = Joi.exist(); schema = Joi.optional(); schema = Joi.forbidden(); schema = Joi.strip();