Type guard to validate DeleteProjectCachePayload at runtime
(obj: unknown)
| 20 | |
| 21 | /** Type guard to validate DeleteProjectCachePayload at runtime */ |
| 22 | function isDeleteProjectCachePayload(obj: unknown): obj is DeleteProjectCachePayload { |
| 23 | return ( |
| 24 | obj != null && |
| 25 | typeof obj === 'object' && |
| 26 | 'owner' in obj && typeof (obj as Record<string, unknown>).owner === 'string' && ((obj as Record<string, unknown>).owner as string).trim() !== '' && |
| 27 | 'repo' in obj && typeof (obj as Record<string, unknown>).repo === 'string' && ((obj as Record<string, unknown>).repo as string).trim() !== '' && |
| 28 | 'repo_type' in obj && typeof (obj as Record<string, unknown>).repo_type === 'string' && ((obj as Record<string, unknown>).repo_type as string).trim() !== '' && |
| 29 | 'language' in obj && typeof (obj as Record<string, unknown>).language === 'string' && ((obj as Record<string, unknown>).language as string).trim() !== '' |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | // Ensure this matches your Python backend configuration |
| 34 | const PYTHON_BACKEND_URL = process.env.PYTHON_BACKEND_HOST || 'http://localhost:8001'; |