Skip to content

Commit 61f8d5e

Browse files
committed
Use native JS instead of lodash _.forEach
1 parent 083048e commit 61f8d5e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

public/wing.vue.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ const wing = {
277277

278278
format_post_data(params, options) {
279279
var form = new FormData();
280-
_.forEach(params, function (value, key) {
280+
for( const [key, value] of Object.entries(params)) {
281281
//console.log('--'+key+'--');
282282
//console.dir(value)
283283
if (typeof value == "object") {
@@ -302,9 +302,7 @@ const wing = {
302302
} else if (Array.isArray(value)) {
303303
// handle an array of values as individual key value pairs
304304
//console.log(key+' is an array of key value pairs');
305-
_.forEach(value, function (element) {
306-
form.append(key, element);
307-
});
305+
value.forEach( (element) => form.append(key, element) );
308306
} else {
309307
// just a normal object hash
310308
//console.log(key+' is an object hash');

0 commit comments

Comments
 (0)