MCPcopy
hub / github.com/tailwindlabs/tailwindcss / walk

Function walk

packages/tailwindcss/src/walk.ts:44–55  ·  packages/tailwindcss/src/walk.ts::walk
(
  ast: T[],
  hooks:
    | ((node: T, ctx: VisitContext<T>) => EnterResult<T> | void) // Old API, enter only
    | {
        enter?: (node: T, ctx: VisitContext<T>) => EnterResult<T> | void
        exit?: (node: T, ctx: VisitContext<T>) => ExitResult<T> | void
      },
)

Source from the content-addressed store, hash-verified

42}
43
44export function walk<T extends object>(
45 ast: T[],
46 hooks:
47 | ((node: T, ctx: VisitContext<T>) => EnterResult<T> | void) class="cm">// Old API, enter only
48 | {
49 enter?: (node: T, ctx: VisitContext<T>) => EnterResult<T> | void
50 exit?: (node: T, ctx: VisitContext<T>) => ExitResult<T> | void
51 },
52): void {
53 if (typeof hooks === class="st">'function') walkImplementation(ast, hooks)
54 else walkImplementation(ast, hooks.enter, hooks.exit)
55}
56
57interface Stack<T> {
58 value: T

Callers 15

selectorsFunction · 0.90
parseCssFunction · 0.90
buildFunction · 0.90
ast.test.tsFile · 0.90
createCssUtilityFunction · 0.90
optimizeAstFunction · 0.90
findNodeFunction · 0.90
fromAstMethod · 0.90
createVariantsFunction · 0.90
substituteAtSlotFunction · 0.90
substituteAtVariantFunction · 0.90

Calls 1

walkImplementationFunction · 0.85

Tested by 1

expandFunction · 0.72