From 9c4d477954733cb58ba288030c83b17875b97f81 Mon Sep 17 00:00:00 2001 From: Curtis Reimer Date: Wed, 20 Nov 2024 17:04:54 -0600 Subject: [PATCH] added bigint to formatters --- .../test-project-rsc-kitchen-sink/web/src/lib/formatters.tsx | 2 +- __fixtures__/test-project/web/src/lib/formatters.tsx | 2 +- .../generate/scaffold/templates/lib/formatters.tsx.template | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/__fixtures__/test-project-rsc-kitchen-sink/web/src/lib/formatters.tsx b/__fixtures__/test-project-rsc-kitchen-sink/web/src/lib/formatters.tsx index 8ab9e806e3cd..8e5c4376186d 100644 --- a/__fixtures__/test-project-rsc-kitchen-sink/web/src/lib/formatters.tsx +++ b/__fixtures__/test-project-rsc-kitchen-sink/web/src/lib/formatters.tsx @@ -25,7 +25,7 @@ export const jsonDisplay = (obj: unknown) => { ) } -export const truncate = (value: string | number) => { +export const truncate = (value: string | number | bigint) => { let output = value?.toString() ?? '' if (output.length > MAX_STRING_LENGTH) { diff --git a/__fixtures__/test-project/web/src/lib/formatters.tsx b/__fixtures__/test-project/web/src/lib/formatters.tsx index 8ab9e806e3cd..8e5c4376186d 100644 --- a/__fixtures__/test-project/web/src/lib/formatters.tsx +++ b/__fixtures__/test-project/web/src/lib/formatters.tsx @@ -25,7 +25,7 @@ export const jsonDisplay = (obj: unknown) => { ) } -export const truncate = (value: string | number) => { +export const truncate = (value: string | number | bigint) => { let output = value?.toString() ?? '' if (output.length > MAX_STRING_LENGTH) { diff --git a/packages/cli/src/commands/generate/scaffold/templates/lib/formatters.tsx.template b/packages/cli/src/commands/generate/scaffold/templates/lib/formatters.tsx.template index 8ab9e806e3cd..8e5c4376186d 100644 --- a/packages/cli/src/commands/generate/scaffold/templates/lib/formatters.tsx.template +++ b/packages/cli/src/commands/generate/scaffold/templates/lib/formatters.tsx.template @@ -25,7 +25,7 @@ export const jsonDisplay = (obj: unknown) => { ) } -export const truncate = (value: string | number) => { +export const truncate = (value: string | number | bigint) => { let output = value?.toString() ?? '' if (output.length > MAX_STRING_LENGTH) {