(fileOrDirectory, isFile)
| 119365 | }); |
| 119366 | } |
| 119367 | function fileOrDirectoryExistsUsingSource(fileOrDirectory, isFile) { |
| 119368 | var _a; |
| 119369 | var fileOrDirectoryExistsUsingSource = isFile ? |
| 119370 | function (file) { return fileExistsIfProjectReferenceDts(file); } : |
| 119371 | function (dir) { return directoryExistsIfProjectReferenceDeclDir(dir); }; |
| 119372 | // Check current directory or file |
| 119373 | var result = fileOrDirectoryExistsUsingSource(fileOrDirectory); |
| 119374 | if (result !== undefined) |
| 119375 | return result; |
| 119376 | var symlinkCache = host.getSymlinkCache(); |
| 119377 | var symlinkedDirectories = symlinkCache.getSymlinkedDirectories(); |
| 119378 | if (!symlinkedDirectories) |
| 119379 | return false; |
| 119380 | var fileOrDirectoryPath = host.toPath(fileOrDirectory); |
| 119381 | if (!ts.stringContains(fileOrDirectoryPath, ts.nodeModulesPathPart)) |
| 119382 | return false; |
| 119383 | if (isFile && ((_a = symlinkCache.getSymlinkedFiles()) === null || _a === void 0 ? void 0 : _a.has(fileOrDirectoryPath))) |
| 119384 | return true; |
| 119385 | // If it contains node_modules check if its one of the symlinked path we know of |
| 119386 | return ts.firstDefinedIterator(symlinkedDirectories.entries(), function (_a) { |
| 119387 | var directoryPath = _a[0], symlinkedDirectory = _a[1]; |
| 119388 | if (!symlinkedDirectory || !ts.startsWith(fileOrDirectoryPath, directoryPath)) |
| 119389 | return undefined; |
| 119390 | var result = fileOrDirectoryExistsUsingSource(fileOrDirectoryPath.replace(directoryPath, symlinkedDirectory.realPath)); |
| 119391 | if (isFile && result) { |
| 119392 | // Store the real path for the file' |
| 119393 | var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory()); |
| 119394 | symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), ""))); |
| 119395 | } |
| 119396 | return result; |
| 119397 | }) || false; |
| 119398 | } |
| 119399 | } |
| 119400 | /*@internal*/ |
| 119401 | ts.emitSkippedWithNoDiagnostics = { diagnostics: ts.emptyArray, sourceMaps: undefined, emittedFiles: undefined, emitSkipped: true }; |
no test coverage detected
searching dependent graphs…