(obj: unknown)
| 146 | |
| 147 | /** Whether the given object corresponds to an Octokit API request error. */ |
| 148 | export function isGithubApiError(obj: unknown): obj is RequestError { |
| 149 | return ( |
| 150 | obj instanceof Error && |
| 151 | // Note: Cannot use `instanceof` here because Octokit may use a different |
| 152 | // version of `@octokit/request-error` due to version mismatch/hoisting. |
| 153 | obj.constructor.name === 'RequestError' && |
| 154 | (obj as Partial<RequestError>).request !== undefined |
| 155 | ); |
| 156 | } |
no outgoing calls
no test coverage detected