Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await new Promise((resolve, reject) => {
const streams: Array = []
const digestTransform = new DigestTransform(this.blockAwareFileInfo.sha512)
// to simply debug, do manual validation to allow file to be fully written
digestTransform.isValidateOnEnd = false
streams.push(digestTransform)
// noinspection JSArrowFunctionCanBeReplacedWithShorthand
fileOut.on("finish", () => {
(fileOut.close as any)(() => {
// remove from fd list because closed successfully
fdList.splice(1, 1)
try {
digestTransform.validate()
}
catch (e) {
reject(e)
return
}