'use babel'

import fs from 'fs'

export default class FilePayload {
  constructor(path) {
    this.path = path
  }

  mime() {
    return mime.lookup(this.path)
  }

  data() {
    return fs.createReadStream(this.path)
  }

  serialize() {
    return {
      type: 'FilePayload',
      mime: this.mime(),
      path: this.path
    }
  }
}

@@ -6,16 +6,40 @@
 babel'%0A%0A
+import mime from 'mime'%0A
 import f

Fix file payload