@threadbase-sh/scanner 0.24.6 → 0.24.7

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.
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import { Command } from "commander";
5
5
  import pino2 from "pino";
6
6
 
7
7
  // package.json
8
- var version = "0.24.6";
8
+ var version = "0.24.7";
9
9
 
10
10
  // src/logger.ts
11
11
  import pino from "pino";
@@ -5362,9 +5362,17 @@ var ConversationScanner = class {
5362
5362
  try {
5363
5363
  const fd = openSync3(filePath, "r");
5364
5364
  try {
5365
- const buf = Buffer.alloc(8192);
5366
- const n = readSync3(fd, buf, 0, buf.length, 0);
5367
- sample = buf.subarray(0, n).toString("utf8");
5365
+ const chunks = [];
5366
+ let pos = 0;
5367
+ while (pos < 1024 * 1024) {
5368
+ const chunk = Buffer.alloc(8192);
5369
+ const n = readSync3(fd, chunk, 0, chunk.length, pos);
5370
+ if (n === 0) break;
5371
+ chunks.push(chunk.subarray(0, n));
5372
+ pos += n;
5373
+ if (chunk.subarray(0, n).includes(10)) break;
5374
+ }
5375
+ sample = Buffer.concat(chunks).toString("utf8");
5368
5376
  } finally {
5369
5377
  closeSync3(fd);
5370
5378
  }