export type MatchedResult = { matched: true result: M } export type UnmatchedResult = { matched: false } export type MatchResult = UnmatchedResult | MatchedResult // eslint-disable-next-line @typescript-eslint/no-explicit-any export type MatchResultAny = MatchResult /** * reperesent matcher result which is matched */ // eslint-disable-next-line @typescript-eslint/no-explicit-any export type Matched = Extract> /** * check for matched result */ export function isMatched(matchResult: MR): matchResult is Matched { return matchResult.matched }