hunk.code_window:     "react": "16.12.0",
       "react-dom": "16.12.0",
       "redux": "4.0.5",
       "remark-cli": "^8.0.0",
       "replace-x": "1.7.2",
       "rimraf": "2.7.1",
       "stringify-object": "3.3.0",
       "supertest": "3.4.2",
       "tar": "4.4.13",
       "temp-write": "3.4.0",
  
hunk.labels: keep keep keep keep add keep keep keep keep keep
hunk.after_edit:     "replacestream": "^4.0.3",
  
hunk.file_path: package.json
hunk.type: add
file: const { Plugin } = require('@uppy/core')
  const findDOMElement = require('@uppy/utils/lib/findDOMElement')
  
  /**
   * After an upload completes, inject result data from Transloadit in a hidden input.
   *
   * Must be added _after_ the Transloadit plugin.
   */
  class TransloaditFormResult extends Plugin {
    constructor (uppy, opts) {
      super(uppy, opts)
  
      this.id = this.opts.id || 'TransloaditFormResult'
      this.type = 'modifier'
  
      this.handleUpload = this.handleUpload.bind(this)
    }
  
    getAssemblyStatuses (fileIDs) {
      const assemblyIds = []
      fileIDs.forEach((fileID) => {
        const file = this.uppy.getFile(fileID)
        const assembly = file.transloadit && file.transloadit.assembly
        if (assembly && assemblyIds.indexOf(assembly) === -1) {
          assemblyIds.push(assembly)
        }
      })
  
      const tl = this.uppy.getPlugin(this.opts.transloaditPluginId || 'Transloadit')
      return assemblyIds.map((id) => tl.getAssembly(id))
    }
  
    handleUpload (fileIDs) {
      const assemblies = this.getAssemblyStatuses(fileIDs)
      const input = document.createElement('input')
      input.type = 'hidden'
      input.name = this.opts.name
      input.value = JSON.stringify(assemblies)
  
      const target = findDOMElement(this.opts.target)
      target.appendChild(input)
    }
  
    install () {
      this.uppy.addPostProcessor(this.handleUpload)
    }
  
    uninstall () {
      this.uppy.removePostProcessor(this.handleUpload)
    }
  }
  
  module.exports = TransloaditFormResult
  