File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ const createConsoleCatcher = (): {
2020 const seen = new WeakSet ( ) ;
2121
2222 return JSON . stringify ( obj , ( key , value ) => {
23+
2324 if ( typeof value === 'object' && value !== null ) {
25+
2426 if ( seen . has ( value ) ) {
2527 return '[Circular]' ;
2628 }
@@ -88,6 +90,7 @@ const createConsoleCatcher = (): {
8890 const createConsoleEventFromError = (
8991 event : ErrorEvent | PromiseRejectionEvent
9092 ) : ConsoleLogEvent => {
93+
9194 if ( event instanceof ErrorEvent ) {
9295
9396 return {
@@ -136,7 +139,8 @@ const createConsoleCatcher = (): {
136139
137140 window . console [ method ] = function ( ...args : unknown [ ] ) : void {
138141 const stack =
139- new Error ( ) . stack ?. split ( '\n' ) . slice ( 2 ) . join ( '\n' ) || '' ;
142+ new Error ( ) . stack ?. split ( '\n' ) . slice ( 2 )
143+ . join ( '\n' ) || '' ;
140144 const { message, styles } = formatConsoleArgs ( args ) ;
141145
142146 const logEvent : ConsoleLogEvent = {
@@ -163,7 +167,7 @@ const createConsoleCatcher = (): {
163167
164168 getConsoleLogStack ( ) : ConsoleLogEvent [ ] {
165169
166- return [ ...consoleOutput ] ;
170+ return [ ...consoleOutput ] ;
167171 } ,
168172 } ;
169173} ;
You can’t perform that action at this time.
0 commit comments