Skip to content

Commit 3260fbd

Browse files
committed
🏷️ Relax type guard on SchemaRestPullRequestActivity
1 parent e63ef2c commit 3260fbd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/server/interfaces/schema_rest_pull_request_activity.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ export interface SchemaRestPullRequestActivityUpdated
2929
}
3030

3131
export function isSchemaRestPullRequestActivityCommented(
32-
activity: SchemaRestPullRequestActivity,
32+
activity?: SchemaRestPullRequestActivity | SchemaRestPullRequestActivityBase,
3333
): activity is SchemaRestPullRequestActivityCommented {
34-
return activity.action === "COMMENTED"
34+
return activity?.action === "COMMENTED"
3535
}
3636

3737
export function isSchemaRestPullRequestActivityOpened(
38-
activity: SchemaRestPullRequestActivity,
38+
activity?: SchemaRestPullRequestActivity | SchemaRestPullRequestActivityBase,
3939
): activity is SchemaRestPullRequestActivityOpened {
40-
return activity.action === "OPENED"
40+
return activity?.action === "OPENED"
4141
}
4242

4343
export function isSchemaRestPullRequestActivityUpdated(
44-
activity: SchemaRestPullRequestActivity,
44+
activity?: SchemaRestPullRequestActivity | SchemaRestPullRequestActivityBase,
4545
): activity is SchemaRestPullRequestActivityUpdated {
46-
return activity.action === "UPDATED"
46+
return activity?.action === "UPDATED"
4747
}

0 commit comments

Comments
 (0)