Home / Function/ selectValidator() — astro Function Reference

selectValidator() — astro Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  9f0736b8_fe2c_7232_075d_3effa18267d9["selectValidator()"]
  507d4b59_27b6_fc34_cbc8_02ec1d1596e5["validators.ts"]
  9f0736b8_fe2c_7232_075d_3effa18267d9 -->|defined in| 507d4b59_27b6_fc34_cbc8_02ec1d1596e5
  7defd900_fe4f_9186_7d79_276a00008760["validateEnvVariable()"]
  7defd900_fe4f_9186_7d79_276a00008760 -->|calls| 9f0736b8_fe2c_7232_075d_3effa18267d9
  88ee635a_01f9_6df7_6fb7_d77a70d01f58["stringValidator()"]
  9f0736b8_fe2c_7232_075d_3effa18267d9 -->|calls| 88ee635a_01f9_6df7_6fb7_d77a70d01f58
  3f11a603_711a_0253_d041_086a1ad22ffb["numberValidator()"]
  9f0736b8_fe2c_7232_075d_3effa18267d9 -->|calls| 3f11a603_711a_0253_d041_086a1ad22ffb
  86f01652_8ed4_3b66_e1c4_4d614b23e797["enumValidator()"]
  9f0736b8_fe2c_7232_075d_3effa18267d9 -->|calls| 86f01652_8ed4_3b66_e1c4_4d614b23e797
  style 9f0736b8_fe2c_7232_075d_3effa18267d9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/env/validators.ts lines 147–158

function selectValidator(options: EnvFieldType): ValueValidator {
	switch (options.type) {
		case 'string':
			return stringValidator(options);
		case 'number':
			return numberValidator(options);
		case 'boolean':
			return booleanValidator;
		case 'enum':
			return enumValidator(options);
	}
}

Domain

Subdomains

Frequently Asked Questions

What does selectValidator() do?
selectValidator() is a function in the astro codebase, defined in packages/astro/src/env/validators.ts.
Where is selectValidator() defined?
selectValidator() is defined in packages/astro/src/env/validators.ts at line 147.
What does selectValidator() call?
selectValidator() calls 3 function(s): enumValidator, numberValidator, stringValidator.
What calls selectValidator()?
selectValidator() is called by 1 function(s): validateEnvVariable.

Analyze Your Own Codebase

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

Try Supermodel Free