File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -403,14 +403,18 @@ class MongoshNodeRepl implements EvaluationListener {
403403 replHistory . slice ( 1 ) . reverse ( ) ;
404404
405405 // eslint-disable-next-line @typescript-eslint/no-explicit-any
406- formattedHistory [ util . inspect . custom as any ] = ( ( ) => {
407- return formatOutput (
408- {
409- // Providing a copy of the history avoids a circular reference.
410- value : formattedHistory . concat ( ) ,
411- } ,
412- { colors : true , maxArrayLength : Infinity }
413- ) ;
406+ formattedHistory [ util . inspect . custom as any ] = ( (
407+ depth : number | null ,
408+ options : util . InspectOptions ,
409+ inspect : typeof util . inspect
410+ ) => {
411+ // We pass a copy of the array without the util.inspect.custom set
412+ // to prevent infinite recursion.
413+ return inspect ( formattedHistory . concat ( ) , {
414+ ...options ,
415+ depth,
416+ maxArrayLength : Infinity ,
417+ } ) ;
414418 // eslint-disable-next-line @typescript-eslint/no-explicit-any
415419 } ) as any ;
416420 return formattedHistory ;
You can’t perform that action at this time.
0 commit comments