Skip to content

Commit

Permalink
Replace jQuery.extend with spread operator (#972)
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala authored Dec 28, 2024
1 parent 56f9ac9 commit e100d7c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
5 changes: 4 additions & 1 deletion dist/client-side-validations.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ const ClientSideValidations = {
},
validators: {
all: () => {
return jQuery.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote);
return {
...ClientSideValidations.validators.local,
...ClientSideValidations.validators.remote
};
},
local: {},
remote: {}
Expand Down
5 changes: 4 additions & 1 deletion dist/client-side-validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@
},
validators: {
all: () => {
return jQuery.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote);
return {
...ClientSideValidations.validators.local,
...ClientSideValidations.validators.remote
};
},
local: {},
remote: {}
Expand Down
7 changes: 6 additions & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@ const ClientSideValidations = {
forms: 'form[data-client-side-validations]'
},
validators: {
all: () => { return jQuery.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote) },
all: () => {
return {
...ClientSideValidations.validators.local,
...ClientSideValidations.validators.remote
}
},
local: {},
remote: {}
},
Expand Down
5 changes: 4 additions & 1 deletion vendor/assets/javascripts/rails.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@
},
validators: {
all: () => {
return jQuery.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote);
return {
...ClientSideValidations.validators.local,
...ClientSideValidations.validators.remote
};
},
local: {},
remote: {}
Expand Down

0 comments on commit e100d7c

Please sign in to comment.