From 6774f271df9015382840f8aac87c2fb576dd33cf Mon Sep 17 00:00:00 2001 From: acalcutt Date: Tue, 23 Apr 2024 02:00:23 -0400 Subject: [PATCH] fix: remove unneeded array check Signed-off-by: acalcutt --- src/serve_style.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/serve_style.js b/src/serve_style.js index a8b2fa0..3a19ffc 100644 --- a/src/serve_style.js +++ b/src/serve_style.js @@ -49,13 +49,9 @@ export const serve_style = { } // mapbox-gl-js viewer cannot handle sprite urls with query if (styleJSON_.sprite) { - if (Array.isArray(styleJSON_.sprite)) { - styleJSON_.sprite.forEach((spriteItem) => { - spriteItem.url = fixUrl(req, spriteItem.url, item.publicUrl); - }); - } else { - styleJSON_.sprite = fixUrl(req, styleJSON_.sprite, item.publicUrl); - } + styleJSON_.sprite.forEach((spriteItem) => { + spriteItem.url = fixUrl(req, spriteItem.url, item.publicUrl); + }); } if (styleJSON_.glyphs) { styleJSON_.glyphs = fixUrl(req, styleJSON_.glyphs, item.publicUrl);