Home / Function/ booleanValidator() — astro Function Reference

booleanValidator() — astro Function Reference

Architecture documentation for the booleanValidator() function in validators.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  4246c0c2_ca9d_4490_891f_b54abf22e5eb["booleanValidator()"]
  507d4b59_27b6_fc34_cbc8_02ec1d1596e5["validators.ts"]
  4246c0c2_ca9d_4490_891f_b54abf22e5eb -->|defined in| 507d4b59_27b6_fc34_cbc8_02ec1d1596e5
  style 4246c0c2_ca9d_4490_891f_b54abf22e5eb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/env/validators.ts lines 118–130

const booleanValidator: ValueValidator = (input) => {
	const bool = input === 'true' ? true : input === 'false' ? false : undefined;
	if (typeof bool !== 'boolean') {
		return {
			ok: false,
			errors: ['type'],
		};
	}
	return {
		ok: true,
		value: bool,
	};
};

Domain

Subdomains

Frequently Asked Questions

What does booleanValidator() do?
booleanValidator() is a function in the astro codebase, defined in packages/astro/src/env/validators.ts.
Where is booleanValidator() defined?
booleanValidator() is defined in packages/astro/src/env/validators.ts at line 118.

Analyze Your Own Codebase

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

Try Supermodel Free