Add a HideTopicMatcher type guard.
This commit is contained in:
parent
bddc4ceddf
commit
67e796d12d
|
@ -12,6 +12,14 @@ export enum HideTopicMatcher {
|
||||||
UserLabelEquals = "user-label-equals",
|
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.
|
* The predicate for whether a topic should be hidden or not.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue