validateGetStaticPathsResult() — astro Function Reference
Architecture documentation for the validateGetStaticPathsResult() function in validation.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 2729dee8_afb3_6507_58c0_f621fbc40f93["validateGetStaticPathsResult()"] 026c8980_c8fc_05c8_19cb_d7abee54a53f["validation.ts"] 2729dee8_afb3_6507_58c0_f621fbc40f93 -->|defined in| 026c8980_c8fc_05c8_19cb_d7abee54a53f style 2729dee8_afb3_6507_58c0_f621fbc40f93 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/core/routing/validation.ts lines 41–75
export function validateGetStaticPathsResult(result: GetStaticPathsResult, route: RouteData) {
if (!Array.isArray(result)) {
throw new AstroError({
...AstroErrorData.InvalidGetStaticPathsReturn,
message: AstroErrorData.InvalidGetStaticPathsReturn.message(typeof result),
location: {
file: route.component,
},
});
}
result.forEach((pathObject) => {
if ((typeof pathObject === 'object' && Array.isArray(pathObject)) || pathObject === null) {
throw new AstroError({
...AstroErrorData.InvalidGetStaticPathsEntry,
message: AstroErrorData.InvalidGetStaticPathsEntry.message(
Array.isArray(pathObject) ? 'array' : typeof pathObject,
),
});
}
if (
pathObject.params === undefined ||
pathObject.params === null ||
(pathObject.params && Object.keys(pathObject.params).length === 0)
) {
throw new AstroError({
...AstroErrorData.GetStaticPathsExpectedParams,
location: {
file: route.component,
},
});
}
});
}
Domain
Subdomains
Source
Frequently Asked Questions
What does validateGetStaticPathsResult() do?
validateGetStaticPathsResult() is a function in the astro codebase, defined in packages/astro/src/core/routing/validation.ts.
Where is validateGetStaticPathsResult() defined?
validateGetStaticPathsResult() is defined in packages/astro/src/core/routing/validation.ts at line 41.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free