Switch to `url-join`.
This commit is contained in:
Родитель
521a6a6f2d
Коммит
6083217cc0
|
@ -1,5 +1,5 @@
|
|||
import { join } from 'path-browserify'
|
||||
import { Region, Run } from 'sarif'
|
||||
import * as urlJoin from 'uri-join'
|
||||
|
||||
function getHostname(url: string | undefined): string | undefined {
|
||||
if (!url) return undefined
|
||||
|
@ -46,7 +46,9 @@ export function getRepoUri(uri: string | undefined, run: Run, region?: Region |
|
|||
// https://github.com/microsoft/sarif-web-component/blob/main/.gitignore
|
||||
// https://github.com/microsoft/sarif-web-component/blob/d14c42f18766159a7ef6fbb8858ab5ad4f0b532a/.gitignore
|
||||
// https://github.com/microsoft/sarif-web-component/blob/d14c42f18766159a7ef6fbb8858ab5ad4f0b532a/.gitignore#L1
|
||||
let repoUri = join(`${repositoryUri}/blob/${revisionId ?? 'main'}`, uri)
|
||||
// Note: path-browserify's path.join does does not preserve authority slashes
|
||||
// (ex: https://github.com becomes https:/github.com). Thus using url-join.
|
||||
let repoUri = urlJoin(`${repositoryUri}/blob/${revisionId ?? 'main'}`, uri)
|
||||
if (region?.startLine) { // `startLine` is 1-based.
|
||||
repoUri += `#L${region!.startLine}`
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
"@babel/preset-env": "^7.4.5",
|
||||
"@types/enzyme": "3.10.8",
|
||||
"@types/jest": "^24.0.13",
|
||||
"@types/path-browserify": "^1.0.0",
|
||||
"@types/react": "^16.8.18",
|
||||
"@types/react-dom": "^16.8.4",
|
||||
"@types/sarif": "^2.1.3",
|
||||
|
@ -50,9 +49,9 @@
|
|||
"mobx": "^5.9.4",
|
||||
"mobx-react": "^5.4.4",
|
||||
"mobx-utils": "^5.5.5",
|
||||
"path-browserify": "^0.0.1",
|
||||
"react-linkify": "^1.0.0-alpha",
|
||||
"react-markdown": "^4.0.8"
|
||||
"react-markdown": "^4.0.8",
|
||||
"uri-join": "^1.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.6",
|
||||
|
|
Загрузка…
Ссылка в новой задаче