File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -3,22 +3,22 @@ export {}
3
3
const tsj = require ( 'ts-json-schema-generator' ) ;
4
4
const fs = require ( 'fs' ) ;
5
5
6
- const directory = fs . readdirSync ( './converter /types/' ) . filter ( ( f : string ) => f . endsWith ( '.ts' ) ) ;
6
+ const directory = fs . readdirSync ( './converters /types/' ) . filter ( ( f : string ) => f . endsWith ( '.ts' ) ) ;
7
7
8
8
directory . forEach ( ( f : string ) => {
9
- const file = fs . readFileSync ( `./converter /types/${ f } ` , 'utf8' ) ;
9
+ const file = fs . readFileSync ( `./converters /types/${ f } ` , 'utf8' ) ;
10
10
11
11
const regex = / \/ \/ @ T o o l B o x - ( [ a - z A - Z ] { 1 , 30 } ) / ;
12
12
const match = file . match ( regex ) ;
13
13
14
14
if ( ! match || match . length < 2 ) return ;
15
15
16
16
const schema = tsj . createGenerator ( {
17
- path : `./converter /types/${ f } ` ,
17
+ path : `./converters /types/${ f } ` ,
18
18
tsconfig : './tsconfig.json' ,
19
19
type : match [ 1 ]
20
20
} ) . createSchema ( match [ 1 ] )
21
21
22
22
const schemaString = JSON . stringify ( schema , null , 2 ) ;
23
- fs . writeFileSync ( `./converter /types/${ f . replace ( '.ts' , '.json' ) } ` , schemaString ) ;
23
+ fs . writeFileSync ( `./converters /types/${ f . replace ( '.ts' , '.json' ) } ` , schemaString ) ;
24
24
} )
You can’t perform that action at this time.
0 commit comments