diff --git a/source/platforms/bitbucket_cloud/BitBucketCloudAPI.ts b/source/platforms/bitbucket_cloud/BitBucketCloudAPI.ts index 16796c477..f0d6f333a 100644 --- a/source/platforms/bitbucket_cloud/BitBucketCloudAPI.ts +++ b/source/platforms/bitbucket_cloud/BitBucketCloudAPI.ts @@ -219,20 +219,22 @@ export class BitBucketCloudAPI { const dangerIDMessage = dangerIDToString(dangerID) return comments - .filter(comment => comment.inline == null) - .filter(comment => comment.content.raw.includes(dangerIDMessage)) - .filter(comment => comment.user.uuid === this.uuid) + .filter((comment) => comment.inline == null) + .filter((comment) => comment.content.raw.includes(dangerIDMessage)) + .filter((comment) => comment.user.uuid === this.uuid) } getDangerInlineComments = async (dangerID: string): Promise => { const comments = await this.getPullRequestComments() const dangerIDMessage = dangerIDToString(dangerID) - return comments.filter(comment => comment.inline).map(comment => ({ - id: comment.id.toString(), - ownedByDanger: comment.content.raw.includes(dangerIDMessage) && comment.user.uuid === this.uuid, - body: comment.content.raw, - })) + return comments + .filter((comment) => comment.inline) + .map((comment) => ({ + id: comment.id.toString(), + ownedByDanger: comment.content.raw.includes(dangerIDMessage) && comment.user.uuid === this.uuid, + body: comment.content.raw, + })) } postBuildStatus = async ( @@ -370,7 +372,7 @@ export class BitBucketCloudAPI { let agent: Agent | undefined = undefined let proxy = process.env.http_proxy || process.env.https_proxy if (proxy) { - agent = new HttpsProxyAgent(proxy) + agent = HttpsProxyAgent(proxy) } return this.fetch( diff --git a/source/platforms/bitbucket_server/BitBucketServerAPI.ts b/source/platforms/bitbucket_server/BitBucketServerAPI.ts index 074bd732d..a05348ce6 100644 --- a/source/platforms/bitbucket_server/BitBucketServerAPI.ts +++ b/source/platforms/bitbucket_server/BitBucketServerAPI.ts @@ -209,12 +209,12 @@ export class BitBucketServerAPI implements BitBucketServerAPIDSL { const activities = await this.getPullRequestComments() const dangerIDMessage = dangerIDToString(dangerID) - const comments = activities.map(activity => activity.comment).filter(Boolean) as BitBucketServerPRComment[] + const comments = activities.map((activity) => activity.comment).filter(Boolean) as BitBucketServerPRComment[] return comments - .filter(comment => comment!.text.includes(dangerIDMessage)) - .filter(comment => comment!.author.name.toLowerCase() === username!.toLowerCase()) - .filter(comment => comment!.text.includes("Generated by")) + .filter((comment) => comment!.text.includes(dangerIDMessage)) + .filter((comment) => comment!.author.name.toLowerCase() === username!.toLowerCase()) + .filter((comment) => comment!.text.includes("Generated by")) } getDangerInlineComments = async (dangerID: string): Promise => { @@ -223,16 +223,17 @@ export class BitBucketServerAPI implements BitBucketServerAPIDSL { const dangerIDMessage = dangerIDToString(dangerID) const comments = activities - .filter(activity => activity.commentAnchor) - .map(activity => activity.comment) + .filter((activity) => activity.commentAnchor) + .map((activity) => activity.comment) .filter(Boolean) as BitBucketServerPRComment[] - return new Promise(resolve => { + return new Promise((resolve) => { resolve( comments .map((i: any) => { return { id: i.id, - ownedByDanger: i.author.name.toLowerCase() === username!.toLowerCase() && i.text.includes(dangerIDMessage), + ownedByDanger: + i.author.name.toLowerCase() === username!.toLowerCase() && i.text.includes(dangerIDMessage), body: i.text, } }) @@ -353,7 +354,7 @@ export class BitBucketServerAPI implements BitBucketServerAPIDSL { let agent: Agent | undefined = undefined let proxy = process.env.http_proxy || process.env.https_proxy if (proxy) { - agent = new HttpsProxyAgent(proxy) + agent = HttpsProxyAgent(proxy) } return this.fetch(