]> git.ardis.lu - csvio/commitdiff
Refactor to avoid undefined variables
authorArdis Lu <ardisglu@gmail.com>
Mon, 28 Apr 2025 08:49:30 +0000 (01:49 -0700)
committerArdis Lu <ardisglu@gmail.com>
Mon, 28 Apr 2025 08:49:30 +0000 (01:49 -0700)
src/core.js

index 5ffcec43372a959bb8ff40d4a00680d1068e1493..37b36368efa8d9ae1ca673d54e3953cced30adb7 100644 (file)
@@ -312,17 +312,16 @@ export class CSVTransformer extends TransformStream {
     const results = await Promise.allSettled(this.#concurrent);
     this.#concurrent.length = 0;
     for (const r of results) {
-      const { status, value, reason } = r;
-      if (status === 'rejected') {
-        if (reason instanceof Error) {
-          throw reason;
+      if (r.status === 'rejected') {
+        if (r.reason instanceof Error) {
+          throw r.reason;
         }
         else {
-          throw new Error(reason);
+          throw new Error(r.reason);
         }
       }
       else {
-        this.#enqueueRow(value, controller);
+        this.#enqueueRow(r.value, controller);
       }
     }
   }
This page took 0.040895 seconds and 4 git commands to generate.