(file: GitHubGistFile)
| 35 | } |
| 36 | |
| 37 | function getLanguage(file: GitHubGistFile): string { |
| 38 | if (typeof file.language === 'string' && file.language.trim()) { |
| 39 | return file.language.trim().toLowerCase().replace(/\s+/g, '_') |
| 40 | } |
| 41 | |
| 42 | if (typeof file.filename !== 'string') { |
| 43 | return 'plain_text' |
| 44 | } |
| 45 | |
| 46 | const extension = path.extname(file.filename).slice(1) |
| 47 | return extension || 'plain_text' |
| 48 | } |
| 49 | |
| 50 | function getSnippetName(gist: GitHubGistResponse, files: GitHubGistFile[]) { |
| 51 | if (typeof gist.description === 'string' && gist.description.trim()) { |
no outgoing calls
no test coverage detected