(value: unknown)
| 15 | * Checks if a value matches the minimal UserFile shape. |
| 16 | */ |
| 17 | export function isUserFile(value: unknown): value is UserFileLike { |
| 18 | if (!value || typeof value !== 'object') { |
| 19 | return false |
| 20 | } |
| 21 | |
| 22 | const candidate = value as Record<string, unknown> |
| 23 | |
| 24 | return ( |
| 25 | typeof candidate.id === 'string' && |
| 26 | typeof candidate.key === 'string' && |
| 27 | typeof candidate.url === 'string' && |
| 28 | typeof candidate.name === 'string' |
| 29 | ) |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Checks if a value matches the full UserFile metadata shape. |
no outgoing calls
no test coverage detected