@@ -494,27 +494,27 @@ function jsonToGo(json, typename, flatten = true, example = false, allOmitempty
494
494
}
495
495
496
496
if ( typeof module != 'undefined' ) {
497
- if ( ! module . parent ) {
498
- if ( process . argv . length > 2 && process . argv [ 2 ] === '-big' ) {
499
- bufs = [ ]
500
- process . stdin . on ( 'data' , function ( buf ) {
501
- bufs . push ( buf )
502
- } )
503
- process . stdin . on ( 'end' , function ( ) {
504
- const json = Buffer . concat ( bufs ) . toString ( 'utf8' )
505
- process . stdout . write ( jsonToGo ( json ) . go )
506
- } )
507
- } else if ( process . argv . length === 3 ) {
508
- const fs = require ( 'fs' ) ;
509
- const json = fs . readFileSync ( process . argv [ 2 ] , 'utf8' ) ;
510
- process . stdout . write ( jsonToGo ( json ) . go )
511
- } else {
512
- process . stdin . on ( 'data' , function ( buf ) {
513
- const json = buf . toString ( 'utf8' )
514
- process . stdout . write ( jsonToGo ( json ) . go )
515
- } )
516
- }
517
- } else {
518
- module . exports = jsonToGo
519
- }
497
+ if ( ! module . parent ) {
498
+ if ( process . argv . length > 2 && process . argv [ 2 ] === '-big' ) {
499
+ bufs = [ ]
500
+ process . stdin . on ( 'data' , function ( buf ) {
501
+ bufs . push ( buf )
502
+ } )
503
+ process . stdin . on ( 'end' , function ( ) {
504
+ const json = Buffer . concat ( bufs ) . toString ( 'utf8' )
505
+ process . stdout . write ( jsonToGo ( json ) . go )
506
+ } )
507
+ } else if ( process . argv . length === 3 ) {
508
+ const fs = require ( 'fs' ) ;
509
+ const json = fs . readFileSync ( process . argv [ 2 ] , 'utf8' ) ;
510
+ process . stdout . write ( jsonToGo ( json ) . go )
511
+ } else {
512
+ process . stdin . on ( 'data' , function ( buf ) {
513
+ const json = buf . toString ( 'utf8' )
514
+ process . stdout . write ( jsonToGo ( json ) . go )
515
+ } )
516
+ }
517
+ } else {
518
+ module . exports = jsonToGo
519
+ }
520
520
}
0 commit comments