@datapos/datapos-tool-csv-parse 0.0.31 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3384,14 +3384,9 @@ class Gn {
|
|
|
3384
3384
|
return new Promise((o, s) => {
|
|
3385
3385
|
let f, u, l, h = !1;
|
|
3386
3386
|
const c = (p) => {
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
u?.cancel();
|
|
3391
|
-
} catch {
|
|
3392
|
-
}
|
|
3393
|
-
console.log(2222, p), s(p);
|
|
3394
|
-
}
|
|
3387
|
+
h || (h = !0, i.signal.aborted || i.abort(p), this.ignoreErrors(() => {
|
|
3388
|
+
u?.cancel();
|
|
3389
|
+
}), s(p));
|
|
3395
3390
|
};
|
|
3396
3391
|
(async () => {
|
|
3397
3392
|
f = ut(e), l = this.constructRowBuffer({ chunk: r.chunk, chunkSize: r.chunkSize ?? Qn }), f.on("readable", () => {
|
|
@@ -3406,7 +3401,7 @@ class Gn {
|
|
|
3406
3401
|
c(g);
|
|
3407
3402
|
}
|
|
3408
3403
|
}), f.on("error", (g) => c(g)), f.on("end", () => {
|
|
3409
|
-
h || (l?.flush(),
|
|
3404
|
+
h || (l?.flush(), o(this.constructSummary(f)));
|
|
3410
3405
|
});
|
|
3411
3406
|
const p = await fetch(encodeURI(n), { signal: i.signal });
|
|
3412
3407
|
if (!p.ok || p.body == null)
|
|
@@ -3453,6 +3448,13 @@ class Gn {
|
|
|
3453
3448
|
});
|
|
3454
3449
|
});
|
|
3455
3450
|
}
|
|
3451
|
+
/** Ignore best-effort cleanup errors to keep teardown noise-free. */
|
|
3452
|
+
ignoreErrors(e) {
|
|
3453
|
+
try {
|
|
3454
|
+
e();
|
|
3455
|
+
} catch {
|
|
3456
|
+
}
|
|
3457
|
+
}
|
|
3456
3458
|
}
|
|
3457
3459
|
export {
|
|
3458
3460
|
Gn as Tool
|
|
@@ -14,6 +14,8 @@ declare class Tool {
|
|
|
14
14
|
private constructSummary;
|
|
15
15
|
/** Write to parser. */
|
|
16
16
|
private writeToParser;
|
|
17
|
+
/** Ignore best-effort cleanup errors to keep teardown noise-free. */
|
|
18
|
+
private ignoreErrors;
|
|
17
19
|
}
|
|
18
20
|
/** Exports */
|
|
19
21
|
export type { Options as ParseOptions, Parser } from 'csv-parse/browser/esm';
|