(cwd: string)
| 5 | const exists = promisify(fs.exists) |
| 6 | |
| 7 | async function resolveNodeModulesBase(cwd: string): Promise<string> { |
| 8 | if (await exists(path.resolve(process.cwd(), 'prisma/schema.prisma'))) { |
| 9 | return process.cwd() |
| 10 | } |
| 11 | if (path.relative(process.cwd(), cwd) === 'prisma' && (await exists(path.resolve(process.cwd(), 'package.json')))) { |
| 12 | return process.cwd() |
| 13 | } |
| 14 | if (await exists(path.resolve(cwd, 'node_modules'))) { |
| 15 | return cwd |
| 16 | } |
| 17 | if (await exists(path.resolve(cwd, '../node_modules'))) { |
| 18 | return path.join(cwd, '../') |
| 19 | } |
| 20 | if (await exists(path.resolve(cwd, 'package.json'))) { |
| 21 | return cwd |
| 22 | } |
| 23 | if (await exists(path.resolve(cwd, '../package.json'))) { |
| 24 | return path.join(cwd, '../') |
| 25 | } |
| 26 | return cwd |
| 27 | } |
| 28 | |
| 29 | export type ResolveOutputOptions = { |
| 30 | defaultOutput: string |
no test coverage detected