lint
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user