decompress
decompress copied to clipboard
Support Promise.finally()
TypeError: decompress(...).then(...).catch(...).finally is not a function
at File._extractOnFinish (…\lib\file.js:243:18)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at EventEmitter.emit (events.js:208:7)
at WriteStream.<anonymous> (…\lib\file.js:162:32)
at emitNone (events.js:111:20)
at WriteStream.emit (events.js:208:7)
at finishMaybe (_stream_writable.js:614:14)
at afterWrite (_stream_writable.js:465:3)
at onwrite (_stream_writable.js:455:7)
at fs.write (fs.js:2192:5)
at FSReqWrap.wrapper [as oncomplete] (fs.js:685:5)
The module pify
(github) allows option promiseModule
, we should be able to pass a Promise function that supports finally()
.
Workaround:
const decompress = require('decompress');
Promise.resolve(decompress(...)).then(...).catch(...).finally(...);