We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f14e867 commit b052331Copy full SHA for b052331
1 file changed
src/ships/gallery.ts
@@ -92,14 +92,13 @@ const handleSkinCategory = ({
92
const ICON_URL_TAILS = {
93
"Icon.png": "icon",
94
"ChibiIcon.png": "chibi",
95
- "Banner.png": "banner",
96
- "default": "unknown"
+ "Banner.png": "banner"
97
};
98
99
function parseIcons(td: Element){
100
return Array.from(td.querySelectorAll("img")).map(r=>{
101
const url = galleryThumbnailUrlToActualUrl(r.getAttribute("src"));
102
- const urlType = ICON_URL_TAILS[Object.keys(ICON_URL_TAILS).find(pattern=>url.endsWith(pattern))??"default"]
+ const urlType = Object.entries(ICON_URL_TAILS).find(p=>url.endsWith(p[0]))?.[1] ?? "unknown"
103
return {url, urlType}
104
});
105
}
@@ -223,4 +222,4 @@ export async function fetchGallery(
223
222
skins: skins,
224
gallery: gallery,
225
226
-}
+}
0 commit comments