@@ -113,7 +113,11 @@ const assertHelper = (options) => {
113
113
const rewriter = new Synvert . Rewriter ( "group" , "name" , function ( ) {
114
114
this . configure ( { parser : Synvert . Parser . TYPESCRIPT } ) ;
115
115
this . withinFilesSync ( "*.{js,jsx}" , function ( ) {
116
- this . callHelperSync ( options . helper , options . options , options . helperFn . bind ( this ) ) ;
116
+ if ( options . helperFn ) {
117
+ this . callHelperSync ( options . helper , options . options , options . helperFn . bind ( this ) ) ;
118
+ } else {
119
+ this . callHelperSync ( options . helper , options . options ) ;
120
+ }
117
121
} ) ;
118
122
} ) ;
119
123
rewriter . processSync ( ) ;
@@ -137,7 +141,11 @@ const assertHelper = (options) => {
137
141
const rewriter = new Synvert . Rewriter ( "group" , "name" , async function ( ) {
138
142
this . configure ( { parser : Synvert . Parser . TYPESCRIPT } ) ;
139
143
await this . withinFiles ( "*.{js,jsx}" , async function ( ) {
140
- await this . callHelper ( options . helper , options . options , options . helperFn . bind ( this ) ) ;
144
+ if ( options . helperFn ) {
145
+ await this . callHelper ( options . helper , options . options , options . helperFn . bind ( this ) ) ;
146
+ } else {
147
+ await this . callHelper ( options . helper , options . options ) ;
148
+ }
141
149
} ) ;
142
150
} ) ;
143
151
await rewriter . process ( ) ;
0 commit comments