| 193 | } |
| 194 | |
| 195 | function filterSimulatorsByPlatforms( |
| 196 | simulators: ListedSimulator[], |
| 197 | platforms: SetupPlatform[], |
| 198 | ): ListedSimulator[] { |
| 199 | const nonMacPlatforms = platforms.filter((p) => p !== 'macOS') as Exclude< |
| 200 | SetupPlatform, |
| 201 | 'macOS' |
| 202 | >[]; |
| 203 | if (nonMacPlatforms.length !== 1) return simulators; |
| 204 | |
| 205 | const keywords = SIMULATOR_RUNTIME_KEYWORDS[nonMacPlatforms[0]]; |
| 206 | const filtered = simulators.filter((sim) => |
| 207 | keywords.some((keyword) => sim.runtime.includes(keyword)), |
| 208 | ); |
| 209 | return filtered.length > 0 ? filtered : simulators; |
| 210 | } |
| 211 | |
| 212 | function getWorkflowOptions( |
| 213 | debug: boolean, |