( bridgeResult: BridgeToolResult, remoteTool: string, )
| 137 | } |
| 138 | |
| 139 | export function toBridgeCallResultDomainResult( |
| 140 | bridgeResult: BridgeToolResult, |
| 141 | remoteTool: string, |
| 142 | ): XcodeBridgeCallResultDomainResult { |
| 143 | const payload = bridgeResult.payload?.kind === 'call-result' ? bridgeResult.payload : null; |
| 144 | |
| 145 | return { |
| 146 | kind: 'xcode-bridge-call-result', |
| 147 | remoteTool, |
| 148 | didError: Boolean(bridgeResult.isError), |
| 149 | error: bridgeResult.isError |
| 150 | ? (bridgeResult.errorMessage ?? `Tool "${remoteTool}" failed`) |
| 151 | : null, |
| 152 | succeeded: payload?.succeeded ?? !Boolean(bridgeResult.isError), |
| 153 | content: payload?.content ?? [], |
| 154 | ...(payload?.artifacts ? { artifacts: payload.artifacts } : {}), |
| 155 | }; |
| 156 | } |
| 157 | |
| 158 | function createFallbackBridgeStatus(error: string | null): XcodeBridgeStatusInfo { |
| 159 | return { |
no outgoing calls
no test coverage detected