Skip to content

Commit

Permalink
fix: typeguard
Browse files Browse the repository at this point in the history
  • Loading branch information
BeksOmega committed Mar 15, 2024
1 parent 4bde69b commit 4c0c0f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/interfaces/i_comment_icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import {IconType} from '../icons.js';
import {IIcon, isIcon} from './i_icon.js';
import {Size} from '../utils/size.js';
import {IHasBubble} from './i_has_bubble.js';
import {IHasBubble, hasBubble} from './i_has_bubble.js';

export interface ICommentIcon extends IIcon, IHasBubble {
setText(text: string): void;
Expand All @@ -23,8 +23,11 @@ export interface ICommentIcon extends IIcon, IHasBubble {
export function isCommentIcon(obj: Object): obj is ICommentIcon {
return (
isIcon(obj) &&
hasBubble(obj) &&
(obj as any)['setText'] !== undefined &&
(obj as any)['getText'] !== undefined &&
(obj as any)['setBubbleSize'] !== undefined &&
(obj as any)['getBubbleSize'] !== undefined &&
obj.getType() === IconType.COMMENT
);
}

0 comments on commit 4c0c0f0

Please sign in to comment.