Skip to content

Commit

Permalink
Add missing type cast to fix TypeScript build. (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkaindl authored and KhaosT committed Nov 17, 2019
1 parent 8c8e84e commit 6fbafa8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/gen/importAsClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function getCharacteristicFormatsKey(format: string) {

// look up the key in our known-formats dict
for (var key in Formats)
if (Formats[key] == format)
if (Formats[key as keyof typeof Formats] == format)
return key;

throw new Error("Unknown characteristic format '" + format + "'");
Expand All @@ -188,7 +188,7 @@ function getCharacteristicFormatsKey(format: string) {
function getCharacteristicUnitsKey(units: string) {
// look up the key in our known-units dict
for (var key in Units)
if (Units[key] == units)
if (Units[key as keyof typeof Units] == units)
return key;

throw new Error("Unknown characteristic units '" + units + "'");
Expand Down

0 comments on commit 6fbafa8

Please sign in to comment.