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 = ({
92
92
const ICON_URL_TAILS = {
93
93
"Icon.png" : "icon" ,
94
94
"ChibiIcon.png" : "chibi" ,
95
- "Banner.png" : "banner" ,
96
- "default" : "unknown"
95
+ "Banner.png" : "banner"
97
96
} ;
98
97
99
98
function parseIcons ( td : Element ) {
100
99
return Array . from ( td . querySelectorAll ( "img" ) ) . map ( r => {
101
100
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"
103
102
return { url, urlType}
104
103
} ) ;
105
104
}
@@ -223,4 +222,4 @@ export async function fetchGallery(
223
222
skins : skins ,
224
223
gallery : gallery ,
225
224
} ;
226
- }
225
+ }
You can’t perform that action at this time.
0 commit comments