[misc] run format_fix and lint:fix

This commit is contained in:
Jakob Ackermann
2021-07-13 12:04:48 +01:00
parent 631873fc83
commit f285e503b4
66 changed files with 1315 additions and 1302 deletions
+10 -10
View File
@@ -29,15 +29,15 @@ module.exports = OutputFileOptimiser = {
callback = function (error) {}
}
if (src.match(/\/output\.pdf$/)) {
return OutputFileOptimiser.checkIfPDFIsOptimised(src, function (
err,
isOptimised
) {
if (err != null || isOptimised) {
return callback(null)
return OutputFileOptimiser.checkIfPDFIsOptimised(
src,
function (err, isOptimised) {
if (err != null || isOptimised) {
return callback(null)
}
return OutputFileOptimiser.optimisePDF(src, dst, callback)
}
return OutputFileOptimiser.optimisePDF(src, dst, callback)
})
)
} else {
return callback(null)
}
@@ -77,7 +77,7 @@ module.exports = OutputFileOptimiser = {
const timer = new Metrics.Timer('qpdf')
const proc = spawn('qpdf', args)
let stdout = ''
proc.stdout.setEncoding('utf8').on('data', (chunk) => (stdout += chunk))
proc.stdout.setEncoding('utf8').on('data', chunk => (stdout += chunk))
callback = _.once(callback) // avoid double call back for error and close event
proc.on('error', function (err) {
logger.warn({ err, args }, 'qpdf failed')
@@ -99,5 +99,5 @@ module.exports = OutputFileOptimiser = {
return callback(null)
})
})
} // ignore the error
}, // ignore the error
}