(filePath: string, config: ScanConfig)
| 174 | } |
| 175 | |
| 176 | export function extractModuleName(filePath: string, config: ScanConfig): string | undefined { |
| 177 | for (const root of config.scanRoots) { |
| 178 | if (filePath === root || filePath.startsWith(root + path.sep)) { |
| 179 | const relative = path.relative(root, filePath); |
| 180 | const firstSegment = relative.split(path.sep)[0]; |
| 181 | return firstSegment; |
| 182 | } |
| 183 | } |
| 184 | return undefined; |
| 185 | } |
| 186 | |
| 187 | export function isSharedLibFile(filePath: string, config: ScanConfig): boolean { |
| 188 | return config.sharedLibPaths.some(libPath => filePath === libPath || filePath.startsWith(libPath + path.sep)); |
no test coverage detected