@@ -862,6 +862,7 @@ URLSearchParams.prototype[Symbol.iterator] = URLSearchParams.prototype.entries;
862
862
863
863
URLSearchParams . prototype [ util . inspect . custom ] =
864
864
function inspect ( recurseTimes , ctx ) {
865
+ const separator = ', ' ;
865
866
const innerOpts = Object . assign ( { } , ctx ) ;
866
867
if ( recurseTimes !== null ) {
867
868
innerOpts . depth = recurseTimes - 1 ;
@@ -874,13 +875,14 @@ URLSearchParams.prototype[util.inspect.custom] =
874
875
output . push ( `${ innerInspect ( list [ i ] ) } => ${ innerInspect ( list [ i + 1 ] ) } ` ) ;
875
876
876
877
const colorRe = / \u001b \[ \d \d ? m / g;
877
- const length = output . reduce ( ( prev , cur ) => {
878
- return prev + cur . replace ( colorRe , '' ) . length + ', ' . length ;
879
- } , - ', ' . length ) ;
878
+ const length = output . reduce (
879
+ ( prev , cur ) => prev + cur . replace ( colorRe , '' ) . length + separator . length ,
880
+ - separator . length
881
+ ) ;
880
882
if ( length > ctx . breakLength ) {
881
883
return `${ this . constructor . name } {\n ${ output . join ( ',\n ' ) } }` ;
882
884
} else if ( output . length ) {
883
- return `${ this . constructor . name } { ${ output . join ( ', ' ) } }` ;
885
+ return `${ this . constructor . name } { ${ output . join ( separator ) } }` ;
884
886
} else {
885
887
return `${ this . constructor . name } {}` ;
886
888
}
0 commit comments