Update based on feedback
This commit is contained in:
Родитель
a99c04e8f9
Коммит
b66b752561
|
@ -2736,7 +2736,7 @@ namespace ts {
|
|||
function fileExists(fileName: string): boolean {
|
||||
const path = toPath(fileName);
|
||||
const result = getCachedFileSystemEntriesForBaseDir(path);
|
||||
return (result && hasEntry(result.files, getBaseNameOfFileName(fileName))) ||
|
||||
return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) ||
|
||||
host.fileExists(fileName);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,9 @@ namespace ts {
|
|||
mtime?: Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Partial interface of the System thats needed to support the caching of directory structure
|
||||
*/
|
||||
export interface PartialSystem {
|
||||
writeFile(path: string, data: string, writeByteOrderMark?: boolean): void;
|
||||
fileExists(path: string): boolean;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace ts {
|
||||
function verifyMissingFilePaths(missingPaths: ReadonlyArray<Path>, expected: ReadonlyArray<string>) {
|
||||
assert.isDefined(missingPaths);
|
||||
const map = arrayToMap(expected, k => k, _v => true);
|
||||
const map = arrayToSet(expected) as Map<boolean>;
|
||||
for (const missing of missingPaths) {
|
||||
const value = map.get(missing);
|
||||
assert.isTrue(value, `${missing} to be ${value === undefined ? "not present" : "present only once"}, in actual: ${missingPaths} expected: ${expected}`);
|
||||
|
|
Загрузка…
Ссылка в новой задаче