docs/libs/typescript.js
function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase) {
                // Make all paths absolute/normalized if they are not already
                rootDirs = ts.map(rootDirs, function (rootDirectory) { return ts.normalizePath(ts.isRootedDiskPath(rootDirectory) ? rootDirectory : ts.combinePaths(basePath, rootDirectory)); });
                // Determine the path to the directory containing the script relative to the root directory it is contained within
                var relativeDirectory;
                for (var _i = 0, rootDirs_1 = rootDirs; _i < rootDirs_1.length; _i++) {
                    var rootDirectory = rootDirs_1[_i];
                    if (ts.containsPath(rootDirectory, scriptPath, basePath, ignoreCase)) {
                        relativeDirectory = scriptPath.substr(rootDirectory.length);
                        break;
                    }
                }
                // Now find a path for each potential directory that is to be merged with the one containing the script
                return ts.deduplicate(ts.map(rootDirs, function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }));
            }
function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptPath, ignoreCase) {
                // Make all paths absolute/normalized if they are not already
                rootDirs = ts.map(rootDirs, function (rootDirectory) { return ts.normalizePath(ts.isRootedDiskPath(rootDirectory) ? rootDirectory : ts.combinePaths(basePath, rootDirectory)); });
                // Determine the path to the directory containing the script relative to the root directory it is contained within
                var relativeDirectory;
                for (var _i = 0, rootDirs_1 = rootDirs; _i < rootDirs_1.length; _i++) {
                    var rootDirectory = rootDirs_1[_i];
                    if (ts.containsPath(rootDirectory, scriptPath, basePath, ignoreCase)) {
                        relativeDirectory = scriptPath.substr(rootDirectory.length);
                        break;
                    }
                }
                // Now find a path for each potential directory that is to be merged with the one containing the script
                return ts.deduplicate(ts.map(rootDirs, function (rootDirectory) { return ts.combinePaths(rootDirectory, relativeDirectory); }));
            }
function getBaseDirectoriesFromRootDirs ( rootDirs , basePath , scriptPath , ignoreCase ) { // Make all paths absolute/normalized if they are not already rootDirs = ts . map ( rootDirs , function ( rootDirectory ) { return ts . normalizePath ( ts . isRootedDiskPath ( rootDirectory ) ? rootDirectory : ts . combinePaths ( basePath , rootDirectory ) ) ; } ) ; // Determine the path to the directory containing the script relative to the root directory it is contained within var relativeDirectory ; for ( var _i = 0 , rootDirs_1 = rootDirs ; _i < rootDirs_1 . length ; _i ++ ) { var rootDirectory = rootDirs_1 [ _i ] ; if ( ts . containsPath ( rootDirectory , scriptPath , basePath , ignoreCase ) ) { relativeDirectory = scriptPath . substr ( rootDirectory . length ) ; break ; } } // Now find a path for each potential directory that is to be merged with the one containing the script return ts . deduplicate ( ts . map ( rootDirs , function ( rootDirectory ) { return ts . combinePaths ( rootDirectory , relativeDirectory ) ; } ) ) ; }
Takes a script path and returns paths for all potential folders that could be merged with its
containing folder via the "rootDirs" compiler option
Takes a script path and returns paths for all potential folders that could be merged with its containing folder via the rootDirs compiler option