-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Having to write itz.Either(...)
every time I have a union type is very annoying.
Describe the solution you'd like
Simply use arrays of validators as an alias to itz.Either
, it looks way cleaner.
Describe alternatives you've considered
There really isn't a simpler alternative than this.
Additional context
Before
const foo = itz.A({
foo: itz.Either(itz.String, itz.AsNumber, itz.Undefined),
});
After
const foo = itz.A({
foo: [itz.String, itz.AsNumber, itz.Undefined],
});
This together with #4 would allow for cleaner structure definitions.