Simplify truthiness check

This commit is contained in:
Justin Hutchings
2024-03-12 21:49:01 +00:00
parent 72666694f0
commit f875e6ec1d
3 changed files with 5 additions and 17 deletions
Generated Vendored
+2 -6
View File
@@ -1040,17 +1040,13 @@ function getScorecardLevels(changes) {
repositoryUrl = repositoryUrl.replace('https://', '');
}
// If GitHub API doesn't have the repository URL, query deps.dev for it.
if (repositoryUrl === null ||
repositoryUrl === undefined ||
repositoryUrl === '') {
if (repositoryUrl) {
// Call the deps.dev API to get the repository URL from there
repositoryUrl = yield getProjectUrl(ecosystem, packageName, version);
}
// Get the scorecard API response from the scorecards API
let scorecardApi = null;
if (repositoryUrl !== null &&
repositoryUrl !== undefined &&
repositoryUrl !== '') {
if (repositoryUrl) {
try {
scorecardApi = yield getScorecard(repositoryUrl);
}
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long