@ts-morph/bootstrap
Advanced tools
Comparing version 0.12.0 to 0.12.1
@@ -57,4 +57,7 @@ import { DocumentRegistry, ts, StringUtils, FileUtils, Memoize, TransactionalFileSystem, TsConfigResolver, errors, InMemoryFileSystemHost, RealFileSystemHost, CompilerOptionsContainer, createHosts, runtime, createModuleResolutionHost } from '@ts-morph/common'; | ||
let sourceFile = this.sourceFilesByFilePath.get(filePath); | ||
if (sourceFile == null && await this.fileSystemWrapper.fileExists(filePath)) { | ||
sourceFile = this.createSourceFileFromText(filePath, await this.fileSystemWrapper.readFile(filePath, this.compilerOptions.getEncoding()), options); | ||
if (sourceFile == null) { | ||
const fileText = await this.fileSystemWrapper.readFileIfExists(filePath, this.compilerOptions.getEncoding()); | ||
if (fileText != null) { | ||
sourceFile = this.createSourceFileFromText(filePath, fileText, options); | ||
} | ||
} | ||
@@ -65,4 +68,7 @@ return sourceFile; | ||
let sourceFile = this.sourceFilesByFilePath.get(filePath); | ||
if (sourceFile == null && this.fileSystemWrapper.fileExistsSync(filePath)) { | ||
sourceFile = this.createSourceFileFromText(filePath, this.fileSystemWrapper.readFileSync(filePath, this.compilerOptions.getEncoding()), options); | ||
if (sourceFile == null) { | ||
const fileText = this.fileSystemWrapper.readFileIfExistsSync(filePath, this.compilerOptions.getEncoding()); | ||
if (fileText != null) { | ||
sourceFile = this.createSourceFileFromText(filePath, fileText, options); | ||
} | ||
} | ||
@@ -69,0 +75,0 @@ return sourceFile; |
@@ -60,4 +60,7 @@ 'use strict'; | ||
let sourceFile = this.sourceFilesByFilePath.get(filePath); | ||
if (sourceFile == null && await this.fileSystemWrapper.fileExists(filePath)) { | ||
sourceFile = this.createSourceFileFromText(filePath, await this.fileSystemWrapper.readFile(filePath, this.compilerOptions.getEncoding()), options); | ||
if (sourceFile == null) { | ||
const fileText = await this.fileSystemWrapper.readFileIfExists(filePath, this.compilerOptions.getEncoding()); | ||
if (fileText != null) { | ||
sourceFile = this.createSourceFileFromText(filePath, fileText, options); | ||
} | ||
} | ||
@@ -68,4 +71,7 @@ return sourceFile; | ||
let sourceFile = this.sourceFilesByFilePath.get(filePath); | ||
if (sourceFile == null && this.fileSystemWrapper.fileExistsSync(filePath)) { | ||
sourceFile = this.createSourceFileFromText(filePath, this.fileSystemWrapper.readFileSync(filePath, this.compilerOptions.getEncoding()), options); | ||
if (sourceFile == null) { | ||
const fileText = this.fileSystemWrapper.readFileIfExistsSync(filePath, this.compilerOptions.getEncoding()); | ||
if (fileText != null) { | ||
sourceFile = this.createSourceFileFromText(filePath, fileText, options); | ||
} | ||
} | ||
@@ -72,0 +78,0 @@ return sourceFile; |
@@ -56,5 +56,9 @@ import { RuntimeDirEntry, ts } from "@ts-morph/common"; | ||
copySync(srcPath: string, destPath: string): void; | ||
/** Asynchronously checks if a file exists. */ | ||
/** Asynchronously checks if a file exists. | ||
* @remarks Implementers should throw an `errors.FileNotFoundError` when it does not exist. | ||
*/ | ||
fileExists(filePath: string): Promise<boolean>; | ||
/** Synchronously checks if a file exists. */ | ||
/** Synchronously checks if a file exists. | ||
* @remarks Implementers should throw an `errors.FileNotFoundError` when it does not exist. | ||
*/ | ||
fileExistsSync(filePath: string): boolean; | ||
@@ -61,0 +65,0 @@ /** Asynchronously checks if a directory exists. */ |
{ | ||
"name": "@ts-morph/bootstrap", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "API for getting quickly set up with the TypeScript Compiler API.", | ||
@@ -23,3 +23,3 @@ "keywords": ["typescript", "compiler", "bootstrap"], | ||
"dependencies": { | ||
"@ts-morph/common": "~0.12.0" | ||
"@ts-morph/common": "~0.12.1" | ||
}, | ||
@@ -26,0 +26,0 @@ "devDependencies": { |
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
63163
1155
Updated@ts-morph/common@~0.12.1