File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @pmochine/vee-validate-laravel" ,
3- "version" : " 1.0.0 " ,
3+ "version" : " 1.0.1 " ,
44 "description" : " Adds simple laravel form validation support to vee-validate" ,
55 "main" : " src/vee-validate-laravel.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -16,27 +16,27 @@ const Plugin = {
1616 */
1717function addToErrorBag ( errorResponse ) {
1818 // only allow this function to be run if the validator exists
19- if ( ! exists ( this , '$validator' ) ) return null ;
19+ if ( ! hasProperty ( this , '$validator' ) ) return null ;
2020
2121 // check if there is data in the response
22- if ( ! exists ( errorResponse , 'data' ) ) return null ;
22+ if ( ! hasProperty ( errorResponse , 'data' ) ) return null ;
2323
2424 // clear errors
2525 this . $validator . errors . clear ( ) ;
2626
2727 // check if errors exist
28- if ( ! exists ( errorResponse . data , 'errors' ) ) return null ;
28+ if ( ! hasProperty ( errorResponse . data , 'errors' ) ) return null ;
2929
3030 return loopThroughErrors ( errorResponse . data . errors ) ;
3131}
3232
33- exists = ( obj , key ) => {
33+ function hasProperty ( obj , key ) {
3434 if ( ! obj ) return false ;
3535
3636 const has = Object . prototype . hasOwnProperty ;
3737
3838 return has . call ( obj , key ) ;
39- } ;
39+ }
4040
4141function loopThroughErrors ( errors ) {
4242 let firstError = '' ;
You can’t perform that action at this time.
0 commit comments