This commit is contained in:
Jeff King 2022-10-07 15:10:31 -07:00
Родитель 521a6a6f2d
Коммит 6083217cc0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 5E5F5F7EAAF929E4
2 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -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",