fix: lint

Signed-off-by: acalcutt <acalcutt@techidiots.net>
This commit is contained in:
acalcutt 2023-11-02 11:44:17 -04:00 committed by Andrew Calcutt
parent 426038a713
commit 70d8ddc476
2 changed files with 18 additions and 13 deletions

View file

@ -277,14 +277,18 @@ fs.stat(path.resolve(opts.config), (err, stats) => {
axios({ axios({
url, url,
method: 'GET', method: 'GET',
responseType: 'stream' responseType: 'stream',
}).then(response => { })
response.data.pipe(writer); .then((response) => {
writer.on('finish', () => StartWithInputFile(filename)); response.data.pipe(writer);
writer.on('error', err => console.error(`Error writing file: ${err}`)); writer.on('finish', () => StartWithInputFile(filename));
}).catch(error => { writer.on('error', (err) =>
console.error(`Error downloading file: ${error}`); console.error(`Error writing file: ${err}`),
}); );
})
.catch((error) => {
console.error(`Error downloading file: ${error}`);
});
} }
} }
} else { } else {

View file

@ -1364,7 +1364,9 @@ export const serve_rendered = {
const parsedResponse = {}; const parsedResponse = {};
if (responseHeaders['last-modified']) { if (responseHeaders['last-modified']) {
parsedResponse.modified = new Date(responseHeaders['last-modified']); parsedResponse.modified = new Date(
responseHeaders['last-modified'],
);
} }
if (responseHeaders.expires) { if (responseHeaders.expires) {
parsedResponse.expires = new Date(responseHeaders.expires); parsedResponse.expires = new Date(responseHeaders.expires);
@ -1375,7 +1377,6 @@ export const serve_rendered = {
parsedResponse.data = responseData; parsedResponse.data = responseData;
callback(null, parsedResponse); callback(null, parsedResponse);
} catch (error) { } catch (error) {
const parts = url.parse(req.url); const parts = url.parse(req.url);
const extension = path.extname(parts.pathname).toLowerCase(); const extension = path.extname(parts.pathname).toLowerCase();