@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/index.cjs CHANGED
@@ -5512,9 +5512,17 @@ var ConversationScanner = class {
5512
5512
  try {
5513
5513
  const fd = (0, import_fs14.openSync)(filePath, "r");
5514
5514
  try {
5515
- const buf = Buffer.alloc(8192);
5516
- const n = (0, import_fs14.readSync)(fd, buf, 0, buf.length, 0);
5517
- sample = buf.subarray(0, n).toString("utf8");
5515
+ const chunks = [];
5516
+ let pos = 0;
5517
+ while (pos < 1024 * 1024) {
5518
+ const chunk = Buffer.alloc(8192);
5519
+ const n = (0, import_fs14.readSync)(fd, chunk, 0, chunk.length, pos);
5520
+ if (n === 0) break;
5521
+ chunks.push(chunk.subarray(0, n));
5522
+ pos += n;
5523
+ if (chunk.subarray(0, n).includes(10)) break;
5524
+ }
5525
+ sample = Buffer.concat(chunks).toString("utf8");
5518
5526
  } finally {
5519
5527
  (0, import_fs14.closeSync)(fd);
5520
5528
  }