(poly: unknown)
| 60 | |
| 61 | export function isPoly(poly: unknown): poly is ChallengeFile { |
| 62 | function hasProperties(poly: unknown): poly is Record<string, unknown> { |
| 63 | return ( |
| 64 | !!poly && |
| 65 | typeof poly === 'object' && |
| 66 | 'contents' in poly && |
| 67 | 'name' in poly && |
| 68 | 'ext' in poly && |
| 69 | 'fileKey' in poly && |
| 70 | 'history' in poly |
| 71 | ); |
| 72 | } |
| 73 | |
| 74 | const hasCorrectTypes = (poly: Record<string, unknown>): boolean => |
| 75 | typeof poly.contents === 'string' && |