Home / Function/ printDiff() — ui Function Reference

printDiff() — ui Function Reference

Architecture documentation for the printDiff() function in diff.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  9a760ff0_ddbf_cb47_2318_30f38613133e["printDiff()"]
  d3456bc0_654c_565f_5730_78cca3c9f4c8["diff.ts"]
  9a760ff0_ddbf_cb47_2318_30f38613133e -->|defined in| d3456bc0_654c_565f_5730_78cca3c9f4c8
  b4fcf087_084f_27d7_c2a4_74d4dadef3b5["diff()"]
  b4fcf087_084f_27d7_c2a4_74d4dadef3b5 -->|calls| 9a760ff0_ddbf_cb47_2318_30f38613133e
  style 9a760ff0_ddbf_cb47_2318_30f38613133e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/commands/diff.ts lines 203–216

async function printDiff(diff: Change[]) {
  diff.forEach((part) => {
    if (part) {
      if (part.added) {
        return process.stdout.write(highlighter.success(part.value))
      }
      if (part.removed) {
        return process.stdout.write(highlighter.error(part.value))
      }

      return process.stdout.write(part.value)
    }
  })
}

Subdomains

Called By

Frequently Asked Questions

What does printDiff() do?
printDiff() is a function in the ui codebase, defined in packages/shadcn/src/commands/diff.ts.
Where is printDiff() defined?
printDiff() is defined in packages/shadcn/src/commands/diff.ts at line 203.
What calls printDiff()?
printDiff() is called by 1 function(s): diff.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free