Apply suggestions from code review

Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
This commit is contained in:
Asger F
2024-11-20 11:06:10 +01:00
committed by GitHub
parent bb1da9c6ff
commit 38849f70f5

View File

@@ -13,7 +13,7 @@ const doubleLineBreakRegexp = /\n\r?\n/;
export async function readJsonlFile<T>( export async function readJsonlFile<T>(
path: string, path: string,
handler: (value: T) => Promise<void>, handler: (value: T) => Promise<void>,
logger?: { log: (message: string) => void }, logger?: BaseLogger,
): Promise<void> { ): Promise<void> {
// Stream the data as large evaluator logs won't fit in memory. // Stream the data as large evaluator logs won't fit in memory.
// Also avoid using 'readline' as it is slower than our manual line splitting. // Also avoid using 'readline' as it is slower than our manual line splitting.
@@ -48,7 +48,7 @@ export async function readJsonlFile<T>(
return; return;
} }
} }
void logger?.log(`Finishing parsing ${path}`); void logger?.log(`Finished parsing ${path}`);
resolve(); resolve();
}); });
stream.on("error", reject); stream.on("error", reject);