(context: ResolutionContext)
| 125 | languages: ['javascript', 'typescript'], |
| 126 | |
| 127 | detect(context: ResolutionContext): boolean { |
| 128 | // Express in a package.json — the root's, or a workspace's (`backend/`, `apps/api/`). |
| 129 | if (dependsOn(context, 'express', 'fastify', 'koa', 'hapi', '@hapi/hapi')) return true; |
| 130 | |
| 131 | // Check for common Express patterns |
| 132 | const allFiles = context.getAllFiles(); |
| 133 | for (const file of allFiles) { |
| 134 | if ( |
| 135 | file.includes('routes') || |
| 136 | file.includes('controllers') || |
| 137 | file.includes('middleware') |
| 138 | ) { |
| 139 | const content = context.readFile(file); |
| 140 | if (content && (content.includes('express') || content.includes('app.get') || content.includes('router.get'))) { |
| 141 | return true; |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | return false; |
| 147 | }, |
| 148 | |
| 149 | resolve(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null { |
| 150 | // A JS/TS module reaches another file's middleware, controller or service |
nothing calls this directly
no test coverage detected