(reason: string | null)
| 387 | } |
| 388 | |
| 389 | function readOnlyRefusal(reason: string | null): ApiError { |
| 390 | return new ApiError( |
| 391 | 'refused', |
| 392 | reason ?? 'This viewer is running read-only, so trails cannot be saved.', |
| 393 | `Restart without --read-only to let the viewer write trails into ${TRAILS_RELATIVE_DIR}.` |
| 394 | ); |
| 395 | } |
| 396 | |
| 397 | function parseSaveRequest(body: unknown): { name: string; note: string; hops: SaveTrailRequest['hops'] } { |
| 398 | if (typeof body !== 'object' || body === null || Array.isArray(body)) { |
no outgoing calls
no test coverage detected