Add support for multiple types
This commit is contained in:
@@ -17,4 +17,10 @@ def ofType(type):
|
||||
def check(value):
|
||||
return value.type == type
|
||||
|
||||
return Matcher(None, check, type.name.lower())
|
||||
return Matcher(None, check, type.name.lower())
|
||||
|
||||
def oneOf(*matchers):
|
||||
def check(value):
|
||||
return any(matcher.match(value) for matcher in matchers)
|
||||
|
||||
return Matcher(None, check, f"<{', '.join(m.string for m in matchers)}>")
|
||||
Reference in New Issue
Block a user