Skip to content

Commit 2617322

Browse files
committed
stringify bigint
1 parent 9af44c2 commit 2617322

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const imageTypes = ['.png', '.jpg', '.jpeg', '.gif', '.svg', '.tiff', '.w
103103
*/
104104
export function stringify(value: unknown): string {
105105
if (typeof value === 'string') return value
106-
if (typeof value === 'number') return value.toLocaleString('en-US')
106+
if (typeof value === 'number' || typeof value === 'bigint') return value.toLocaleString('en-US')
107107
if (Array.isArray(value)) {
108108
return `[\n${value.map((v) => indent(stringify(v), 2)).join(',\n')}\n]`
109109
}

0 commit comments

Comments
 (0)