From e100d7c0689322e8a7336625fea85bf9ce759e6e Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Sat, 28 Dec 2024 10:13:44 +0100 Subject: [PATCH] Replace `jQuery.extend` with spread operator (#972) --- dist/client-side-validations.esm.js | 5 ++++- dist/client-side-validations.js | 5 ++++- src/core.js | 7 ++++++- vendor/assets/javascripts/rails.validations.js | 5 ++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/dist/client-side-validations.esm.js b/dist/client-side-validations.esm.js index 91d78a23..fc862984 100644 --- a/dist/client-side-validations.esm.js +++ b/dist/client-side-validations.esm.js @@ -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: {} diff --git a/dist/client-side-validations.js b/dist/client-side-validations.js index 5f8a9954..115c14ee 100644 --- a/dist/client-side-validations.js +++ b/dist/client-side-validations.js @@ -219,7 +219,10 @@ }, validators: { all: () => { - return jQuery.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote); + return { + ...ClientSideValidations.validators.local, + ...ClientSideValidations.validators.remote + }; }, local: {}, remote: {} diff --git a/src/core.js b/src/core.js index 853c2918..76f3a8ec 100644 --- a/src/core.js +++ b/src/core.js @@ -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: {} }, diff --git a/vendor/assets/javascripts/rails.validations.js b/vendor/assets/javascripts/rails.validations.js index 5f8a9954..115c14ee 100644 --- a/vendor/assets/javascripts/rails.validations.js +++ b/vendor/assets/javascripts/rails.validations.js @@ -219,7 +219,10 @@ }, validators: { all: () => { - return jQuery.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote); + return { + ...ClientSideValidations.validators.local, + ...ClientSideValidations.validators.remote + }; }, local: {}, remote: {}