Skip to content

Commit 2a2c3cb

Browse files
author
Panagis (P.) Tselentis
committed
Remove empty items from array
1 parent 5f5052f commit 2a2c3cb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

assets/js/app/routes/controllers/add-route-modal-controller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@
7070
data.headers = _.map(data.headers, (item) => {
7171
const parts = item.split(":");
7272
const obj = {};
73-
obj[parts[0]] = parts[1].split(",")
73+
obj[parts[0]] = parts[1].split(",").filter(function (el) {
74+
return el;
75+
})
7476
return obj;
7577
}).reduce(function(r, e) {
7678
const key = Object.keys(e)[0];

assets/js/app/routes/controllers/route-details-controller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
data.headers = _.map(data.headers, (item) => {
8989
const parts = item.split(":");
9090
const obj = {};
91-
obj[parts[0]] = parts[1].split(",")
91+
obj[parts[0]] = parts[1].split(",").filter(function (el) {
92+
return el;
93+
})
9294
return obj;
9395
}).reduce(function(r, e) {
9496
const key = Object.keys(e)[0];

0 commit comments

Comments
 (0)