* Returns the path to every node_modules/@types directory from some ancestor directory. * Returns undefined if there are none.
(currentDirectory, host)
| 42509 | * Returns undefined if there are none. |
| 42510 | */ |
| 42511 | function getDefaultTypeRoots(currentDirectory, host) { |
| 42512 | if (!host.directoryExists) { |
| 42513 | return [ts.combinePaths(currentDirectory, nodeModulesAtTypes)]; |
| 42514 | // And if it doesn't exist, tough. |
| 42515 | } |
| 42516 | var typeRoots; |
| 42517 | ts.forEachAncestorDirectory(ts.normalizePath(currentDirectory), function (directory) { |
| 42518 | var atTypes = ts.combinePaths(directory, nodeModulesAtTypes); |
| 42519 | if (host.directoryExists(atTypes)) { |
| 42520 | (typeRoots || (typeRoots = [])).push(atTypes); |
| 42521 | } |
| 42522 | return undefined; |
| 42523 | }); |
| 42524 | return typeRoots; |
| 42525 | } |
| 42526 | var nodeModulesAtTypes = ts.combinePaths("node_modules", "@types"); |
| 42527 | function arePathsEqual(path1, path2, host) { |
| 42528 | var useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames; |
no test coverage detected