Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 152499a

Browse files
committed
DRY map lookup
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 91ba939 commit 152499a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TextForEvent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ const stateHandlers = {
310310

311311
module.exports = {
312312
textForEvent: function(ev) {
313-
const handler = ev.isState() ? stateHandlers[ev.getType()] : handlers[ev.getType()];
313+
const handler = (ev.isState() ? stateHandlers : handlers)[ev.getType()];
314314
if (handler) return handler(ev);
315315
return '';
316316
},

0 commit comments

Comments
 (0)