-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Description
Hi there,
currently trying to migrate my project from v6 to v7, but I struggle to make the snippet below work. Is this a bug, or do I do something wrong?
const Header = Object({ name: String })
const Body = Object({ content: String })
const HelloMessage = Intersect(Header, Body)
.withConstraint((m) => m.name === 'message' && m.content === 'Hello')
This code snippet is wrong, because m only consist of the Body and not the Header anymore. In v6 this code did work.
If this is indeed is wrong, then please guide me on how I would achieve to create a constraint on a intersection.
EDIT: If i switch Header and Body in the Intersect, I can access the Header in the constraint but not the Body anymore
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels