Type-narrowing mustMatch: narrows specimen after the call. Throws if the specimen does not match.
mustMatch
specimen
The value to test.
The pattern to match against.
Optional
Optional label for error messages.
mustMatch(value, M.string());value; // narrowed to string Copy
mustMatch(value, M.string());value; // narrowed to string
Type-narrowing
mustMatch: narrowsspecimenafter the call. Throws if the specimen does not match.