From b3c301fc2a41b40015866bc683020411861a46dd Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 18 Jul 2024 13:31:29 +0200 Subject: [PATCH] lint --- src/backupformat/tgz.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backupformat/tgz.js b/src/backupformat/tgz.js index b90057d1c..12b7ca446 100644 --- a/src/backupformat/tgz.js +++ b/src/backupformat/tgz.js @@ -35,6 +35,10 @@ function getBackupFilePath(backupConfig, remotePath) { } function addToPack(pack, header, options) { + assert.strictEqual(typeof pack, 'object'); + assert.strictEqual(typeof header, 'object'); + assert.strictEqual(typeof options, 'object'); // { input } + return new Promise((resolve, reject) => { const packEntry = safe(() => pack.entry(header, function (error) { if (error) { @@ -46,13 +50,9 @@ function addToPack(pack, header, options) { } })); - if (!packEntry) { - return reject(new BoxError(BoxError.FS_ERROR, `Failed to add ${header.name}: ${safe.error.message}`)); - } + if (!packEntry) return reject(new BoxError(BoxError.FS_ERROR, `Failed to add ${header.name}: ${safe.error.message}`)); - if (options?.input) { - safe(stream.pipeline(options.input, packEntry), { debug }); // background. rely on pack.entry callback for promise completion - } + if (options?.input) safe(stream.pipeline(options.input, packEntry), { debug }); // background. rely on pack.entry callback for promise completion }); }