1
1
'use strict' ;
2
2
3
- const util = require ( 'util' ) ;
3
+ const { inspect } = require ( 'internal/ util/inspect ' ) ;
4
4
const {
5
5
encodeStr,
6
6
hexTable,
@@ -184,7 +184,7 @@ class URLSearchParams {
184
184
this [ context ] = null ;
185
185
}
186
186
187
- [ util . inspect . custom ] ( recurseTimes , ctx ) {
187
+ [ inspect . custom ] ( recurseTimes , ctx ) {
188
188
if ( ! this || ! this [ searchParams ] || this [ searchParams ] [ searchParams ] ) {
189
189
throw new ERR_INVALID_THIS ( 'URLSearchParams' ) ;
190
190
}
@@ -197,7 +197,7 @@ class URLSearchParams {
197
197
if ( recurseTimes !== null ) {
198
198
innerOpts . depth = recurseTimes - 1 ;
199
199
}
200
- var innerInspect = ( v ) => util . inspect ( v , innerOpts ) ;
200
+ var innerInspect = ( v ) => inspect ( v , innerOpts ) ;
201
201
202
202
var list = this [ searchParams ] ;
203
203
var output = [ ] ;
@@ -334,7 +334,7 @@ class URL {
334
334
scheme === 'file:' ) ;
335
335
}
336
336
337
- [ util . inspect . custom ] ( depth , opts ) {
337
+ [ inspect . custom ] ( depth , opts ) {
338
338
if ( this == null ||
339
339
Object . getPrototypeOf ( this [ context ] ) !== URLContext . prototype ) {
340
340
throw new ERR_INVALID_THIS ( 'URL' ) ;
@@ -368,7 +368,7 @@ class URL {
368
368
obj [ context ] = this [ context ] ;
369
369
}
370
370
371
- return util . inspect ( obj , opts ) ;
371
+ return inspect ( obj , opts ) ;
372
372
}
373
373
}
374
374
@@ -1194,7 +1194,7 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', {
1194
1194
done : false
1195
1195
} ;
1196
1196
} ,
1197
- [ util . inspect . custom ] ( recurseTimes , ctx ) {
1197
+ [ inspect . custom ] ( recurseTimes , ctx ) {
1198
1198
if ( this == null || this [ context ] == null || this [ context ] . target == null )
1199
1199
throw new ERR_INVALID_THIS ( 'URLSearchParamsIterator' ) ;
1200
1200
@@ -1221,8 +1221,8 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', {
1221
1221
}
1222
1222
return prev ;
1223
1223
} , [ ] ) ;
1224
- const breakLn = util . inspect ( output , innerOpts ) . includes ( '\n' ) ;
1225
- const outputStrs = output . map ( ( p ) => util . inspect ( p , innerOpts ) ) ;
1224
+ const breakLn = inspect ( output , innerOpts ) . includes ( '\n' ) ;
1225
+ const outputStrs = output . map ( ( p ) => inspect ( p , innerOpts ) ) ;
1226
1226
let outputStr ;
1227
1227
if ( breakLn ) {
1228
1228
outputStr = `\n ${ outputStrs . join ( ',\n ' ) } ` ;
0 commit comments