typebox
typebox copied to clipboard
Fix: escape properties in regexp pattern generation 2
resurection of https://github.com/sinclairzx81/typebox/pull/1231
issue: https://github.com/sinclairzx81/typebox/issues/1245
simpler reproduction:
import { Type } from '@sinclair/typebox'
import { Value } from '@sinclair/typebox/value'
const A = Type.Object({ $x: Type.Number() })
const B = Type.Object({ $y: Type.Number() })
const T = Type.Intersect([A, B], { unevaluatedProperties: false })
// should be undefined
Value.Errors(T, { $x: 1, $y: 1 }).First()