formatArgs function

Last updated: 2026-03-01T23:25:47.125Z

Metrics

LOC: 15 Complexity: 5 Params: 1

Signature

formatArgs(args: unknown[]): : string

Source Code

function formatArgs(args: unknown[]): string {
  return args
    .map((a) => {
      if (a instanceof Error) return `${a.message}`;
      if (typeof a === "object" && a !== null) {
        try {
          return JSON.stringify(a);
        } catch {
          return String(a);
        }
      }
      return String(a);
    })
    .join(" ");
}

No outgoing dependencies.

Impact (Incoming)

graph LR formatArgs["formatArgs"] flushBuffer["flushBuffer"] emit["emit"] flushBuffer -->|calls| formatArgs emit -->|calls| formatArgs style formatArgs fill:#dbeafe,stroke:#2563eb,stroke-width:2px click formatArgs "7295db40a071fe9d.html" click flushBuffer "a9a9c3e65488e23e.html" click emit "131b8d3f5dc1f207.html"
SourceType
flushBuffer calls
emit calls