Allow opening files at a specific line and column (fixes #5619) (#5620)

* Allow opening files at a specific line and column (fixes #5619)

* Add isDirectory test
This commit is contained in:
Daniil Gentili
2022-10-06 20:12:21 +02:00
committed by GitHub
parent 3a9eb312b1
commit b562d4a880
3 changed files with 39 additions and 6 deletions

View File

@@ -482,6 +482,15 @@ export const isFile = async (path: string): Promise<boolean> => {
}
}
export const isDirectory = async (path: string): Promise<boolean> => {
try {
const stat = await fs.stat(path)
return stat.isDirectory()
} catch (error) {
return false
}
}
/**
* Escapes any HTML string special characters, like &, <, >, ", and '.
*