File tree 3 files changed +8
-1
lines changed
3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 49
49
"dependencies" : {
50
50
"@hawk.so/types" : " ^0.1.20" ,
51
51
"error-stack-parser" : " ^2.1.4" ,
52
+ "safe-stringify" : " ^1.1.1" ,
52
53
"vite-plugin-dts" : " ^4.2.4"
53
54
}
54
55
}
Original file line number Diff line number Diff line change 3
3
*/
4
4
5
5
import type { ConsoleLogEvent } from '@hawk.so/types' ;
6
+ import safeStringify from 'safe-stringify' ;
6
7
7
8
const createConsoleCatcher = ( ) : {
8
9
initConsoleCatcher : ( ) => void ;
@@ -69,7 +70,7 @@ const createConsoleCatcher = (): {
69
70
method,
70
71
timestamp : new Date ( ) ,
71
72
type : method ,
72
- message : args . map ( ( arg ) => typeof arg === 'string' ? arg : JSON . stringify ( arg ) ) . join ( ' ' ) ,
73
+ message : args . map ( ( arg ) => typeof arg === 'string' ? arg : safeStringify ( arg ) ) . join ( ' ' ) ,
73
74
stack,
74
75
fileLine : stack . split ( '\n' ) [ 0 ] ?. trim ( ) ,
75
76
} ;
Original file line number Diff line number Diff line change @@ -2619,6 +2619,11 @@ safe-regex-test@^1.0.3:
2619
2619
es-errors "^1.3.0"
2620
2620
is-regex "^1.1.4"
2621
2621
2622
+ safe-stringify@^1.1.1 :
2623
+ version "1.1.1"
2624
+ resolved "https://registry.yarnpkg.com/safe-stringify/-/safe-stringify-1.1.1.tgz#f4240f506d041f58374d6106e2a5850f6b1ce576"
2625
+ integrity sha512-YSzQLuwp06fuvJD1h6+vVNFYZoXmDs5UUNPUbTvQK7Ap+L0qD4Vp+sN434C+pdS3prVVlUfQdNeiEIgxox/kUQ==
2626
+
2622
2627
semver@^6.3.1 :
2623
2628
version "6.3.1"
2624
2629
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
You can’t perform that action at this time.
0 commit comments