* Return the Stats of a file/symlink if it exists, otherwise returns null. * Rethrows errors that aren't related to file existence. * * @param {string} filename - The path to the file or symlink. * @returns {Promise } - The stats object, or `null` if the file doesn't exist.
(filename)
| 265 | * @returns {Promise<Object|null>} - The stats object, or `null` if the file doesn't exist. |
| 266 | */ |
| 267 | async lstat(filename) { |
| 268 | try { |
| 269 | const stats = await this._lstat(filename) |
| 270 | return stats |
| 271 | } catch (err) { |
| 272 | if (err.code === 'ENOENT' || (err.code || '').includes('ENS')) { |
| 273 | return null |
| 274 | } |
| 275 | throw err |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * Reads the contents of a symlink if it exists, otherwise returns null. |
no outgoing calls
no test coverage detected