(value: string)
| 22 | } |
| 23 | |
| 24 | function getGistId(value: string): string | null { |
| 25 | const trimmed = value.trim() |
| 26 | |
| 27 | if (/^[\da-f]{20,64}$/i.test(trimmed)) { |
| 28 | return trimmed |
| 29 | } |
| 30 | |
| 31 | const match = trimmed.match( |
| 32 | /gist\.github\.com\/(?:[^/]+\/)?([\da-f]{20,64})/i, |
| 33 | ) |
| 34 | return match?.[1] ?? null |
| 35 | } |
| 36 | |
| 37 | function getLanguage(file: GitHubGistFile): string { |
| 38 | if (typeof file.language === 'string' && file.language.trim()) { |
no outgoing calls
no test coverage detected