Home / Function/ toCodes() — astro Function Reference

toCodes() — astro Function Reference

Architecture documentation for the toCodes() function in index.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  06094faf_bf64_c24d_c02f_c4f82b35ccc7["toCodes()"]
  e4a1ef92_c598_36b5_dc33_9ab2535360bc["index.ts"]
  06094faf_bf64_c24d_c02f_c4f82b35ccc7 -->|defined in| e4a1ef92_c598_36b5_dc33_9ab2535360bc
  66f0f5a6_e902_0cba_8a68_5853da33a41f["getLocaleAbsoluteUrlList()"]
  66f0f5a6_e902_0cba_8a68_5853da33a41f -->|calls| 06094faf_bf64_c24d_c02f_c4f82b35ccc7
  style 06094faf_bf64_c24d_c02f_c4f82b35ccc7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/i18n/index.ts lines 257–265

export function toCodes(locales: Locales): string[] {
	return locales.map((loopLocale) => {
		if (typeof loopLocale === 'string') {
			return loopLocale;
		} else {
			return loopLocale.codes[0];
		}
	});
}

Domain

Subdomains

Frequently Asked Questions

What does toCodes() do?
toCodes() is a function in the astro codebase, defined in packages/astro/src/i18n/index.ts.
Where is toCodes() defined?
toCodes() is defined in packages/astro/src/i18n/index.ts at line 257.
What calls toCodes()?
toCodes() is called by 1 function(s): getLocaleAbsoluteUrlList.

Analyze Your Own Codebase

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

Try Supermodel Free