diff --git a/file.js b/file.js index eade8cd90..ed9d86f04 100644 --- a/file.js +++ b/file.js @@ -4,9 +4,8 @@ const pino = require('./pino') const { once } = require('events') module.exports = async function (opts = {}) { - const destOpts = { dest: opts.destination || 1, sync: false } - if (opts.append === false) destOpts.append = false - if (opts.mkdir) destOpts.mkdir = true + const destOpts = Object.assign({}, opts, { dest: opts.destination || 1, sync: false }) + delete destOpts.destination const destination = pino.destination(destOpts) await once(destination, 'ready') return destination