File tree 1 file changed +4
-3
lines changed 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import * as path from "path";
3
3
import fetch from "node-fetch" ;
4
4
import { JSDOM } from "jsdom" ;
5
5
6
- fetchIDLs ( ) ;
6
+ fetchIDLs ( process . argv . slice ( 2 ) ) ;
7
7
8
8
interface IDLSource {
9
9
url : string ;
@@ -19,8 +19,9 @@ const idlSelector = [
19
19
20
20
const cssPropSelector = "dfn.css[data-dfn-type=property]" ;
21
21
22
- async function fetchIDLs ( ) {
23
- const idlSources = require ( "../inputfiles/idlSources.json" ) as IDLSource [ ] ;
22
+ async function fetchIDLs ( filter : string [ ] ) {
23
+ const idlSources = ( require ( "../inputfiles/idlSources.json" ) as IDLSource [ ] )
24
+ . filter ( source => ! filter . length || filter . includes ( source . title ) ) ;
24
25
await Promise . all ( idlSources . map ( async source => {
25
26
const { idl, comments } = await fetchIDL ( source ) ;
26
27
fs . writeFileSync ( path . join ( __dirname , `../inputfiles/idl/${ source . title } .widl` ) , idl + '\n' ) ;
You can’t perform that action at this time.
0 commit comments