( file: string, preserveSymlinks?: boolean, )
| 1162 | } |
| 1163 | |
| 1164 | function tryResolveRealFileOrType( |
| 1165 | file: string, |
| 1166 | preserveSymlinks?: boolean, |
| 1167 | ): { path?: string; type: 'directory' | 'file' } | undefined { |
| 1168 | const fileStat = tryStatSync(file) |
| 1169 | if (fileStat?.isFile()) { |
| 1170 | return { path: getRealPath(file, preserveSymlinks), type: 'file' } |
| 1171 | } |
| 1172 | if (fileStat?.isDirectory()) { |
| 1173 | return { type: 'directory' } |
| 1174 | } |
| 1175 | return |
| 1176 | } |
| 1177 | |
| 1178 | function getRealPath(resolved: string, preserveSymlinks?: boolean): string { |
| 1179 | if (!preserveSymlinks) { |
no test coverage detected