Skip to content

Commit 58ed64d

Browse files
author
ntwigg
committed
Type narrowing.
1 parent c53b60d commit 58ed64d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

browser-extension/src/handlers/github-handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export type GitHubCommentType =
1010
| 'GH_PR_CODE_COMMENT';
1111

1212
export interface GitHubContext extends CommentContext {
13+
type: GitHubCommentType; // Override to narrow from string to specific union
1314
domain: string;
1415
slug: string; // owner/repo
1516
number?: number | undefined; // issue/PR number

browser-extension/src/handlers/reddit-handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export type RedditCommentType =
66
| 'REDDIT_COMMENT_EDIT';
77

88
export interface RedditContext extends CommentContext {
9+
type: RedditCommentType; // Override to narrow from string to specific union
910
subreddit: string;
1011
postId?: string | undefined;
1112
commentId?: string | undefined; // for editing existing comments

0 commit comments

Comments
 (0)