Home / Function/ segmentsToCfSyntax() — astro Function Reference

segmentsToCfSyntax() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  af0cdc9e_8242_4e0c_ac86_586602e54c28["segmentsToCfSyntax()"]
  da981689_3d65_7d59_3c95_800d340ef108["generate-routes-json.ts"]
  af0cdc9e_8242_4e0c_ac86_586602e54c28 -->|defined in| da981689_3d65_7d59_3c95_800d340ef108
  8640426d_7494_3130_6574_2a01f8ff809d["createRoutesFile()"]
  8640426d_7494_3130_6574_2a01f8ff809d -->|calls| af0cdc9e_8242_4e0c_ac86_586602e54c28
  style af0cdc9e_8242_4e0c_ac86_586602e54c28 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/cloudflare/src/utils/generate-routes-json.ts lines 70–80

function segmentsToCfSyntax(segments: IntegrationResolvedRoute['segments'], _config: AstroConfig) {
	const pathSegments = [];
	if (removeLeadingForwardSlash(removeTrailingForwardSlash(_config.base)).length > 0) {
		pathSegments.push(removeLeadingForwardSlash(removeTrailingForwardSlash(_config.base)));
	}
	for (const segment of segments.flat()) {
		if (segment.dynamic) pathSegments.push('*');
		else pathSegments.push(segment.content);
	}
	return pathSegments;
}

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free