We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 276405f commit 9bd0190Copy full SHA for 9bd0190
extensions/ql-vscode/src/common/jsonl-reader.ts
@@ -24,7 +24,12 @@ export async function readJsonlFile<T>(
24
return new Promise((resolve, reject) => {
25
const stream = createReadStream(path, { encoding: "utf8" });
26
let buffer = "";
27
- stream.on("data", async (chunk: string) => {
+ stream.on("data", async (chunk: string | Buffer) => {
28
+ if (typeof chunk !== "string") {
29
+ // This should never happen because we specify the encoding as "utf8".
30
+ throw new Error("Invalid chunk");
31
+ }
32
+
33
const parts = (buffer + chunk).split(doubleLineBreakRegexp);
34
buffer = parts.pop()!;
35
if (parts.length > 0) {
0 commit comments