File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ var validators = module.exports = {
8989 isDecimal : function ( str ) {
9090 return str !== '' && str . match ( / ^ (?: - ? (?: [ 0 - 9 ] + ) ) ? (?: \. [ 0 - 9 ] * ) ? (?: [ e E ] [ \+ \- ] ? (?: [ 0 - 9 ] + ) ) ? $ / ) ;
9191 } ,
92+ isFloat : function ( str ) {
93+ return validators . isDecimal ( str ) ;
94+ } ,
9295 isDivisibleBy : function ( str , n ) {
9396 return ( parseFloat ( str ) % parseInt ( n , 10 ) ) === 0 ;
9497 } ,
@@ -117,9 +120,15 @@ var validators = module.exports = {
117120 }
118121 return str . match ( pattern ) ;
119122 } ,
123+ is : function ( str , pattern , modifiers ) {
124+ return validators . regex ( str , pattern , modifiers ) ;
125+ } ,
120126 notRegex : function ( str , pattern , modifiers ) {
121127 return ! validators . regex ( str , pattern , modifiers ) ;
122128 } ,
129+ not : function ( str , pattern , modifiers ) {
130+ return validators . notRegex ( str , pattern , modifiers ) ;
131+ } ,
123132 len : function ( str , min , max ) {
124133 return str . length >= min && ( max === undefined || str . length <= max ) ;
125134 } ,
You can’t perform that action at this time.
0 commit comments