Check Extension
Meteor package which provides a few extensions to the built-in Match object.
Installation
meteor add peerlibrary:check-extension
Checks
The following additional checks are provided:
Match.PositiveNumbermatches only positive numbers.Match.NonNegativeIntegermatches only non-negative integers.Match.NonEmptyStringmatches only strings with a length greater than zero.Match.DocumentIdmatches only valid ObjectIds.Match.ObjectWithOnlyStringsmatches only objects containing strings as keys and values.Match.Enumeration(pattern, enumeration)matches values matchingpatternbelonging to a certainenumerationobject or array.Match.SHA256Stringmatches hex-encoded SHA-256 digests.Match.EMailmatches only non-empty e-mail strings.Match.OptionalOrNull(pattern)matches an optionalpattern, anull, or anundefinedvalue. In objects, field can also be missing.Match.OrNullmatches thepatternor an explicitnull.Match.RegexString(regex)matches strings matchingregexregular expression.