Skip to content

Commit

Permalink
v1.0.1 fixes integer being more than 1 character long
Browse files Browse the repository at this point in the history
  • Loading branch information
stuyam committed Dec 3, 2018
1 parent 063c10a commit 82d731f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "simple-react-validator",
"description": "A simple react form validator inspired by Laravel validation.",
"main": "dist/simple-react-validator.min.js",
"version": "1.0.0",
"version": "1.0.1",
"authors": [
"Stuart Yamartino"
],
Expand Down
4 changes: 2 additions & 2 deletions dist/simple-react-validator.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Simple React Validator v1.0.0 | Created By Dockwa | MIT License | 2018
// Simple React Validator v1.0.1 | Created By Dockwa | MIT License | 2018
;(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['react'], factory);
Expand Down Expand Up @@ -276,7 +276,7 @@ function () {
integer: {
message: 'The :attribute must be an integer.',
rule: function rule(val) {
return _this.helpers.testRegex(val, /^\d?$/);
return _this.helpers.testRegex(val, /^\d*$/);
}
},
max: {
Expand Down
4 changes: 2 additions & 2 deletions dist/simple-react-validator.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var inject = require('gulp-inject-string')
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var babel = require('gulp-babel');
var HEADER_COMMENT = '// Simple React Validator v1.0.0 | Created By Dockwa | MIT License | 2018\n';
var HEADER_COMMENT = '// Simple React Validator v1.0.1 | Created By Dockwa | MIT License | 2018\n';

var gutil = require('gulp-util');

Expand Down
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": "1.0.0",
"version": "1.0.1",
"description": "A simple react form validator inspired by Laravel validation.",
"main": "dist/simple-react-validator.min.js",
"dependencies": {},
Expand Down
2 changes: 1 addition & 1 deletion src/simple-react-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SimpleReactValidator {
date_equals : {message: 'The :attribute must be on :date.', rule: (val, params) => this.helpers.momentInstalled() && moment.isMoment(val) && val.isSame(params[0], 'day'), messageReplace: (message, params) => message.replace(':date', params[0].format('MM/DD/YYYY'))},
email : {message: 'The :attribute must be a valid email address.', rule: val => this.helpers.testRegex(val,/^[A-Z0-9.!#$%&'*+-/=?^`{|}~]+@[A-Z0-9.-]+.[A-Z]{2,}$/i)},
in : {message: 'The selected :attribute must be :values.', rule: (val, params) => params.indexOf(val) > -1, messageReplace: (message, params) => message.replace(':values', this.helpers.toSentence(params))},
integer : {message: 'The :attribute must be an integer.', rule: val => this.helpers.testRegex(val,/^\d?$/)},
integer : {message: 'The :attribute must be an integer.', rule: val => this.helpers.testRegex(val,/^\d*$/)},
max : {message: 'The :attribute may not be greater than :max:type.', rule: (val, params) => this.helpers.size(val, params[1]) <= parseFloat(params[0]), messageReplace: (message, params) => message.replace(':max', params[0]).replace(':type', this.helpers.sizeText(params[1]))},
min : {message: 'The :attribute must be at least :min:type.', rule: (val, params) => this.helpers.size(val, params[1]) >= parseFloat(params[0]), messageReplace: (message, params) => message.replace(':min', params[0]).replace(':type', this.helpers.sizeText(params[1]))},
not_in : {message: 'The selected :attribute must not be :values.', rule: (val, params) => params.indexOf(val) === -1, messageReplace: (message, params) => message.replace(':values', this.helpers.toSentence(params))},
Expand Down

0 comments on commit 82d731f

Please sign in to comment.