mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix: check if defined before includes
This commit is contained in:
parent
bb7e8b97c1
commit
4b59bedaae
1 changed files with 3 additions and 4 deletions
|
@ -114,14 +114,13 @@ export function addMetaData(
|
||||||
};
|
};
|
||||||
|
|
||||||
if (
|
if (
|
||||||
dep.changelogUrl &&
|
dep.changelogUrl?.includes('github.com') && // lgtm [js/incomplete-url-substring-sanitization]
|
||||||
dep.changelogUrl.includes('github.com') && // lgtm [js/incomplete-url-substring-sanitization]
|
|
||||||
!dep.sourceUrl
|
!dep.sourceUrl
|
||||||
) {
|
) {
|
||||||
dep.sourceUrl = dep.changelogUrl;
|
dep.sourceUrl = dep.changelogUrl;
|
||||||
}
|
}
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
if (dep.homepage && dep.homepage.includes('github.com')) { // lgtm [js/incomplete-url-substring-sanitization]
|
if (dep.homepage?.includes('github.com')) { // lgtm [js/incomplete-url-substring-sanitization]
|
||||||
if (!dep.sourceUrl) {
|
if (!dep.sourceUrl) {
|
||||||
dep.sourceUrl = dep.homepage;
|
dep.sourceUrl = dep.homepage;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +133,7 @@ export function addMetaData(
|
||||||
});
|
});
|
||||||
extraBaseUrls.push('gitlab.com');
|
extraBaseUrls.push('gitlab.com');
|
||||||
if (dep.sourceUrl) {
|
if (dep.sourceUrl) {
|
||||||
if (URL.parse(dep.sourceUrl).hostname.includes('gitlab')) {
|
if (URL.parse(dep.sourceUrl).hostname?.includes('gitlab')) {
|
||||||
// try massaging it
|
// try massaging it
|
||||||
dep.sourceUrl =
|
dep.sourceUrl =
|
||||||
parse(massageGitlabUrl(dep.sourceUrl), {
|
parse(massageGitlabUrl(dep.sourceUrl), {
|
||||||
|
|
Loading…
Reference in a new issue