Home / Function/ dfs() — astro Function Reference

dfs() — astro Function Reference

Architecture documentation for the dfs() function in generate-routes-json.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  1516aa5b_1a39_c867_d966_059e1c41856a["dfs()"]
  55782c85_47d4_4354_44a2_7507d9d6dbee["PathTrie"]
  1516aa5b_1a39_c867_d966_059e1c41856a -->|defined in| 55782c85_47d4_4354_44a2_7507d9d6dbee
  fb74c78c_04f8_7b51_cb60_ee71ba657144["getAllPaths()"]
  fb74c78c_04f8_7b51_cb60_ee71ba657144 -->|calls| 1516aa5b_1a39_c867_d966_059e1c41856a
  style 1516aa5b_1a39_c867_d966_059e1c41856a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/cloudflare/src/utils/generate-routes-json.ts lines 118–132

	private dfs(node: TrieNode, thisPath: string[], allPaths: string[][]): void {
		if (node.hasWildcardChild) {
			this.returnHasWildcard = true;
			allPaths.push([...thisPath, '*']);
			return;
		}

		if (node.isEndOfPath) {
			allPaths.push([...thisPath]);
		}

		for (const [segment, childNode] of node.children) {
			this.dfs(childNode, [...thisPath, segment], allPaths);
		}
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does dfs() do?
dfs() is a function in the astro codebase, defined in packages/integrations/cloudflare/src/utils/generate-routes-json.ts.
Where is dfs() defined?
dfs() is defined in packages/integrations/cloudflare/src/utils/generate-routes-json.ts at line 118.
What calls dfs()?
dfs() is called by 1 function(s): getAllPaths.

Analyze Your Own Codebase

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

Try Supermodel Free