From 1ab04f85ada3eb38e57c64f08d6340ff7a7c0c52 Mon Sep 17 00:00:00 2001 From: Christian Dupuis Date: Sat, 18 May 2019 00:28:22 +0200 Subject: [PATCH] More falsey assertion fixes --- .../rendering/PullRequestActionContributors.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/handlers/event/pullrequest/rendering/PullRequestActionContributors.ts b/lib/handlers/event/pullrequest/rendering/PullRequestActionContributors.ts index f24022a..ec34ae4 100644 --- a/lib/handlers/event/pullrequest/rendering/PullRequestActionContributors.ts +++ b/lib/handlers/event/pullrequest/rendering/PullRequestActionContributors.ts @@ -58,7 +58,7 @@ export class MergeActionContributor extends AbstractIdentifiableContribution public supports(node: any): boolean { if (node.baseBranchName) { const pr = node as graphql.PullRequestToPullRequestLifecycle.PullRequest; - return pr.state === "open" && (pr.reviews === undefined || !pr.reviews.some(r => r.state !== "approved")); + return pr.state === "open" && (!pr.reviews || !pr.reviews.some(r => r.state !== "approved")); } else { return false; } @@ -122,9 +122,9 @@ export class MergeActionContributor extends AbstractIdentifiableContribution message, }; } - if (repo.allowMergeCommit === undefined - && repo.allowSquashMerge === undefined - && repo.allowRebaseMerge === undefined) { + if (!repo.allowMergeCommit + && !repo.allowSquashMerge + && !repo.allowRebaseMerge) { mergeMethods.merge = { method: "Merge", title,