(value: unknown)
| 741 | }; |
| 742 | |
| 743 | const normalizeOverlayPosition = (value: unknown): OverlayPosition | null => { |
| 744 | if (!value || typeof value !== "object") return null; |
| 745 | const candidate = value as Partial<OverlayPosition>; |
| 746 | if ( |
| 747 | typeof candidate.x !== "number" || |
| 748 | typeof candidate.y !== "number" || |
| 749 | typeof candidate.viewportWidth !== "number" || |
| 750 | typeof candidate.viewportHeight !== "number" || |
| 751 | typeof candidate.updatedAt !== "number" || |
| 752 | !Number.isFinite(candidate.x) || |
| 753 | !Number.isFinite(candidate.y) || |
| 754 | !Number.isFinite(candidate.viewportWidth) || |
| 755 | !Number.isFinite(candidate.viewportHeight) || |
| 756 | !Number.isFinite(candidate.updatedAt) |
| 757 | ) { |
| 758 | return null; |
| 759 | } |
| 760 | |
| 761 | return { |
| 762 | x: candidate.x, |
| 763 | y: candidate.y, |
| 764 | viewportWidth: Math.max(1, candidate.viewportWidth), |
| 765 | viewportHeight: Math.max(1, candidate.viewportHeight), |
| 766 | updatedAt: candidate.updatedAt, |
| 767 | }; |
| 768 | }; |
| 769 | |
| 770 | const RECORDING_PHASES = new Set([ |
| 771 | "idle", |
no outgoing calls
no test coverage detected