(
file: FileFsRef | { fsPath?: string }
)
| 10 | * - A top-level 'handler' class (BaseHTTPRequestHandler subclass) |
| 11 | */ |
| 12 | export async function isPythonEntrypoint( |
| 13 | file: FileFsRef | { fsPath?: string } |
| 14 | ): Promise<boolean> { |
| 15 | try { |
| 16 | const fsPath = (file as FileFsRef).fsPath; |
| 17 | if (!fsPath) return false; |
| 18 | const content = await fs.promises.readFile(fsPath, 'utf-8'); |
| 19 | return (await findAppOrHandler(content)) !== null; |
| 20 | } catch (err) { |
| 21 | debug(`Failed to check Python entrypoint: ${err}`); |
| 22 | return false; |
| 23 | } |
| 24 | } |
no test coverage detected