( executor: CommandExecutor, simulatorId: string | undefined, simulatorName: string | undefined, )
| 90 | * If only simulatorName is provided, resolves it via simctl. |
| 91 | */ |
| 92 | export async function resolveSimulatorIdOrName( |
| 93 | executor: CommandExecutor, |
| 94 | simulatorId: string | undefined, |
| 95 | simulatorName: string | undefined, |
| 96 | ): Promise<SimulatorResolutionResult> { |
| 97 | if (simulatorId) { |
| 98 | return { |
| 99 | success: true, |
| 100 | simulatorId, |
| 101 | simulatorName: simulatorName ?? simulatorId, |
| 102 | }; |
| 103 | } |
| 104 | |
| 105 | if (simulatorName) { |
| 106 | return resolveSimulatorNameToId(executor, simulatorName); |
| 107 | } |
| 108 | |
| 109 | return { |
| 110 | success: false, |
| 111 | error: 'Either simulatorId or simulatorName must be provided.', |
| 112 | }; |
| 113 | } |
no test coverage detected