Skip to content

Commit

Permalink
🏷️ Relax type guard on SchemaRestPullRequestActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
NatoBoram committed Oct 21, 2024
1 parent e63ef2c commit 3260fbd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/server/interfaces/schema_rest_pull_request_activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 3260fbd

Please sign in to comment.