mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-12 19:59:02 +08:00
Merge pull request #27917 from SimonSchick/feat/joi-global-exist
fix(joi): add global exist function
This commit is contained in:
7
types/joi/index.d.ts
vendored
7
types/joi/index.d.ts
vendored
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user