|
4 | 4 | */ |
5 | 5 |
|
6 | 6 | import { isWeb } from '../extensionGlobals' |
7 | | -import { InspectOptions as nodeInspectOptions, inspect as nodeInspect } from 'util' |
| 7 | +import { inspect as nodeInspect, InspectOptions } from 'util' |
8 | 8 | import { AsyncCollection, toCollection } from './asyncCollection' |
9 | 9 | import { SharedProp, AccumulableKeys, Coalesce, isNonNullable } from './tsUtils' |
10 | 10 |
|
@@ -330,29 +330,16 @@ export function partialClone(obj: any, depth: number = 3, omitKeys: string[] = [ |
330 | 330 | return clonedObj |
331 | 331 | } |
332 | 332 |
|
333 | | -type inspectOptions = Partial< |
334 | | - nodeInspectOptions & { |
335 | | - omitKeys: string[] |
336 | | - replacement: any |
337 | | - } |
338 | | -> |
339 | | - |
340 | 333 | /** |
341 | 334 | * Wrapper around nodes inspect function that works on web. Defaults to JSON.stringify on web. |
342 | 335 | * @param obj object to show |
343 | 336 | * @param opt options for showing (ex. depth, omitting keys) |
344 | 337 | */ |
345 | | -export function inspect(obj: any, opt?: inspectOptions): string { |
| 338 | +export function inspect(obj: any, opt?: InspectOptions): string { |
346 | 339 | const options = { |
347 | 340 | depth: opt?.depth ?? 3, |
348 | | - omitKeys: opt?.omitKeys ?? [], |
349 | | - replacement: opt?.replacement, |
350 | | - showHidden: opt?.showHidden ?? false, |
351 | | - color: opt?.colors ?? false, |
352 | | - } |
353 | | - return isWeb() |
354 | | - ? JSON.stringify(partialClone(obj, options.depth, options.omitKeys, options.replacement), undefined, 2) |
355 | | - : nodeInspect(obj, options) |
| 341 | + } |
| 342 | + return isWeb() ? JSON.stringify(partialClone(obj, options.depth), undefined, 2) : nodeInspect(obj, options) |
356 | 343 | } |
357 | 344 |
|
358 | 345 | /** Recursively delete undefined key/value pairs */ |
|
0 commit comments