MCPcopy Create free account
hub / github.com/TanStack/cli / handleSpecialURL

Function handleSpecialURL

packages/create/src/utils.ts:30–42  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

28
29// Turn GitHub URLs into raw URLs
30export 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
44export function hasDrive(path: string) {
45 return /^[A-Za-z]:/.test(path)

Callers 2

getRawRegistryFunction · 0.85
utils.test.tsFile · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected