(
absoluteBaseFile: string,
checkingExts = relevantExtensionList as readonly string[],
opts = {} as Partial<ResolveResult>
)
| 94 | * Look for source code file (crawl index) |
| 95 | */ |
| 96 | export const resolveSourceIndex = async ( |
| 97 | absoluteBaseFile: string, |
| 98 | checkingExts = relevantExtensionList as readonly string[], |
| 99 | opts = {} as Partial<ResolveResult> |
| 100 | ): Promise<ResolverResult> => { |
| 101 | const potentialFiles = checkingExts.flatMap((ext) => [ |
| 102 | `${absoluteBaseFile}${ext}`, |
| 103 | resolve(absoluteBaseFile, `index${ext}`) |
| 104 | ]) |
| 105 | |
| 106 | for (const file of potentialFiles) { |
| 107 | try { |
| 108 | if (statSync(file).isFile()) { |
| 109 | return { filePath: file, ...opts } |
| 110 | } |
| 111 | } catch {} |
| 112 | } |
| 113 | |
| 114 | return null |
| 115 | } |
no test coverage detected
searching dependent graphs…