@merkl/api 0.10.404 → 0.10.405
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.
@@ -18,7 +18,7 @@ const failedBatches = [];
|
|
18
18
|
const extract = async () => {
|
19
19
|
if (!file.exists())
|
20
20
|
throw new Error("File does not exist.");
|
21
|
-
|
21
|
+
const data = [];
|
22
22
|
const textDecoder = new TextDecoder();
|
23
23
|
let buffer = "";
|
24
24
|
const stream = file.stream();
|
@@ -28,8 +28,9 @@ const extract = async () => {
|
|
28
28
|
const lines = buffer.split("\n");
|
29
29
|
buffer = lines.pop() || "";
|
30
30
|
for (const line of lines)
|
31
|
-
if (line.trim())
|
32
|
-
data
|
31
|
+
if (line.trim()) {
|
32
|
+
data.push(...transform(JSON.parse(line)));
|
33
|
+
}
|
33
34
|
try {
|
34
35
|
count += await load(data);
|
35
36
|
data.length = 0;
|