Function
getDefaultDeviceIndex
(devices: SetupDevice[], existingDeviceId?: string)
Source from the content-addressed store, hash-verified
| 787 | } |
| 788 | |
| 789 | function getDefaultDeviceIndex(devices: SetupDevice[], existingDeviceId?: string): number { |
| 790 | if (existingDeviceId != null) { |
| 791 | const existingIndex = devices.findIndex((device) => device.udid === existingDeviceId); |
| 792 | if (existingIndex >= 0) { |
| 793 | return existingIndex; |
| 794 | } |
| 795 | } |
| 796 | |
| 797 | return 0; |
| 798 | } |
| 799 | |
| 800 | async function selectDevice(opts: { |
| 801 | existingDeviceId?: string; |
Tested by
no test coverage detected