Skip to content

Commit

Permalink
fix: limit printTables to 50k total records
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 17, 2024
1 parent e8bfaad commit b698088
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ export function printTables<T extends Record<string, unknown>[]>(
tables: {[P in keyof T]: TableOptions<T[P]>},
options?: Omit<ContainerProps, 'children'>,
): 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.')
}

Expand Down

0 comments on commit b698088

Please sign in to comment.