@definitelytyped/utils
Advanced tools
Comparing version 0.0.150 to 0.0.151-next.3
@@ -25,3 +25,3 @@ /** Convert a path to use "/" instead of "\\" for consistency. (This affects content hash.) */ | ||
} | ||
export declare function createModuleResolutionHost(fs: FS): import("typescript").ModuleResolutionHost; | ||
export declare function createModuleResolutionHost(fs: FS, ignoreFilesAboveDirectory?: string): import("typescript").ModuleResolutionHost; | ||
interface ReadonlyDir extends ReadonlyMap<string, ReadonlyDir | string> { | ||
@@ -28,0 +28,0 @@ readonly parent: Dir | undefined; |
@@ -26,7 +26,7 @@ "use strict"; | ||
exports.joinPaths = joinPaths; | ||
function createModuleResolutionHost(fs) { | ||
function createModuleResolutionHost(fs, ignoreFilesAboveDirectory) { | ||
return { | ||
fileExists: (filename) => fs.exists(filename), | ||
readFile: (filename) => fs.readFile(filename), | ||
directoryExists: (directoryName) => fs.exists(directoryName), | ||
fileExists: (fileName) => !isIgnored(fileName) && fs.exists(fileName), | ||
readFile: (fileName) => ((0, assert_1.default)(!isIgnored(fileName)), fs.readFile(fileName)), | ||
directoryExists: (directoryName) => !isIgnored(directoryName) && fs.exists(directoryName), | ||
getCurrentDirectory: () => "", | ||
@@ -36,2 +36,7 @@ realpath: (path) => path, | ||
}; | ||
function isIgnored(path) { | ||
return (ignoreFilesAboveDirectory !== undefined && | ||
path !== ignoreFilesAboveDirectory && | ||
!path.startsWith(ignoreFilesAboveDirectory)); | ||
} | ||
} | ||
@@ -38,0 +43,0 @@ exports.createModuleResolutionHost = createModuleResolutionHost; |
{ | ||
"name": "@definitelytyped/utils", | ||
"version": "0.0.150", | ||
"version": "0.0.151-next.3", | ||
"description": "Shared utilities for DefinitelyTyped tools", | ||
@@ -39,3 +39,3 @@ "homepage": "https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/utils#readme", | ||
}, | ||
"gitHead": "8b1269bbe3045cdfa8d0810a41f014a83f722de5" | ||
"gitHead": "fa74745d660bf613ebcc03da4a67cbb3afcdb524" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
130809
1960