You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ianstormtaylor I believe the behavior mentioned above is actually a bugreport. Just prepared a failing test case for it independently, and then found the current issue reported:
it.only('masking succeeds validation for objects with extra props in union', () => {
const S = union([object({ a: string() }), object({ b: string() })])
const value = { a: '1', extraProp: 42 }
deepStrictEqual(mask(value, S), { a: '1' }) // fails!
})
Is there a way to make
mask
work withunion
? I'd like to define only one parser that I could use to:I know I could use
type()
instead ofobject()
but that would essentially require defining two parsers for the whole huge object tree.Here's the minimal use case:
The text was updated successfully, but these errors were encountered: