Creates an enum decoder from a typescript enum. Enum decoder checks if input value can be converted to a type of the specified enum.
enum MyEnum { A = 1, B = 2,}// Creates a decoder that will successfully decode input value of 1 or 'A' to MyEnum.A.const decoder = D.enum(MyEnum);
Generated using TypeDoc
Creates an enum decoder from a typescript enum. Enum decoder checks if input value can be converted to a type of the specified enum.
Example