mirror of
https://github.com/coder/code-server.git
synced 2026-05-05 03:55:18 +02:00
* Allow opening files at a specific line and column (fixes #5619) * Add isDirectory test
This commit is contained in:
@@ -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 '.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user