export class EnumEx { public static getNamesAndValues < T extends number > ( e ) { return EnumEx . getNames ( e ) . map ( n => ( { name : n , value : e [ n ] as T } ) ) ; } public static getNames ( e ) { return EnumEx . getObjValues ( e ) . filter ( v => typeof v === 'string' ) as string [ ] ; } public static getValues < T extends number > ( e ) { return EnumEx . getObjValues ( e ) . filter ( v => typeof v === 'number' ) as T [ ] ; } private static getObjValues ( e ) { return Object . keys ( e ) . map ( k => e [ k ] ) ; } }