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";
6
6
async function fetchAndFilterMDN ( ) {
7
7
try {
8
8
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
+ }
10
12
11
13
const data = await res . json ( ) ;
12
14
Original file line number Diff line number Diff line change @@ -47,7 +47,9 @@ function insertComment(
47
47
48
48
function extractSlug ( slug : string ) : string [ ] {
49
49
for ( const subdirectory of subdirectories ) {
50
- if ( ! slug . toLowerCase ( ) . startsWith ( subdirectory ) ) continue ;
50
+ if ( ! slug . toLowerCase ( ) . startsWith ( subdirectory ) ) {
51
+ continue ;
52
+ }
51
53
return slug
52
54
. slice ( subdirectory . length )
53
55
. replace ( / _ s t a t i c / g, "" )
@@ -83,7 +85,9 @@ export async function generateDescriptions(): Promise<{
83
85
const slugArr = extractSlug ( mdnUrl ) ;
84
86
const path = paths [ entry . pageType ] ;
85
87
const comment = generateComment ( entry . summary , slugArr [ slugArr . length - 1 ] ) ;
86
- if ( ! slugArr . length || ! path ) continue ;
88
+ if ( ! slugArr . length || ! path ) {
89
+ continue ;
90
+ }
87
91
insertComment ( results , slugArr , comment , path ) ;
88
92
}
89
93
return { interfaces : { interface : results } } ;
You can’t perform that action at this time.
0 commit comments