mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
Joi.extend can be called with arrays
This commit is contained in:
3
types/joi/index.d.ts
vendored
3
types/joi/index.d.ts
vendored
@@ -1071,7 +1071,8 @@ export function reach<T extends Schema>(schema: ObjectSchema, path: string): T;
|
||||
/**
|
||||
* Creates a new Joi instance customized with the extension(s) you provide included.
|
||||
*/
|
||||
export function extend(extention: Extension): any;
|
||||
export function extend(extention: Extension|Extension[]): any;
|
||||
export function extend(...extentions: (Extension|Extension[])[]): any;
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
|
||||
@@ -970,6 +970,12 @@ const Joi3 = Joi.extend({
|
||||
],
|
||||
});
|
||||
|
||||
const Joi4 = Joi.extend([{ name: '', base: schema }, { name: '', base: schema }]);
|
||||
|
||||
const Joi5 = Joi.extend({ name: '', base: schema }, { name: '', base: schema });
|
||||
|
||||
const Joi6 = Joi.extend({ name: '', base: schema }, [{ name: '', base: schema }, { name: '', base: schema }]);
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
const defaultsJoi = Joi.defaults((schema) => {
|
||||
|
||||
Reference in New Issue
Block a user