From 0433f54f5ea292b6c01b9d62750986935742150d Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sat, 20 Nov 2021 03:20:09 -0700 Subject: [PATCH] forward all unknown options passed to pino/file transport to destination (#1234) --- file.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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