Skip to content

peerlibrary/meteor-check-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 20, 2019
d05ad31 · Sep 20, 2019

History

18 Commits
Mar 3, 2015
Sep 20, 2019
Mar 3, 2015
Sep 5, 2018
Sep 5, 2018
Sep 20, 2019

Repository files navigation

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.PositiveNumber matches only positive numbers.
  • Match.NonNegativeInteger matches only non-negative integers.
  • Match.NonEmptyString matches only strings with a length greater than zero.
  • Match.DocumentId matches only valid ObjectIds.
  • Match.ObjectWithOnlyStrings matches only objects containing strings as keys and values.
  • Match.Enumeration(pattern, enumeration) matches values matching pattern belonging to a certain enumeration object or array.
  • Match.SHA256String matches hex-encoded SHA-256 digests.
  • Match.EMail matches only non-empty e-mail strings.
  • Match.OptionalOrNull(pattern) matches an optional pattern, a null, or an undefined value. In objects, field can also be missing.
  • Match.OrNull matches the pattern or an explicit null.
  • Match.RegexString(regex) matches strings matching regex regular expression.