File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,10 @@ function processAst(ast, cb) {
218
218
// When module.exports.funcName = func1
219
219
if ( expression . right . type === 'Identifier' ) {
220
220
return cb ( left . property . name , null , 'exportObj' ) ;
221
+ } else if ( expression . right . type === 'FunctionExpression' ) {
222
+ const loc = path . node . loc . start ;
223
+ let funcName = ( left . property . name ) || `anon_func_${ loc . line } _${ loc . column } ` ;
224
+ return cb ( funcName , path , 'exportObj' ) ;
221
225
}
222
226
} else if ( left . type === 'MemberExpression' &&
223
227
left . object . name === 'module' &&
@@ -251,7 +255,9 @@ function processAst(ast, cb) {
251
255
// Handle TypeScript transpiled exports
252
256
else if ( left . type === 'MemberExpression' &&
253
257
left . object . name === 'exports' ) {
254
- return cb ( left . property . name , null , 'exportFn' ) ;
258
+ // exports.func1 = function() { ... }
259
+ // exports.func1 = func1
260
+ return cb ( left . property . name , null , 'exportObj' ) ;
255
261
}
256
262
}
257
263
}
You can’t perform that action at this time.
0 commit comments