File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ const formatDecodedLog = async (args: {
231
231
if ( name && name in logArgs ) {
232
232
res [ name ] = {
233
233
type,
234
- value : ( logArgs [ name ] as any ) . toString ( ) ,
234
+ value : logArgToString ( logArgs [ name ] ) ,
235
235
} ;
236
236
}
237
237
}
@@ -274,6 +274,19 @@ const getBlockTimestamps = async (
274
274
return res ;
275
275
} ;
276
276
277
+ const logArgToString = ( arg : any ) : string => {
278
+ if ( arg === null ) {
279
+ return "" ;
280
+ }
281
+ if ( typeof arg === "object" ) {
282
+ return Object . values ( arg ) . map ( logArgToString ) . join ( "," ) ;
283
+ }
284
+ if ( Array . isArray ( arg ) ) {
285
+ return arg . map ( logArgToString ) . join ( "," ) ;
286
+ }
287
+ return arg . toString ( ) ;
288
+ } ;
289
+
277
290
// Worker
278
291
let _worker : Worker | null = null ;
279
292
if ( redis ) {
You can’t perform that action at this time.
0 commit comments