supermatch
v1.0.0
Published
Match two values regardless of type.
Downloads
1
Readme
supermatch
supermatch(subject,object)
Returns true
if any of the following are true:
- Either
subject
orobject
aretrue
. subject
andobject
are both scalars and match identically.subject
is a scalar andobject
is a RegExp andsubject
matchesobject
.subject
is a scalar andobject
is an array andsubject
matches any inobject
.subject
is a scalar andobject
is a true-array (an object in which all values aretrue
) andsubject
matches any inobject
.subject
is an array and any item insubject
matchesobject
.subject
is a true-array and any item insubject
matchesobject
.