From aaeffb2fe2d2e169cf92da5142037214ac341219 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 29 Mar 2024 18:42:11 -0300 Subject: external-links: don't hard-code styles where unnecessary --- src/util/external-links.js | 16 +++++++--------- 1 file 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, { -- cgit 1.3.0-6-gf8a5