Home / Function/ findNode() — tailwindcss Function Reference

findNode() — tailwindcss Function Reference

Architecture documentation for the findNode() function in ast.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  a9d656ee_4882_d7f1_c98a_c18a84b72f3f["findNode()"]
  a6e11c3d_c962_0a65_d91f_6fbe955cf4f0["optimizeAst()"]
  a6e11c3d_c962_0a65_d91f_6fbe955cf4f0 -->|calls| a9d656ee_4882_d7f1_c98a_c18a84b72f3f
  a32bba76_f60d_883f_1ff1_276a0bb9db9f["walk()"]
  a9d656ee_4882_d7f1_c98a_c18a84b72f3f -->|calls| a32bba76_f60d_883f_1ff1_276a0bb9db9f
  style a9d656ee_4882_d7f1_c98a_c18a84b72f3f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/ast.ts lines 889–899

function findNode(ast: AstNode[], fn: (node: AstNode) => boolean): AstNode[] | null {
  let foundPath: AstNode[] = []
  walk(ast, (node, ctx) => {
    if (fn(node)) {
      foundPath = ctx.path()
      foundPath.push(node)
      return WalkAction.Stop
    }
  })
  return foundPath
}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does findNode() do?
findNode() is a function in the tailwindcss codebase.
What does findNode() call?
findNode() calls 1 function(s): walk.
What calls findNode()?
findNode() is called by 1 function(s): optimizeAst.

Analyze Your Own Codebase

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

Try Supermodel Free