Home / File/ env.ts — astro Source File

env.ts — astro Source File

Architecture documentation for env.ts, a typescript file in the astro codebase. 1 imports, 0 dependents.

File typescript CoreAstro RoutingSystem 1 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  ef24be78_05d9_15ad_044f_15af3eb84ac9["env.ts"]
  cb36772b_5ea4_3a79_49fa_b1570632623e["setup"]
  ef24be78_05d9_15ad_044f_15af3eb84ac9 --> cb36772b_5ea4_3a79_49fa_b1570632623e
  style ef24be78_05d9_15ad_044f_15af3eb84ac9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { GetEnv } from 'astro/env/setup';

export const createGetEnv =
	(env: Record<string, unknown>): GetEnv =>
	(key) => {
		const v = env[key];
		if (typeof v === 'undefined' || typeof v === 'string') {
			return v;
		}
		if (typeof v === 'boolean' || typeof v === 'number') {
			// let astro:env handle the validation and transformation
			return v.toString();
		}
		return undefined;
	};

Domain

Subdomains

Functions

Dependencies

  • setup

Frequently Asked Questions

What does env.ts do?
env.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RoutingSystem subdomain.
What functions are defined in env.ts?
env.ts defines 1 function(s): createGetEnv.
What does env.ts depend on?
env.ts imports 1 module(s): setup.
Where is env.ts in the architecture?
env.ts is located at packages/integrations/cloudflare/src/utils/env.ts (domain: CoreAstro, subdomain: RoutingSystem, directory: packages/integrations/cloudflare/src/utils).

Analyze Your Own Codebase

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

Try Supermodel Free