File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ export class Generator extends Emitter<GeneratorEmits> {
8686 options,
8787 file : mainFile ,
8888 } ) ;
89+ const { runtimeValidate, runtimeMock, writeSchema } = printerOptions ;
8990
9091 // 2. 读取
9192 this . emit ( 'process' , makePayload ( 'reading' ) ) ;
@@ -105,15 +106,15 @@ export class Generator extends Emitter<GeneratorEmits> {
105106 await this . #writePrintResult( 'main' , mainFile , main ) ;
106107 await this . #writePrintResult( 'type' , typeFile , type ) ;
107108
108- if ( printerOptions . runtimeValidate || printerOptions . runtimeMock ) {
109+ if ( runtimeValidate || runtimeMock ) {
109110 await this . #writePrintResult( 'zod' , zodFile , zod ) ;
110111 }
111112
112- if ( printerOptions . runtimeMock ) {
113+ if ( runtimeMock ) {
113114 await this . #writePrintResult( 'mock' , mockFile , mock ) ;
114115 }
115116
116- if ( printerOptions . writeSchema ) {
117+ if ( writeSchema ) {
117118 for ( const { version, document, errors } of migrated ) {
118119 await this . #writePrintResult( `schema@${ version } ` , schemaFiles [ version ] , {
119120 lang : 'json' ,
You can’t perform that action at this time.
0 commit comments