diff --git a/package.json b/package.json index b944722..0564808 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sinclair/typebox", - "version": "0.25.16", + "version": "0.25.17", "description": "JSONSchema Type Builder with Static Type Resolution for TypeScript", "keywords": [ "typescript", diff --git a/test/runtime/compiler/string.ts b/test/runtime/compiler/string.ts index 2f0005a..baff1e1 100644 --- a/test/runtime/compiler/string.ts +++ b/test/runtime/compiler/string.ts @@ -62,4 +62,9 @@ describe('type/compiler/String', () => { const T = Type.String({ pattern: '[\\d]{5}' }) Ok(T, '12345') }) + + it('Should should escape characters in the pattern', () => { + const T = Type.String({ pattern: '/a/' }) + Ok(T, '/a/') + }) })