@@ -19,14 +19,16 @@ async function main() {
19
19
// Apply this prefix to the names of all ts-node-generated definitions
20
20
const tsnodeDefinitionPrefix = 'tsNode' ;
21
21
let tsNodeSchema : any = JSON . parse (
22
- JSON . stringify (
23
- originalTsNodeSchema ,
24
- ) . replace ( / # \/ d e f i n i t i o n s \/ / g, `#/definitions/${ tsnodeDefinitionPrefix } ` )
22
+ JSON . stringify ( originalTsNodeSchema ) . replace (
23
+ / # \/ d e f i n i t i o n s \/ / g,
24
+ `#/definitions/${ tsnodeDefinitionPrefix } `
25
+ )
25
26
) ;
26
27
tsNodeSchema . definitions = Object . fromEntries (
27
- Object . entries ( tsNodeSchema . definitions ) . map ( ( [ key , value ] ) =>
28
- [ `${ tsnodeDefinitionPrefix } ${ key } ` , value ]
29
- )
28
+ Object . entries ( tsNodeSchema . definitions ) . map ( ( [ key , value ] ) => [
29
+ `${ tsnodeDefinitionPrefix } ${ key } ` ,
30
+ value ,
31
+ ] )
30
32
) ;
31
33
// console.dir(tsNodeSchema, {
32
34
// depth: Infinity
@@ -67,12 +69,16 @@ async function main() {
67
69
} ,
68
70
} ,
69
71
} ,
70
- }
72
+ } ,
71
73
} ;
72
74
// Splice into the allOf array at a spot that looks good. Does not affect
73
75
// behavior of the schema, but looks nicer if we want to submit as a PR to schemastore.
74
- mergedSchema . allOf = mergedSchema . allOf . filter ( ( item : any ) => ! item . $ref ?. includes ( 'tsNode' ) ) ;
75
- mergedSchema . allOf . splice ( mergedSchema . allOf . length - 1 , 0 , { $ref : '#/definitions/tsNodeDefinition' } ) ;
76
+ mergedSchema . allOf = mergedSchema . allOf . filter (
77
+ ( item : any ) => ! item . $ref ?. includes ( 'tsNode' )
78
+ ) ;
79
+ mergedSchema . allOf . splice ( mergedSchema . allOf . length - 1 , 0 , {
80
+ $ref : '#/definitions/tsNodeDefinition' ,
81
+ } ) ;
76
82
77
83
writeFileSync (
78
84
resolve ( __dirname , '../tsconfig.schemastore-schema.json' ) ,
0 commit comments