File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -92,14 +92,13 @@ const handleSkinCategory = ({
9292const ICON_URL_TAILS = {
9393 "Icon.png" : "icon" ,
9494 "ChibiIcon.png" : "chibi" ,
95- "Banner.png" : "banner" ,
96- "default" : "unknown"
95+ "Banner.png" : "banner"
9796} ;
9897
9998function parseIcons ( td : Element ) {
10099 return Array . from ( td . querySelectorAll ( "img" ) ) . map ( r => {
101100 const url = galleryThumbnailUrlToActualUrl ( r . getAttribute ( "src" ) ) ;
102- const urlType = ICON_URL_TAILS [ Object . keys ( ICON_URL_TAILS ) . find ( pattern => url . endsWith ( pattern ) ) ?? "default" ]
101+ const urlType = Object . entries ( ICON_URL_TAILS ) . find ( p => url . endsWith ( p [ 0 ] ) ) ?. [ 1 ] ?? "unknown"
103102 return { url, urlType}
104103 } ) ;
105104}
@@ -223,4 +222,4 @@ export async function fetchGallery(
223222 skins : skins ,
224223 gallery : gallery ,
225224 } ;
226- }
225+ }
You can’t perform that action at this time.
0 commit comments