https://github.com/cycoresystems/meteor-check-patterns
Check patterns for use with Meteor's 'check' package
https://github.com/cycoresystems/meteor-check-patterns
Last synced: over 1 year ago
JSON representation
Check patterns for use with Meteor's 'check' package
- Host: GitHub
- URL: https://github.com/cycoresystems/meteor-check-patterns
- Owner: CyCoreSystems
- License: mit
- Created: 2014-09-08T16:03:58.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-11-30T14:52:58.000Z (over 10 years ago)
- Last Synced: 2025-02-25T15:03:41.880Z (over 1 year ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Check patterns for Meteor's `check` package
============
Various check patterns attached to Meteor's Match object. These may be used as the second argument to Meteor's `check` function.
Example:
`check(myFormInput,Match.NonEmptyString)`
## Patterns available
### `Match.NonEmptyString`
Checks that:
1. the input is a string
2. that it is non-zero in length
### `Match.FloatString`
Checks that:
1. the input is a string
2. that it can be parsed as a float (with parseFloat)
### `Match.IntString`
Checks that:
1. the input is a string
2. that it can be parsed as an integer (with parseInt)
### `Match.NumberPositive`
Checks that:
1. the input can be parsed as a positive (non-zero) number
### `Match.Email`
Checks that:
1. the input is a string
2. it matches a regex for an email address
### `Match.PhoneNANPA`
Checks that:
1. the input is a string
2. that it is of the form NXX-NXX-XXXX (dashes,dots,leading '1' insignificant)