@sinclair/typebox
Advanced tools
Comparing version 0.12.1 to 0.12.2
{ | ||
"name": "@sinclair/typebox", | ||
"version": "0.12.1", | ||
"version": "0.12.2", | ||
"description": "JSONSchema Type Builder with Static Type Resolution for TypeScript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -224,3 +224,3 @@ export declare const ReadonlyOptionalModifier: unique symbol; | ||
/** Creates a `string` schema from a regular expression. */ | ||
RegEx(regex: RegExp): TString; | ||
RegEx(regex: RegExp, options?: CustomOptions): TString; | ||
/** Creates a `number` schema. */ | ||
@@ -227,0 +227,0 @@ Number(options?: NumberOptions): TNumber; |
@@ -145,4 +145,4 @@ "use strict"; | ||
/** Creates a `string` schema from a regular expression. */ | ||
RegEx(regex) { | ||
return this.String({ pattern: regex.source }); | ||
RegEx(regex, options = {}) { | ||
return this.String({ ...options, pattern: regex.source }); | ||
} | ||
@@ -149,0 +149,0 @@ /** Creates a `number` schema. */ |
41751