(gist: GitHubGistResponse)
| 64 | } |
| 65 | |
| 66 | function getGistFiles(gist: GitHubGistResponse): GitHubGistFile[] { |
| 67 | if ( |
| 68 | !gist.files |
| 69 | || typeof gist.files !== 'object' |
| 70 | || Array.isArray(gist.files) |
| 71 | ) { |
| 72 | return [] |
| 73 | } |
| 74 | |
| 75 | return Object.values(gist.files).filter( |
| 76 | (file): file is GitHubGistFile => |
| 77 | !!file && typeof file === 'object' && !Array.isArray(file), |
| 78 | ) |
| 79 | } |
| 80 | |
| 81 | const GIST_FETCH_TIMEOUT_MS = 15_000 |
| 82 |
no outgoing calls
no test coverage detected