ignore empty lines

This commit is contained in:
jane 2021-06-06 00:29:10 -04:00
parent bb90e7458b
commit 90200750cc

View file

@ -56,8 +56,8 @@ app.get("/indexes/:project(\\w+)", (req, res) => {
app.use("/updates", express.text()); app.use("/updates", express.text());
function diff(current, checked) { function diff(current, checked) {
let lines_current = current.split('\n').map(l => l.trim()); let lines_current = current.split('\n').map(l => l.trim()).filter(l => l != "");
let lines_checked = checked.split('\n').map(l => l.trim()); let lines_checked = checked.split('\n').map(l => l.trim()).filter(l => l != "");
let filenames_checked = lines_checked.map(l => l.split(" ")[0]); let filenames_checked = lines_checked.map(l => l.split(" ")[0]);
console.log(lines_current, lines_checked); console.log(lines_current, lines_checked);