Przeglądaj źródła

@uppy/transloadit: fix strict type errors (#5271)

Antoine du Hamel 10 miesięcy temu
rodzic
commit
1b81a8a842
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      packages/@uppy/transloadit/src/index.ts

+ 4 - 4
packages/@uppy/transloadit/src/index.ts

@@ -275,9 +275,9 @@ export default class Transloadit<
 
   client: Client<M, B>
 
-  assembly: Assembly | null
+  assembly?: Assembly
 
-  #watcher: AssemblyWatcher<M, B>
+  #watcher!: AssemblyWatcher<M, B>
 
   completedFiles: Record<string, boolean>
 
@@ -799,7 +799,7 @@ export default class Transloadit<
       const assembly =
         // this.assembly can already be defined if we recovered files with Golden Retriever (this.#onRestored)
         (this.assembly ??
-          (await this.#createAssembly(fileIDs, assemblyOptions))) as Assembly
+          (await this.#createAssembly(fileIDs, assemblyOptions)))!
       if (this.opts.importFromUploadURLs) {
         await this.#reserveFiles(assembly, fileIDs)
       }
@@ -882,7 +882,7 @@ export default class Transloadit<
 
   #onError = (err: { name: string; message: string; details?: string }) => {
     this.#closeAssemblyIfExists()
-    this.assembly = null
+    this.assembly = undefined
 
     this.client
       .submitError(err)