mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
Joi: support non-array variant of alternatives().try()
This commit is contained in:
@@ -734,6 +734,7 @@ namespace common {
|
||||
|
||||
schema = Joi.alternatives();
|
||||
schema = Joi.alternatives().try(schemaArr);
|
||||
schema = Joi.alternatives().try(schema, schema);
|
||||
|
||||
schema = Joi.alternatives(schemaArr);
|
||||
schema = Joi.alternatives(schema, anySchema, boolSchema);
|
||||
|
||||
1
joi/joi.d.ts
vendored
1
joi/joi.d.ts
vendored
@@ -691,6 +691,7 @@ declare module 'joi' {
|
||||
|
||||
export interface AlternativesSchema extends AnySchema<FunctionSchema> {
|
||||
try(schemas: Schema[]): AlternativesSchema;
|
||||
try(type1: Schema, type2: Schema, ...types: Schema[]): AlternativesSchema;
|
||||
when<T>(ref: string, options: WhenOptions<T>): AlternativesSchema;
|
||||
when<T>(ref: Reference, options: WhenOptions<T>): AlternativesSchema;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user