walk() — tailwindcss Function Reference
Architecture documentation for the walk() function in apply-config-to-theme.ts from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 3c5fd219_14a5_c325_da58_a54d19bbbdd4["walk()"] 8d84257d_f3b2_cdf8_542f_835967da0481["apply-config-to-theme.ts"] 3c5fd219_14a5_c325_da58_a54d19bbbdd4 -->|defined in| 8d84257d_f3b2_cdf8_542f_835967da0481 961a5671_178b_5937_79ae_2463c9fb3bc9["themeableValues()"] 961a5671_178b_5937_79ae_2463c9fb3bc9 -->|calls| 3c5fd219_14a5_c325_da58_a54d19bbbdd4 style 3c5fd219_14a5_c325_da58_a54d19bbbdd4 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/tailwindcss/src/compat/apply-config-to-theme.ts lines 278–303
function walk(
obj: Record<string, unknown>,
path: string[] = [],
callback: (value: unknown, path: string[]) => WalkAction | void,
) {
for (let key of Reflect.ownKeys(obj) as string[]) {
let value = obj[key]
if (value === undefined || value === null) {
continue
}
let keyPath = [...path, key]
let result = callback(value, keyPath) ?? WalkAction.Continue
if (result === WalkAction.Skip) continue
if (result === WalkAction.Stop) return WalkAction.Stop
if (!Array.isArray(value) && typeof value !== 'object') continue
if (walk(value as any, keyPath, callback) === WalkAction.Stop) {
return WalkAction.Stop
}
}
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does walk() do?
walk() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/compat/apply-config-to-theme.ts.
Where is walk() defined?
walk() is defined in packages/tailwindcss/src/compat/apply-config-to-theme.ts at line 278.
What calls walk()?
walk() is called by 1 function(s): themeableValues.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free