MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / formatArg

Function formatArg

src/formatters/ConsoleFormatter.ts:324–336  ·  view source on GitHub ↗
(arg: unknown, formatter: {isIgnored: IgnoreCheck})

Source from the content-addressed store, hash-verified

322}
323
324function formatArg(arg: unknown, formatter: {isIgnored: IgnoreCheck}) {
325 if (arg instanceof SymbolizedError) {
326 return [
327 arg.message,
328 arg.stackTrace
329 ? formatStackTrace(arg.stackTrace, arg.cause, formatter)
330 : undefined,
331 ]
332 .filter(line => !!line)
333 .join('\n');
334 }
335 return typeof arg === 'object' ? JSON.stringify(arg) : String(arg);
336}
337
338const STACK_TRACE_MAX_LINES = 50;
339

Callers 1

toJSONDetailedMethod · 0.85

Calls 2

formatStackTraceFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected