(
left: { device: TDevice; index: number },
right: { device: TDevice; index: number },
)
| 336 | } |
| 337 | |
| 338 | function compareAppleDevicesForSelection<TDevice extends DeviceInfo>( |
| 339 | left: { device: TDevice; index: number }, |
| 340 | right: { device: TDevice; index: number }, |
| 341 | ): number { |
| 342 | return ( |
| 343 | appleDeviceSelectionRank(left.device) - appleDeviceSelectionRank(right.device) || |
| 344 | Number(right.device.booted === true) - Number(left.device.booted === true) || |
| 345 | left.device.name.localeCompare(right.device.name) || |
| 346 | left.index - right.index |
| 347 | ); |
| 348 | } |
| 349 | |
| 350 | function appleDeviceSelectionRank(device: DeviceInfo): number { |
| 351 | if (device.kind === 'simulator') return appleTargetSelectionRank(device, 0, 1, 2, 3); |
no test coverage detected