From ae870d0deb6f06ae793a764709a39a696ccc8fe2 Mon Sep 17 00:00:00 2001 From: Klaus Kopruch Date: Mon, 9 Jul 2018 14:20:42 +0200 Subject: [PATCH] added missing type to ObjectSchema::pattern() --- types/joi/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index dbf60400b9..1b98750917 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -753,8 +753,11 @@ export interface ObjectSchema extends AnySchema { /** * Specify validation rules for unknown keys matching a pattern. + * + * @param pattern - a pattern that can be either a regular expression or a joi schema that will be tested against the unknown key names + * @param schema - the schema object matching keys must validate against */ - pattern(regex: RegExp, schema: SchemaLike): this; + pattern(pattern: RegExp | SchemaLike, schema: SchemaLike): this; /** * Defines an all-or-nothing relationship between keys where if one of the peers is present, all of them are required as well.