docs/libs/typescript.js
function getBasePaths(path, includes, useCaseSensitiveFileNames) {
        // Storage for our results in the form of literal paths (e.g. the paths as written by the user).
        var basePaths = [path];
        if (includes) {
            // Storage for literal base paths amongst the include patterns.
            var includeBasePaths = [];
            for (var _i = 0, includes_1 = includes; _i < includes_1.length; _i++) {
                var include = includes_1[_i];
                // We also need to check the relative paths by converting them to absolute and normalizing
                // in case they escape the base path (e.g "..\somedirectory")
                var absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include));
                var wildcardOffset = indexOfAnyCharCode(absolute, wildcardCharCodes);
                var includeBasePath = wildcardOffset < 0
                    ? removeTrailingDirectorySeparator(getDirectoryPath(absolute))
                    : absolute.substring(0, absolute.lastIndexOf(ts.directorySeparator, wildcardOffset));
                // Append the literal and canonical candidate base paths.
                includeBasePaths.push(includeBasePath);
            }
            // Sort the offsets array using either the literal or canonical path representations.
            includeBasePaths.sort(useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive);
            // Iterate over each include base path and include unique base paths that are not a
            // subpath of an existing base path
            include: for (var i = 0; i < includeBasePaths.length; i++) {
                var includeBasePath = includeBasePaths[i];
                for (var j = 0; j < basePaths.length; j++) {
                    if (containsPath(basePaths[j], includeBasePath, path, !useCaseSensitiveFileNames)) {
                        continue include;
                    }
                }
                basePaths.push(includeBasePath);
            }
        }
        return basePaths;
    }
function getBasePaths(path, includes, useCaseSensitiveFileNames) {
        // Storage for our results in the form of literal paths (e.g. the paths as written by the user).
        var basePaths = [path];
        if (includes) {
            // Storage for literal base paths amongst the include patterns.
            var includeBasePaths = [];
            for (var _i = 0, includes_1 = includes; _i < includes_1.length; _i++) {
                var include = includes_1[_i];
                // We also need to check the relative paths by converting them to absolute and normalizing
                // in case they escape the base path (e.g "..\somedirectory")
                var absolute = isRootedDiskPath(include) ? include : normalizePath(combinePaths(path, include));
                var wildcardOffset = indexOfAnyCharCode(absolute, wildcardCharCodes);
                var includeBasePath = wildcardOffset < 0
                    ? removeTrailingDirectorySeparator(getDirectoryPath(absolute))
                    : absolute.substring(0, absolute.lastIndexOf(ts.directorySeparator, wildcardOffset));
                // Append the literal and canonical candidate base paths.
                includeBasePaths.push(includeBasePath);
            }
            // Sort the offsets array using either the literal or canonical path representations.
            includeBasePaths.sort(useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive);
            // Iterate over each include base path and include unique base paths that are not a
            // subpath of an existing base path
            include: for (var i = 0; i < includeBasePaths.length; i++) {
                var includeBasePath = includeBasePaths[i];
                for (var j = 0; j < basePaths.length; j++) {
                    if (containsPath(basePaths[j], includeBasePath, path, !useCaseSensitiveFileNames)) {
                        continue include;
                    }
                }
                basePaths.push(includeBasePath);
            }
        }
        return basePaths;
    }
function getBasePaths ( path , includes , useCaseSensitiveFileNames ) { // Storage for our results in the form of literal paths (e.g. the paths as written by the user). var basePaths = [ path ] ; if ( includes ) { // Storage for literal base paths amongst the include patterns. var includeBasePaths = [ ] ; for ( var _i = 0 , includes_1 = includes ; _i < includes_1 . length ; _i ++ ) { var include = includes_1 [ _i ] ; // We also need to check the relative paths by converting them to absolute and normalizing // in case they escape the base path (e.g "..\somedirectory") var absolute = isRootedDiskPath ( include ) ? include : normalizePath ( combinePaths ( path , include ) ) ; var wildcardOffset = indexOfAnyCharCode ( absolute , wildcardCharCodes ) ; var includeBasePath = wildcardOffset < 0 ? removeTrailingDirectorySeparator ( getDirectoryPath ( absolute ) ) : absolute . substring ( 0 , absolute . lastIndexOf ( ts . directorySeparator , wildcardOffset ) ) ; // Append the literal and canonical candidate base paths. includeBasePaths . push ( includeBasePath ) ; } // Sort the offsets array using either the literal or canonical path representations. includeBasePaths . sort ( useCaseSensitiveFileNames ? compareStrings : compareStringsCaseInsensitive ) ; // Iterate over each include base path and include unique base paths that are not a // subpath of an existing base path include : for ( var i = 0 ; i < includeBasePaths . length ; i ++ ) { var includeBasePath = includeBasePaths [ i ] ; for ( var j = 0 ; j < basePaths . length ; j ++ ) { if ( containsPath ( basePaths [ j ] , includeBasePath , path , ! useCaseSensitiveFileNames ) ) { continue include ; } } basePaths . push ( includeBasePath ) ; } } return basePaths ; }
Computes the unique non-wildcard base paths amongst the provided include patterns.
Computes the unique non - wildcard base paths amongst the provided include patterns .