1
Fork 0

Add a HideTopicMatcher type guard.

This commit is contained in:
Bauke 2023-06-30 13:25:38 +02:00
parent bddc4ceddf
commit 67e796d12d
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 8 additions and 0 deletions

View File

@ -12,6 +12,14 @@ export enum HideTopicMatcher {
UserLabelEquals = "user-label-equals",
}
/**
* Type guard check to see if a string is a valid {@link HideTopicMatcher}.
* @param input The string to check.
*/
export function isHideTopicMatcher(input: string): input is HideTopicMatcher {
return Object.values(HideTopicMatcher).includes(input as HideTopicMatcher);
}
/**
* The predicate for whether a topic should be hidden or not.
*/