« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/external-links.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/util/external-links.js b/src/util/external-links.js
index 4dc95921..877ef8d4 100644
--- a/src/util/external-links.js
+++ b/src/util/external-links.js
@@ -897,15 +897,13 @@ export function getExternalLinkStringOfStyleFromDescriptors(url, style, descript
 }
 
 export function getExternalLinkStringsFromDescriptor(url, descriptor, {language}) {
-  const getStyle = style =>
-    getExternalLinkStringOfStyleFromDescriptor(url, style, descriptor, {language});
-
-  return {
-    'normal': getStyle('normal'),
-    'compact': getStyle('compact'),
-    'platform': getStyle('platform'),
-    'icon-id': getStyle('icon-id'),
-  };
+  return (
+    Object.fromEntries(
+      externalLinkStyles.map(style =>
+        getExternalLinkStringOfStyleFromDescriptor(
+          url,
+          style,
+          descriptor, {language}))));
 }
 
 export function getExternalLinkStringsFromDescriptors(url, descriptors, {