Changelog
2.2.20
FunctionType
, FunctionC
, Function
NeverType
, NeverC
, never
AnyType
, AnyC
, any
RefinementC
, refinement
, Integer
Changelog
2.2.17
Changelog
2.2.16
Experimental modules require fp-ts@^2.5.0
.
Codec
readonly
combinator (@gcanti)Encoder
readonly
combinator (@gcanti)Changelog
2.2.15
Schemable
readonly
combinator (@gcanti)struct
combinator (@gcanti)type
in favour of struct
(@gcanti)fromType
in favour of fromStruct
(@gcanti)(*) breaking change
Changelog
2.2.12
sum
safer, closes #523 (@gcanti)(*) 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 })
})