@@ -5,7 +5,7 @@ const DEFAULT_TAGS = ["all", "default", "experimental"];
5
5
const ALLOWED_DOMAINS = {
6
6
"app.netlify.com" : "/sites/webkit-speedometer-preview/" ,
7
7
} ;
8
- export class DataProvider {
8
+ export class DataProvider {
9
9
_tags = new Set ( DEFAULT_TAGS ) ;
10
10
_suites = [ ] ;
11
11
@@ -36,7 +36,6 @@ export class DataProvider{
36
36
const parsedUrl = new URL ( suite . url ) ;
37
37
if ( parsedUrl . hostname === "localhost" )
38
38
return true ;
39
-
40
39
} catch ( e ) {
41
40
// Invalid URL format for localhost
42
41
}
@@ -48,7 +47,6 @@ export class DataProvider{
48
47
const parsedUrl = new URL ( suite . url ) ;
49
48
if ( ALLOWED_DOMAINS [ parsedUrl . hostname ] && ALLOWED_DOMAINS [ parsedUrl . hostname ] . includes ( parsedUrl . pathname ) )
50
49
return true ;
51
-
52
50
} catch ( e ) {
53
51
// invalid URL
54
52
}
@@ -81,14 +79,14 @@ export class DataProvider{
81
79
const response = await fetch ( params . config ) ;
82
80
const config = await response . json ( ) ;
83
81
84
- config . suites . flatMap ( ( suite ) => suite . tags ) . forEach ( tag => this . _tags . add ( tag ) ) ;
85
- config . suites . forEach ( suite => {
82
+ config . suites . flatMap ( ( suite ) => suite . tags ) . forEach ( ( tag ) => this . _tags . add ( tag ) ) ;
83
+ config . suites . forEach ( ( suite ) => {
86
84
if ( this . _containsAllowedUrl ( suite ) )
87
85
this . _suites . push ( suite ) ;
88
86
} ) ;
89
87
} else {
90
- defaultSuites . flatMap ( ( suite ) => suite . tags ) . forEach ( tag => this . _tags . add ( tag ) ) ;
91
- defaultSuites . forEach ( suite => this . _suites . push ( suite ) ) ;
88
+ defaultSuites . flatMap ( ( suite ) => suite . tags ) . forEach ( ( tag ) => this . _tags . add ( tag ) ) ;
89
+ defaultSuites . forEach ( ( suite ) => this . _suites . push ( suite ) ) ;
92
90
}
93
91
94
92
this . _freezeTags ( ) ;
@@ -143,6 +141,4 @@ export class DataProvider{
143
141
const dataProvider = new DataProvider ( ) ;
144
142
await dataProvider . init ( ) ;
145
143
146
- export {
147
- dataProvider
148
- } ;
144
+ export { dataProvider } ;
0 commit comments