Skip to content

Commit

Permalink
Fix unreal override logs stringify method to handle bigint stringific…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
corbanbrook committed Jan 20, 2025
1 parent be11137 commit c404fef
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { bigintReplacer } from '@0xsequence/utils'

interface UnrealInjectedWindow {
ue?: {
sequencewallettransport?: {
Expand Down Expand Up @@ -30,5 +32,7 @@ export function overrideLogs(side: 'dapp' | 'wallet') {
}

function stringify(things: unknown[]): string {
return things.map(a => (typeof a === 'object' ? (a instanceof Error ? a.message : JSON.stringify(a)) : String(a))).join(' ')
return things
.map(a => (typeof a === 'object' ? (a instanceof Error ? a.message : JSON.stringify(a, bigintReplacer)) : String(a)))
.join(' ')
}

0 comments on commit c404fef

Please sign in to comment.