diff options
Diffstat (limited to 'app/assets/javascripts/contribution_events/utils.js')
-rw-r--r-- | app/assets/javascripts/contribution_events/utils.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/contribution_events/utils.js b/app/assets/javascripts/contribution_events/utils.js new file mode 100644 index 00000000000..0760b5187c6 --- /dev/null +++ b/app/assets/javascripts/contribution_events/utils.js @@ -0,0 +1,9 @@ +import { TYPE_FALLBACK } from './constants'; + +export const getValueByEventTarget = (map, event) => { + const { + target: { type: targetType, issue_type: issueType }, + } = event; + + return map[issueType || targetType] || map[TYPE_FALLBACK]; +}; |