solnic / drops

🛠️ Tools for working with data effectively - data contracts using types, schemas, domain validation rules, type-safe casting, and more.
Other
258 stars 7 forks source link

Better union #42

Closed solnic closed 10 months ago

solnic commented 10 months ago

This simplifies evaluation of the union type, so that right side is only applied if the primitive type check on the left side failed. This only works like that if both sides are primitive types, otherwise we must always try to apply both sides.