All files / fuse-ui-shared enumHelpers.ts

100% Statements 7/7
100% Branches 0/0
100% Functions 4/4
100% Lines 5/5
1 2 3 4 5 6 7 8 9 101x   1x 8x     1x 2x    
import * as _ from 'underscore';
 
export function enumNames(enumType: object): string[] {
  return Object.keys(enumType).filter(x => _.isNumber(enumType[x]));
}
 
export function enumStringMap(enumType: object): { [key: string]: string } {
  return _.object(enumNames(enumType).map(x => [x, x]));
}