check() — astro Function Reference
Architecture documentation for the check() function in server.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD be065432_7194_061e_9db9_7c1038799602["check()"] e59bec1a_ac20_e899_75d6_a672374af970["server.ts"] be065432_7194_061e_9db9_7c1038799602 -->|defined in| e59bec1a_ac20_e899_75d6_a672374af970 style be065432_7194_061e_9db9_7c1038799602 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/integrations/svelte/src/server.ts lines 7–15
function check(Component: any) {
if (typeof Component !== 'function') return false;
// Svelte 5 generated components always accept a `$$renderer` prop (previously called `$$payload`).
// This assumes that the SSR build does not minify it (which Astro enforces by default).
// This isn't the best check, but the only other option otherwise is to try to render the
// component, which is taxing. We'll leave it as a last resort for the future for now.
const componentString = Component.toString();
return componentString.includes('$$payload') || componentString.includes('$$renderer');
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does check() do?
check() is a function in the astro codebase, defined in packages/integrations/svelte/src/server.ts.
Where is check() defined?
check() is defined in packages/integrations/svelte/src/server.ts at line 7.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free