Skip to content

Commit

Permalink
0.0.8 currency and decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
stuyam committed May 22, 2018
1 parent 519f24b commit 5b3c706
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions dist/simple-react-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ var SimpleReactValidator = function () {
card_num: { message: 'The :attribute must be a valid credit card number.', rule: function rule(val) {
return _this._testRegex(val, /^\d{4}\s?\d{4,6}\s?\d{4,5}\s?\d{0,8}$/);
} },
currency: { message: 'The :attribute must be a valid currency.', rule: function rule(val) {
return _this._testRegex(val, /^\$?(\d{1,3}(\,?\d{3}))*\.?\d{0,2}$/);
} },
decimal: { message: 'The :attribute must be a valid decimal.', rule: function rule(val) {
return _this._testRegex(val, /^\d*\.?\d*$/);
} },
email: { message: 'The :attribute must be a valid email address.', rule: function rule(val) {
return _this._testRegex(val, /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i);
} },
Expand Down
2 changes: 1 addition & 1 deletion dist/simple-react-validator.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-react-validator",
"version": "0.0.7",
"version": "0.0.8",
"description": "A simple react form validator inspired by Laravel validation.",
"main": "dist/simple-react-validator.min.js",
"dependencies": {},
Expand Down

0 comments on commit 5b3c706

Please sign in to comment.