Home / Function/ getSegment() — astro Function Reference

getSegment() — astro Function Reference

Architecture documentation for the getSegment() function in generator.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  7242b7d7_2c3a_ea6c_bba0_c245bbd1dd26["getSegment()"]
  f66463aa_0743_20f2_0ef3_7ae29013020e["generator.ts"]
  7242b7d7_2c3a_ea6c_bba0_c245bbd1dd26 -->|defined in| f66463aa_0743_20f2_0ef3_7ae29013020e
  2da823ca_da3b_3728_ec76_2cea8f93934e["getRouteGenerator()"]
  2da823ca_da3b_3728_ec76_2cea8f93934e -->|calls| 7242b7d7_2c3a_ea6c_bba0_c245bbd1dd26
  762791f4_4c9b_ccc4_94a1_b02e59d4a7f3["getParameter()"]
  7242b7d7_2c3a_ea6c_bba0_c245bbd1dd26 -->|calls| 762791f4_4c9b_ccc4_94a1_b02e59d4a7f3
  style 7242b7d7_2c3a_ea6c_bba0_c245bbd1dd26 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/routing/manifest/generator.ts lines 41–45

function getSegment(segment: RoutePart[], params: Record<string, string | number>): string {
	const segmentPath = segment.map((part) => getParameter(part, params)).join('');

	return segmentPath ? '/' + segmentPath : '';
}

Domain

Subdomains

Frequently Asked Questions

What does getSegment() do?
getSegment() is a function in the astro codebase, defined in packages/astro/src/core/routing/manifest/generator.ts.
Where is getSegment() defined?
getSegment() is defined in packages/astro/src/core/routing/manifest/generator.ts at line 41.
What does getSegment() call?
getSegment() calls 1 function(s): getParameter.
What calls getSegment()?
getSegment() is called by 1 function(s): getRouteGenerator.

Analyze Your Own Codebase

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

Try Supermodel Free