aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2018-01-16 11:40:04 +0100
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2018-01-25 15:16:50 +0100
commite85902788fd722f1c17d214d8be15eea5cf276e0 (patch)
treec58b51adc94715ae56551be15e2d024d3efa3204 /server/sonar-web/src/main/js/helpers
parent84bbf9922fc00a714a2cbc9ebdb6175c0743ca79 (diff)
downloadsonarqube-e85902788fd722f1c17d214d8be15eea5cf276e0.tar.gz
sonarqube-e85902788fd722f1c17d214d8be15eea5cf276e0.zip
Make branch parameter optional in some helper functions
Diffstat (limited to 'server/sonar-web/src/main/js/helpers')
-rw-r--r--server/sonar-web/src/main/js/helpers/branches.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/helpers/branches.ts b/server/sonar-web/src/main/js/helpers/branches.ts
index 65e17cc0040..195b5a95a0e 100644
--- a/server/sonar-web/src/main/js/helpers/branches.ts
+++ b/server/sonar-web/src/main/js/helpers/branches.ts
@@ -20,16 +20,16 @@
import { sortBy } from 'lodash';
import { Branch, BranchType, ShortLivingBranch, LongLivingBranch } from '../app/types';
-export function isShortLivingBranch(branch: Branch | null): branch is ShortLivingBranch {
- return branch != null && !branch.isMain && branch.type === BranchType.SHORT;
+export function isShortLivingBranch(branch?: Branch): branch is ShortLivingBranch {
+ return branch !== undefined && !branch.isMain && branch.type === BranchType.SHORT;
}
-export function isLongLivingBranch(branch: Branch | null): branch is LongLivingBranch {
- return branch != null && !branch.isMain && branch.type === BranchType.LONG;
+export function isLongLivingBranch(branch?: Branch): branch is LongLivingBranch {
+ return branch !== undefined && !branch.isMain && branch.type === BranchType.LONG;
}
-export function getBranchName(branch: Branch): string | undefined {
- return branch.isMain ? undefined : branch.name;
+export function getBranchName(branch?: Branch): string | undefined {
+ return !branch || branch.isMain ? undefined : branch.name;
}
export function sortBranchesAsTree(branches: Branch[]): Branch[] {