How to use the builder-util-runtime.DigestTransform function in builder-util-runtime

To help you get started, we’ve selected a few builder-util-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electron-userland / electron-builder / packages / electron-updater / src / differentialDownloader / DifferentialDownloader.ts View on Github external
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
          }