File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -14,21 +14,16 @@ const listItem = (text, href) => {
1414
1515if ( repos ) {
1616 const pkg = document . querySelector ( "#top h1 span" ) . textContent ;
17- list . append (
18- listItem ( "Bundlephobia" , `https://bundlephobia.com/package/${ pkg } ` ) ,
19- ) ;
20-
21- list . append (
22- listItem ( "npm-stat" , `https://npm-stat.com/charts.html?package=${ pkg } ` ) ,
23- ) ;
24-
25- list . append (
26- listItem ( "Packagephobia" , `https://packagephobia.com/result?p=${ pkg } ` ) ,
27- ) ;
28-
29- list . append (
30- listItem ( "pkg-size.dev" , `https://pkg-size.dev/${ pkg } ` )
31- ) ;
17+ const sites = [
18+ [ "Bundlephobia" , `https://bundlephobia.com/package/${ pkg } ` ] ,
19+ [ "npm-stat" , `https://npm-stat.com/charts.html?package=${ pkg } ` ] ,
20+ [ "Packagephobia" , `https://packagephobia.com/result?p=${ pkg } ` ] ,
21+ [ "pkg-size.dev" , `https://pkg-size.dev/${ pkg } ` ] ,
22+ ] ;
23+
24+ for ( const [ label , site ] of sites ) {
25+ list . append ( listItem ( label , site ) ) ;
26+ }
3227
3328 repos . parentNode . append ( list ) ;
3429}
You can’t perform that action at this time.
0 commit comments