File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,9 @@ export class BaseLogger<LogObj> {
193193 if ( seen . includes ( source ) ) {
194194 return { ...source } ;
195195 }
196- seen . push ( source ) ;
196+ if ( typeof source === "object" ) {
197+ seen . push ( source ) ;
198+ }
197199
198200 return isError ( source )
199201 ? source // dont copy Error
@@ -203,7 +205,7 @@ export class BaseLogger<LogObj> {
203205 ? source . map ( ( item ) => this . _recursiveCloneAndMaskValuesOfKeys ( item , keys , seen ) )
204206 : source instanceof Date
205207 ? new Date ( source . getTime ( ) )
206- : source && typeof source === "object"
208+ : source != null && typeof source === "object"
207209 ? Object . getOwnPropertyNames ( source ) . reduce ( ( o , prop ) => {
208210 Object . defineProperty ( o , prop , Object . getOwnPropertyDescriptor ( source , prop ) ! ) ;
209211 // mask
@@ -225,7 +227,9 @@ export class BaseLogger<LogObj> {
225227 if ( seen . includes ( source ) ) {
226228 return { ...source } ;
227229 }
228- seen . push ( source ) ;
230+ if ( typeof source === "object" ) {
231+ seen . push ( source ) ;
232+ }
229233
230234 return Array . isArray ( source )
231235 ? source . map ( ( item ) => this . _recursiveCloneAndExecuteFunctions ( item , seen ) )
You can’t perform that action at this time.
0 commit comments