@@ -32,18 +32,15 @@ function findFunctionDefinition(
3232 if ( ! symbol ) {
3333 throw new Error ( 'Not a function reference found' )
3434 }
35-
3635 // Get function name and path
3736 const name = symbol . getName ( )
3837 const declarations = symbol . getDeclarations ( )
3938 if ( ! declarations || declarations . length === 0 ) {
4039 throw new Error ( `No declarations found for middleware function '${ name } '` )
4140 }
42-
4341 const decl = declarations [ 0 ]
4442 let filePath : string | undefined
4543 let args : any [ ] | undefined
46-
4744 // Handle factory function call
4845 if ( node && Node . isCallExpression ( node ) ) {
4946 // Store factory arguments
@@ -65,7 +62,6 @@ function findFunctionDefinition(
6562 }
6663 }
6764 }
68-
6965 // Handle normal function or variable
7066 if ( ! filePath ) {
7167 if ( Node . isFunctionDeclaration ( decl ) && ! decl . isExported ( ) ) {
@@ -79,7 +75,6 @@ function findFunctionDefinition(
7975 }
8076 filePath = decl . getSourceFile ( ) . getFilePath ( )
8177 }
82-
8378 return { name, path : filePath , args }
8479}
8580
@@ -116,7 +111,6 @@ export function getRelativeFilePath(
116111 let filePath = ( dirPath || '.' ) + '/' + path . basename ( absolutePath )
117112
118113 filePath = filePath . replace ( / \\ / g, '/' )
119-
120114 if ( ! filePath . startsWith ( '/' ) && ! filePath . startsWith ( '.' ) ) {
121115 filePath = `./${ filePath } `
122116 }
0 commit comments