Releases: gcanti/io-ts
Releases · gcanti/io-ts
2.2.20
2.2.19
2.2.18
2.2.17
2.2.16
2.2.15
2.2.14
2.2.13
2.2.12
(*) breaking change
In case of non-string
tag values, the respective key must be enclosed in brackets
export const MySum: D.Decoder<
unknown,
| {
type: 1 // non-`string` tag value
a: string
}
| {
type: 2 // non-`string` tag value
b: number
}
> = D.sum('type')({
[1]: D.type({ type: D.literal(1), a: D.string }),
[2]: D.type({ type: D.literal(2), b: D.number })
})