(event: IpcMainEvent | IpcMainInvokeEvent)
| 760 | } |
| 761 | |
| 762 | function assertTrustedIpcEvent(event: IpcMainEvent | IpcMainInvokeEvent): void { |
| 763 | if (!isTrustedIpcSender(event.sender)) { |
| 764 | throw new Error('Blocked IPC call from an untrusted renderer.') |
| 765 | } |
| 766 | } |
| 767 | |
| 768 | function clamp(value: number, min: number, max: number): number { |
| 769 | return Math.min(Math.max(value, min), max) |
no test coverage detected