From b6980884c1110495847481f1f637528b163961ac Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Thu, 17 Oct 2024 08:50:35 -0600 Subject: [PATCH] fix: limit printTables to 50k total records --- src/table.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/table.tsx b/src/table.tsx index 0054313..adfa86d 100644 --- a/src/table.tsx +++ b/src/table.tsx @@ -561,7 +561,7 @@ export function printTables[]>( tables: {[P in keyof T]: TableOptions}, options?: Omit, ): void { - if (tables.some((table) => table.data.length > 50_000)) { + if (tables.reduce((acc, table) => acc + table.data.length, 0) > 50_000) { throw new Error('The data is too large to print multiple tables. Please use `printTable` instead.') }