(url: string)
| 28 | |
| 29 | // Turn GitHub URLs into raw URLs |
| 30 | export function handleSpecialURL(url: string) { |
| 31 | if (url.startsWith('https://github.com/') && url.includes('blob')) { |
| 32 | return url |
| 33 | .replace('https://github.com/', 'https://raw.githubusercontent.com/') |
| 34 | .replace('/blob/', '/refs/heads/') |
| 35 | } |
| 36 | if (url.startsWith('https://github.com/') && url.includes('tree')) { |
| 37 | return url |
| 38 | .replace('https://github.com/', 'https://raw.githubusercontent.com/') |
| 39 | .replace('/tree/', '/refs/heads/') |
| 40 | } |
| 41 | return url |
| 42 | } |
| 43 | |
| 44 | export function hasDrive(path: string) { |
| 45 | return /^[A-Za-z]:/.test(path) |
no test coverage detected