Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

611 B
Raw Blame
import type { PRRefreshOutcome } from './pull-request-refresh-types'
import type { PRInfo } from './pull-request-types'

export type GitHubPRForBranchResponse = PRRefreshOutcome | PRInfo | null

// Legacy hosts return PRInfo|null; current hosts return a classified refresh outcome.
export function normalizeGitHubPRForBranchOutcome(
  response: GitHubPRForBranchResponse,
  fetchedAt = Date.now()
): PRRefreshOutcome {
  if (response && typeof response === 'object' && 'kind' in response) {
    return response
  }
  return response ? { kind: 'found', pr: response, fetchedAt } : { kind: 'no-pr', fetchedAt }
}