Home / Function/ invalidVariablesToError() — astro Function Reference

invalidVariablesToError() — astro Function Reference

Architecture documentation for the invalidVariablesToError() function in errors.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  3ef768b9_ad9a_92a1_63cb_9ec9cad85181["invalidVariablesToError()"]
  a8063e25_3885_a254_cf52_6348a01798bd["errors.ts"]
  3ef768b9_ad9a_92a1_63cb_9ec9cad85181 -->|defined in| a8063e25_3885_a254_cf52_6348a01798bd
  style 3ef768b9_ad9a_92a1_63cb_9ec9cad85181 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/env/errors.ts lines 9–22

export function invalidVariablesToError(invalid: Array<InvalidVariable>) {
	const _errors: Array<string> = [];
	for (const { key, type, errors } of invalid) {
		if (errors[0] === 'missing') {
			_errors.push(`${key} is missing`);
		} else if (errors[0] === 'type') {
			_errors.push(`${key}'s type is invalid, expected: ${type}`);
		} else {
			// constraints
			_errors.push(`The following constraints for ${key} are not met: ${errors.join(', ')}`);
		}
	}
	return _errors;
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free