(e: unknown)
| 126 | * Replaces the `(e as NodeJS.ErrnoException).code` cast pattern. |
| 127 | */ |
| 128 | export function getErrnoCode(e: unknown): string | undefined { |
| 129 | if (e && typeof e === 'object' && 'code' in e && typeof e.code === 'string') { |
| 130 | return e.code |
| 131 | } |
| 132 | return undefined |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * True if the error is ENOENT (file or directory does not exist). |
no outgoing calls
no test coverage detected