(value: unknown)
| 71 | * ``` |
| 72 | */ |
| 73 | export function assertFp(value: unknown): asserts value is FarthestPoint { |
| 74 | if ( |
| 75 | value == null || |
| 76 | typeof value !== "object" || |
| 77 | typeof (value as FarthestPoint)?.y !== "number" || |
| 78 | typeof (value as FarthestPoint)?.id !== "number" |
| 79 | ) { |
| 80 | throw new Error( |
| 81 | `Unexpected value, expected 'FarthestPoint': received ${typeof value}`, |
| 82 | ); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Creates an array of backtraced differences. |