peekCodePathToUse() — astro Function Reference
Architecture documentation for the peekCodePathToUse() function in index.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 89a28493_939c_c420_4d10_e20fdbd81744["peekCodePathToUse()"] e4a1ef92_c598_36b5_dc33_9ab2535360bc["index.ts"] 89a28493_939c_c420_4d10_e20fdbd81744 -->|defined in| e4a1ef92_c598_36b5_dc33_9ab2535360bc 5ea57fa1_9639_1ac7_9ffa_757ade8153be["getLocaleRelativeUrl()"] 5ea57fa1_9639_1ac7_9ffa_757ade8153be -->|calls| 89a28493_939c_c420_4d10_e20fdbd81744 style 89a28493_939c_c420_4d10_e20fdbd81744 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/i18n/index.ts lines 281–297
function peekCodePathToUse(locales: Locales, locale: string): undefined | string {
for (const loopLocale of locales) {
if (typeof loopLocale === 'string') {
if (loopLocale === locale) {
return loopLocale;
}
} else {
for (const code of loopLocale.codes) {
if (code === locale) {
return loopLocale.path;
}
}
}
}
return undefined;
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does peekCodePathToUse() do?
peekCodePathToUse() is a function in the astro codebase, defined in packages/astro/src/i18n/index.ts.
Where is peekCodePathToUse() defined?
peekCodePathToUse() is defined in packages/astro/src/i18n/index.ts at line 281.
What calls peekCodePathToUse()?
peekCodePathToUse() is called by 1 function(s): getLocaleRelativeUrl.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free