cloneAstNodeSpread() — tailwindcss Function Reference
Architecture documentation for the cloneAstNodeSpread() function in ast.bench.ts from the tailwindcss codebase.
Entity Profile
Relationship Graph
Source Code
packages/tailwindcss/src/ast.bench.ts lines 46–64
function cloneAstNodeSpread<T extends AstNode>(node: T): T {
switch (node.kind) {
case 'rule':
case 'at-rule':
case 'at-root':
return { ...node, nodes: node.nodes.map(cloneAstNodeSpread) }
case 'context':
return { ...node, context: { ...node.context }, nodes: node.nodes.map(cloneAstNodeSpread) }
case 'declaration':
case 'comment':
return { ...node }
default:
node satisfies never
throw new Error(`Unknown node kind: ${(node as any).kind}`)
}
}
Domain
Subdomains
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free