From 06223d576de29f2b288655db50dc14636a84b471 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 21 Jan 2021 20:32:23 +1300 Subject: [PATCH] Fixes from Linter --- server.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server.js b/server.js index d596cc769..b8b0a28f3 100644 --- a/server.js +++ b/server.js @@ -99,8 +99,8 @@ const shareFunction = function(req, res, type) { const setSourceHeaders = function (res, title, type) { res.status(200); - if (type == 'download') { - let fileName = sanitizeFilename(title).replaceAll(' ', '-'); + if(type == 'download') { + const fileName = sanitizeFilename(title).replaceAll(' ', '-'); res.set({ 'Cache-Control' : 'no-cache', @@ -108,18 +108,18 @@ const setSourceHeaders = function (res, title, type) { 'Content-Disposition' : `attachment; filename="HomeBrewery-${fileName}.txt"` }); } -} +}; const getSourceText = function (brewText, type) { if(type == 'source') { - return `
${brewText.replaceAll('&', '&').replaceAll('<','<').replaceAll('>', '>')}
`; + return `
${brewText.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>')}
`; } else if(type == 'download') { return brewText; } else { console.log('Unhandled source share type'); return; } -} +}; //Source page app.get('/source/:id', (req, res)=>{