From 3260fbdf8cbd519b8654f649d0274edac6d23826 Mon Sep 17 00:00:00 2001 From: Nathan Gendron Date: Mon, 21 Oct 2024 15:02:49 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20Relax=20type=20guard=20?= =?UTF-8?q?on=20SchemaRestPullRequestActivity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interfaces/schema_rest_pull_request_activity.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/interfaces/schema_rest_pull_request_activity.ts b/src/server/interfaces/schema_rest_pull_request_activity.ts index 421088d..46fa2e7 100644 --- a/src/server/interfaces/schema_rest_pull_request_activity.ts +++ b/src/server/interfaces/schema_rest_pull_request_activity.ts @@ -29,19 +29,19 @@ export interface SchemaRestPullRequestActivityUpdated } export function isSchemaRestPullRequestActivityCommented( - activity: SchemaRestPullRequestActivity, + activity?: SchemaRestPullRequestActivity | SchemaRestPullRequestActivityBase, ): activity is SchemaRestPullRequestActivityCommented { - return activity.action === "COMMENTED" + return activity?.action === "COMMENTED" } export function isSchemaRestPullRequestActivityOpened( - activity: SchemaRestPullRequestActivity, + activity?: SchemaRestPullRequestActivity | SchemaRestPullRequestActivityBase, ): activity is SchemaRestPullRequestActivityOpened { - return activity.action === "OPENED" + return activity?.action === "OPENED" } export function isSchemaRestPullRequestActivityUpdated( - activity: SchemaRestPullRequestActivity, + activity?: SchemaRestPullRequestActivity | SchemaRestPullRequestActivityBase, ): activity is SchemaRestPullRequestActivityUpdated { - return activity.action === "UPDATED" + return activity?.action === "UPDATED" }