Home / Function/ allowedDirectivesSchema() — astro Function Reference

allowedDirectivesSchema() — astro Function Reference

Architecture documentation for the allowedDirectivesSchema() function in config.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  c3b56015_bc28_5360_7939_6dea7baec244["allowedDirectivesSchema()"]
  12361455_4ce4_1b8b_4844_c147f4e9ca5e["config.ts"]
  c3b56015_bc28_5360_7939_6dea7baec244 -->|defined in| 12361455_4ce4_1b8b_4844_c147f4e9ca5e
  style c3b56015_bc28_5360_7939_6dea7baec244 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/csp/config.ts lines 70–77

export const allowedDirectivesSchema = z.custom<CspDirective>((value) => {
	if (typeof value !== 'string') {
		return false;
	}
	return ALLOWED_DIRECTIVES.some((allowedValue) => {
		return value.startsWith(allowedValue);
	});
});

Domain

Subdomains

Frequently Asked Questions

What does allowedDirectivesSchema() do?
allowedDirectivesSchema() is a function in the astro codebase, defined in packages/astro/src/core/csp/config.ts.
Where is allowedDirectivesSchema() defined?
allowedDirectivesSchema() is defined in packages/astro/src/core/csp/config.ts at line 70.

Analyze Your Own Codebase

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

Try Supermodel Free