(value: unknown)
| 545 | : defaultSettings.capture.recordingMode; |
| 546 | |
| 547 | const normalizeDevicePreference = (value: unknown): DevicePreference | null => { |
| 548 | if (!value || typeof value !== "object") return null; |
| 549 | const candidate = value as Partial<DevicePreference>; |
| 550 | if ( |
| 551 | typeof candidate.deviceId !== "string" || |
| 552 | candidate.deviceId.trim().length === 0 |
| 553 | ) { |
| 554 | return null; |
| 555 | } |
| 556 | |
| 557 | return { |
| 558 | deviceId: candidate.deviceId, |
| 559 | label: |
| 560 | typeof candidate.label === "string" && candidate.label.trim().length > 0 |
| 561 | ? candidate.label |
| 562 | : null, |
| 563 | groupId: |
| 564 | typeof candidate.groupId === "string" && |
| 565 | candidate.groupId.trim().length > 0 |
| 566 | ? candidate.groupId |
| 567 | : null, |
| 568 | updatedAt: |
| 569 | typeof candidate.updatedAt === "number" && |
| 570 | Number.isFinite(candidate.updatedAt) |
| 571 | ? candidate.updatedAt |
| 572 | : 0, |
| 573 | }; |
| 574 | }; |
| 575 | |
| 576 | const normalizeCapturePreferences = (value: unknown): CapturePreferences => { |
| 577 | const capture = |
no outgoing calls
no test coverage detected