Mercurial > hg > ugly-duckling
changeset 442:51a5df5569a4
No need for ternary operator, coalesce to default value.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Mon, 26 Jun 2017 11:07:20 +0100 |
parents | 55e17af8a0ee |
children | 39ce8491233a a6b7051dea9d |
files | src/app/feature-extraction-menu/feature-extraction-menu.component.ts |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Mon Jun 26 11:00:21 2017 +0100 +++ b/src/app/feature-extraction-menu/feature-extraction-menu.component.ts Mon Jun 26 11:07:20 2017 +0100 @@ -116,15 +116,13 @@ } getFeatureIconName(outputInfo: ExtractorOutputInfo): string { - const featureIconMap = { + return { vector: 'show_chart', matrix: 'grid_on', tracks: 'multiline_chart', instants: 'view_week', notes: 'audiotrack', - }; - const maybeIcon = featureIconMap[crudeTypeUriMap[outputInfo.typeUri]]; - return maybeIcon ? maybeIcon : 'extension'; + }[crudeTypeUriMap[outputInfo.typeUri]] || 'extension'; } ngOnDestroy(): void {