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