(filePath: string, folderPath: string)
| 81 | } |
| 82 | |
| 83 | export function resolveFolderSourceFile(filePath: string, folderPath: string): string | null { |
| 84 | if (!isSourceSaveFilePath(filePath)) return null; |
| 85 | |
| 86 | let root: string; |
| 87 | let candidate: string; |
| 88 | try { |
| 89 | root = realpathSync(resolveUserPath(folderPath)); |
| 90 | candidate = resolveUserPath(filePath, root); |
| 91 | if (!existsSync(candidate)) return null; |
| 92 | candidate = realpathSync(candidate); |
| 93 | } catch { |
| 94 | return null; |
| 95 | } |
| 96 | |
| 97 | if (!isWithinProjectRoot(candidate, root)) return null; |
| 98 | return candidate; |
| 99 | } |
| 100 | |
| 101 | export function resolveFolderSourceFileForSave(filePath: string, folderPath: string): string | null { |
| 102 | if (!isSourceSaveFilePath(filePath)) return null; |
no test coverage detected