Skip to content

Commit e100d7c

Browse files
authored
Replace jQuery.extend with spread operator (#972)
1 parent 56f9ac9 commit e100d7c

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

dist/client-side-validations.esm.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ const ClientSideValidations = {
215215
},
216216
validators: {
217217
all: () => {
218-
return jQuery.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote);
218+
return {
219+
...ClientSideValidations.validators.local,
220+
...ClientSideValidations.validators.remote
221+
};
219222
},
220223
local: {},
221224
remote: {}

dist/client-side-validations.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@
219219
},
220220
validators: {
221221
all: () => {
222-
return jQuery.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote);
222+
return {
223+
...ClientSideValidations.validators.local,
224+
...ClientSideValidations.validators.remote
225+
};
223226
},
224227
local: {},
225228
remote: {}

src/core.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,12 @@ const ClientSideValidations = {
229229
forms: 'form[data-client-side-validations]'
230230
},
231231
validators: {
232-
all: () => { return jQuery.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote) },
232+
all: () => {
233+
return {
234+
...ClientSideValidations.validators.local,
235+
...ClientSideValidations.validators.remote
236+
}
237+
},
233238
local: {},
234239
remote: {}
235240
},

vendor/assets/javascripts/rails.validations.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@
219219
},
220220
validators: {
221221
all: () => {
222-
return jQuery.extend({}, ClientSideValidations.validators.local, ClientSideValidations.validators.remote);
222+
return {
223+
...ClientSideValidations.validators.local,
224+
...ClientSideValidations.validators.remote
225+
};
223226
},
224227
local: {},
225228
remote: {}

0 commit comments

Comments
 (0)