From 5fe390b1fae5f654fec560fccb83dc12c4f914cd Mon Sep 17 00:00:00 2001 From: Klaus Sevensleeper Date: Thu, 12 Jul 2018 09:44:11 +0200 Subject: [PATCH] [joi] Add missing type to ObjectSchema::pattern() (#27152) * added missing type to ObjectSchema::pattern() * changed version as requested by reviewer --- types/joi/index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index dbf60400b9..12aa17b643 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for joi v13.3.0 +// Type definitions for joi v13.4.0 // Project: https://github.com/hapijs/joi // Definitions by: Bart van der Schoor // Laurence Dougal Myers @@ -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.