Skip to content

Commit ac0cb74

Browse files
committed
REMOVE: redundant assignments, comments
1 parent 9204a82 commit ac0cb74

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

app.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ app.get('/recent', (req, res) => {
6161

6262
app.get('/:uuid', (req, res) => {
6363
loadDatabase((allItems) => {
64-
addMarkdown(allItems);
6564
const matches = searchDatabase(req.params, allItems);
6665
if (matches.length === 0) {
6766
logScanned(req.params.uuid);
@@ -71,9 +70,9 @@ app.get('/:uuid', (req, res) => {
7170
});
7271
return;
7372
}
73+
addMarkdown(matches[0]);
7474
addSimilarItems(matches[0], allItems);
7575
logScanned(req.params.uuid, matches[0].fixture);
76-
// modifyContent(matches[0], allItems
7776
res.render('item', matches[0]);
7877
});
7978
});

googleSpreadsheet.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,18 @@ function searchDatabase(query, rows) {
3434
return matches;
3535
}
3636

37-
function addSimilarItems(object, objects) {
38-
const obj = object;
39-
const allObj = objects;
37+
function addSimilarItems(obj, allObj) {
4038
obj.similarItems = searchDatabase({ fixture: obj.fixture }, allObj)
4139
.filter(item => item.uuid !== obj.uuid)
4240
.splice(0, 3);
4341
return obj;
4442
}
4543

46-
function addMarkdown(objects) {
47-
const objs = objects;
48-
for (let i = 0; i < objs.length; i += 1) {
49-
objs[i].HOWTO = marked(objs[i].HOWTO);
50-
objs[i].details = marked(objs[i].details);
51-
objs[i].Troubleshooting = marked(objs[i].Troubleshooting);
52-
}
53-
return objs;
44+
function addMarkdown(obj) {
45+
obj.HOWTO = marked(obj.HOWTO);
46+
obj.details = marked(obj.details);
47+
obj.Troubleshooting = marked(obj.Troubleshooting);
48+
return obj;
5449
}
5550

5651
module.exports = {

views/notFound.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<img class="col-xs-12 col-lg-4 col-lg-offset-4" src="/emoji.png" alt="" />
44
<article style='margin-top:2em'class="col-xs-12 col-lg-4 col-lg-offset-4">
5-
<p>Sorry, item not found with the id: </p>
5+
<p>Sorry, item not found with the id:</p>
66
<p>
77
<strong><%- id %></strong>
88
</p>

0 commit comments

Comments
 (0)