(value: unknown)
| 93 | } |
| 94 | |
| 95 | export function normalizeDevice(value: unknown): AgentDeviceDevice { |
| 96 | const { record, platform, id, name, target } = readClientDeviceIdentity(value, 'name'); |
| 97 | const appleOs = readAppleOs(record); |
| 98 | return { |
| 99 | platform, |
| 100 | target, |
| 101 | kind: readRequiredDeviceKind(record, 'kind'), |
| 102 | id, |
| 103 | name, |
| 104 | booted: typeof record.booted === 'boolean' ? record.booted : undefined, |
| 105 | // Additive Apple-OS discriminant; Apple platforms only — gate on the platform so |
| 106 | // a non-Apple record with a stray appleOs value is not preserved. |
| 107 | ...(isApplePlatform(platform) && appleOs ? { appleOs } : {}), |
| 108 | identifiers: buildDeviceIdentifiers(platform, id, name), |
| 109 | ...buildClientDevicePlatformFields(platform, id), |
| 110 | }; |
| 111 | } |
| 112 | |
| 113 | export function normalizeSession(value: unknown): AgentDeviceSession { |
| 114 | const { record, platform, id, name, target } = readClientDeviceIdentity(value, 'name'); |
no test coverage detected