(options: ResolveOutputOptions)
| 32 | } |
| 33 | |
| 34 | export async function resolveOutput(options: ResolveOutputOptions): Promise<string> { |
| 35 | const defaultOutput = stripRelativePath(options.defaultOutput) |
| 36 | if (defaultOutput.startsWith('node_modules')) { |
| 37 | const nodeModulesBase = await resolveNodeModulesBase(options.baseDir) |
| 38 | return path.resolve(nodeModulesBase, defaultOutput) |
| 39 | } |
| 40 | |
| 41 | return path.resolve(options.baseDir, defaultOutput) |
| 42 | } |
| 43 | |
| 44 | function stripRelativePath(pathString: string): string { |
| 45 | if (pathString.startsWith('./')) { |
no test coverage detected