* Check if the repository designated by the owner and name exists and can be * accessed by the given account.
( account: Account, owner: string, name: string )
| 14 | * accessed by the given account. |
| 15 | */ |
| 16 | async function canAccessRepositoryUsingAPI( |
| 17 | account: Account, |
| 18 | owner: string, |
| 19 | name: string |
| 20 | ): Promise<boolean> { |
| 21 | const api = API.fromAccount(account) |
| 22 | const repository = await api.fetchRepository(owner, name) |
| 23 | if (repository) { |
| 24 | return true |
| 25 | } else { |
| 26 | return false |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Find the GitHub account associated with a given remote URL. |
nothing calls this directly
no test coverage detected