import * as t from 'io-ts' ; param name param originalEnum returns export function enumeration < EnumType extends string > ( name , originalEnum ) { const isEnumValue = ( input ) : input is EnumType => Object . values < unknown > ( originalEnum ) . includes ( input ) ; return new t . Type < EnumType > ( name , isEnumValue , ( input , context ) => ( isEnumValue ( input ) ? t . success ( input ) : t . failure ( input , context ) ) , t . identity ) ; }