Function
tryReadFilePath
(filePath: string | vscode.Uri)
Source from the content-addressed store, hash-verified
| 292 | * @returns Returns the file content as a string or null if the file does not exist |
| 293 | */ |
| 294 | export const tryReadFilePath = async (filePath: string | vscode.Uri) => { |
| 295 | const location = typeof filePath === "string" ? vscode.Uri.file(filePath) : filePath; |
| 296 | try { |
| 297 | await vscode.workspace.fs.readFile(location); |
| 298 | return location; |
| 299 | } catch (e) { |
| 300 | return null; |
| 301 | } |
| 302 | }; |
| 303 | |
| 304 | export const isTSConfigExists = async (rootDir: vscode.Uri) => { |
| 305 | try { |
Tested by
no test coverage detected