typebox icon indicating copy to clipboard operation
typebox copied to clipboard

Fix: escape properties in regexp pattern generation 2

Open didierdemoniere opened this issue 9 months ago • 0 comments

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()

didierdemoniere avatar May 07 '25 17:05 didierdemoniere