From 522a8c2e23125dcfac60bb86cca08c80ee3d1604 Mon Sep 17 00:00:00 2001 From: Michal Szafranski Date: Sun, 3 Nov 2019 14:00:16 +0100 Subject: [PATCH] Simplify enum name maps --- src/consts.ts | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/consts.ts b/src/consts.ts index 0c70471..2cc2851 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -20,11 +20,7 @@ export enum HubType { // tslint:disable-next-line -export let HubTypeNames = Object.keys(HubType).reduce((result: {[hubType: string]: string}, item) => { - // @ts-ignore - result[HubType[item]] = item; - return result; -}, {}); +export const HubTypeNames = HubType; /** @@ -75,11 +71,7 @@ export enum DeviceType { // tslint:disable-next-line -export let DeviceTypeNames = Object.keys(DeviceType).reduce((result: {[deviceType: string]: string}, item) => { - // @ts-ignore - result[DeviceType[item]] = item; - return result; -}, {}); +export const DeviceTypeNames = DeviceType; /** @@ -114,11 +106,7 @@ export enum Color { // tslint:disable-next-line -export let ColorNames = Object.keys(Color).reduce((result: {[color: string]: string}, item) => { - // @ts-ignore - result[Color[item]] = item; - return result; -}, {}); +export const ColorNames = Color; /**