Skip to content

Commit

Permalink
Use explicit if-statement instead of ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
jsharkey13 committed May 18, 2022
1 parent a970bea commit 315fda5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion moo.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,11 @@
if (typeof keyword !== 'string') {
throw new Error("keyword must be string (in keyword '" + tokenType + "')")
}
isMap ? reverseMap.set(keyword, tokenType) : reverseMap[keyword] = tokenType
if (isMap) {
reverseMap.set(keyword, tokenType)
} else {
reverseMap[keyword] = tokenType
}
})
}
return function(k) {
Expand Down

0 comments on commit 315fda5

Please sign in to comment.