diff --git a/source/storage/hide-topics.ts b/source/storage/hide-topics.ts index 23b9c70..267eb14 100644 --- a/source/storage/hide-topics.ts +++ b/source/storage/hide-topics.ts @@ -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. */