(e: unknown)
| 146 | * Replaces the `(e as NodeJS.ErrnoException).path` cast pattern. |
| 147 | */ |
| 148 | export function getErrnoPath(e: unknown): string | undefined { |
| 149 | if (e && typeof e === 'object' && 'path' in e && typeof e.path === 'string') { |
| 150 | return e.path |
| 151 | } |
| 152 | return undefined |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Extract error message + top N stack frames from an unknown error. |
no outgoing calls
no test coverage detected