Safe nullish check with git-url-parse library responses

This commit is contained in:
Himanshu Mishra
2021-01-18 23:04:31 +01:00
parent baeed36324
commit 380dd626fb
3 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -129,11 +129,11 @@ export function getAzureCommitsUrl(url: string): string {
const ref = parsedUrl.searchParams.get('version')?.substr(2);
if (
empty !== '' ||
userOrOrg === '' ||
project === '' ||
!!empty ||
!userOrOrg ||
!project ||
srcKeyword !== '_git' ||
repoName === ''
!repoName
) {
throw new Error('Wrong Azure Devops URL');
}