File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ interface DirectoryUrl extends BaseUrl {
1616
1717interface FileUrl extends BaseUrl {
1818 kind : 'file'
19- action ?: 'blob' | 'raw/refs/heads'
19+ action ?: 'blob' | 'raw' | 'raw /refs/heads'
2020 resolveUrl : string
2121}
2222
@@ -226,7 +226,7 @@ export function parseGitHubUrl(url: string): GHUrl {
226226 // https://github.com/apache/parquet-testing/blob/master/variant/README.md
227227 // https://github.com/apache/parquet-testing/raw/refs/heads/master/variant/README.md
228228 const fileGroups =
229- / ^ \/ (?< owner > [ ^ / ] + ) \/ (?< repo > [ ^ / ] + ) \/ (?< action > b l o b | r e f s \/ h e a d s | r a w \/ r e f s \/ h e a d s ) \/ (?< branch > [ ^ / ] + ) (?< path > ( \/ [ ^ / ] + ) + ) $ / . exec (
229+ / ^ \/ (?< owner > [ ^ / ] + ) \/ (?< repo > [ ^ / ] + ) \/ (?< action > b l o b | r a w | r a w \/ r e f s \/ h e a d s ) \/ (?< branch > [ ^ / ] + ) (?< path > ( \/ [ ^ / ] + ) + ) $ / . exec (
230230 pathname
231231 ) ?. groups
232232 if (
@@ -243,10 +243,10 @@ export function parseGitHubUrl(url: string): GHUrl {
243243 source,
244244 origin : urlObject . origin ,
245245 repo : fileGroups . owner + '/' + fileGroups . repo ,
246- action : fileGroups . action === 'blob' ? 'blob' : 'raw/refs/heads' ,
246+ action : fileGroups . action === 'blob' ? 'blob' : fileGroups . action === 'raw' ? 'raw' : 'raw/refs/heads' ,
247247 branch,
248248 path : fileGroups . path ,
249- resolveUrl : `${ baseRawUrl } /${ fileGroups . owner } /${ fileGroups . repo } /refs/heads/ ${ branch } ${ fileGroups . path } ` ,
249+ resolveUrl : `${ baseRawUrl } /${ fileGroups . owner } /${ fileGroups . repo } /${ branch } ${ fileGroups . path } ` ,
250250 }
251251 }
252252
You can’t perform that action at this time.
0 commit comments