( workPath: string, filePath: string )
| 186 | } |
| 187 | |
| 188 | async function resolveExistingEntrypoint( |
| 189 | workPath: string, |
| 190 | filePath: string |
| 191 | ): Promise<string | null> { |
| 192 | const candidates = [filePath, filePath.replace(/\.py$/i, '/__init__.py')]; |
| 193 | for (const candidate of candidates) { |
| 194 | try { |
| 195 | const stat = await fs.promises.stat(join(workPath, candidate)); |
| 196 | if (stat.isFile()) { |
| 197 | return candidate; |
| 198 | } |
| 199 | } catch {} |
| 200 | } |
| 201 | return null; |
| 202 | } |
| 203 | |
| 204 | function parseTopics(name: string, value: unknown): string[] { |
| 205 | if (!Array.isArray(value) || value.length === 0) { |
no test coverage detected