Forráskód Böngészése

fixes flagged by LGTM.com (#1876)

* aws-s3-multipart: fix typo

This was doing a weird thing and probably causing more cancellation
bugs.

Flagged by lgtm.com

* form: fix comparison

* companion-client: fix use strict directive
Renée Kooi 5 éve
szülő
commit
aee4dee171

+ 1 - 1
packages/@uppy/aws-s3-multipart/src/index.js

@@ -311,7 +311,7 @@ module.exports = class AwsS3Multipart extends Plugin {
       const token = file.serverToken
       const host = getSocketHost(file.remote.companionUrl)
       const socket = new Socket({ target: `${host}/api/${token}`, autoOpen: false })
-      this.uploaderSockets[socket] = socket
+      this.uploaderSockets[file.id] = socket
       this.uploaderEvents[file.id] = new EventTracker(this.uppy)
 
       this.onFileRemove(file.id, (removed) => {

+ 2 - 1
packages/@uppy/companion-client/src/index.js

@@ -1,4 +1,5 @@
-'use-strict'
+'use strict'
+
 /**
  * Manages communications with Companion
  */

+ 1 - 0
packages/@uppy/companion-client/src/tokenStorage.js

@@ -1,4 +1,5 @@
 'use strict'
+
 /**
  * This module serves as an Async wrapper for LocalStorage
  */

+ 1 - 1
packages/@uppy/form/src/index.js

@@ -137,7 +137,7 @@ module.exports = class Form extends Plugin {
 
   install () {
     this.form = findDOMElement(this.opts.target)
-    if (!this.form || !this.form.nodeName === 'FORM') {
+    if (!this.form || this.form.nodeName !== 'FORM') {
       this.uppy.log('Form plugin requires a <form> target element passed in options to operate, none was found', 'error')
       return
     }