File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ const url = "https://developer.mozilla.org/en-US/metadata.json";
66async function fetchAndFilterMDN ( ) {
77 try {
88 const res = await fetch ( url ) ;
9- if ( ! res . ok ) throw new Error ( `Fetch failed: ${ res . statusText } ` ) ;
9+ if ( ! res . ok ) {
10+ throw new Error ( `Fetch failed: ${ res . statusText } ` ) ;
11+ }
1012
1113 const data = await res . json ( ) ;
1214
Original file line number Diff line number Diff line change @@ -47,7 +47,9 @@ function insertComment(
4747
4848function extractSlug ( slug : string ) : string [ ] {
4949 for ( const subdirectory of subdirectories ) {
50- if ( ! slug . toLowerCase ( ) . startsWith ( subdirectory ) ) continue ;
50+ if ( ! slug . toLowerCase ( ) . startsWith ( subdirectory ) ) {
51+ continue ;
52+ }
5153 return slug
5254 . slice ( subdirectory . length )
5355 . replace ( / _ s t a t i c / g, "" )
@@ -83,7 +85,9 @@ export async function generateDescriptions(): Promise<{
8385 const slugArr = extractSlug ( mdnUrl ) ;
8486 const path = paths [ entry . pageType ] ;
8587 const comment = generateComment ( entry . summary , slugArr [ slugArr . length - 1 ] ) ;
86- if ( ! slugArr . length || ! path ) continue ;
88+ if ( ! slugArr . length || ! path ) {
89+ continue ;
90+ }
8791 insertComment ( results , slugArr , comment , path ) ;
8892 }
8993 return { interfaces : { interface : results } } ;
You can’t perform that action at this time.
0 commit comments