@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 18 lines 618 Bytes
Raw
1 // Alchemy modifications are licensed under Apache-2.0.
2 // This file includes third-party code; see /THIRD_PARTY_LICENSES.md.
3 // Vendored from `@astrojs/cloudflare` v14.4.2 (`src/utils/env.ts`).
4 import type { GetEnv } from "astro/env/setup";
5
6 export const createGetEnv =
7 (env: Record<string, unknown>): GetEnv =>
8 (key) => {
9 const v = env[key];
10 if (typeof v === "undefined" || typeof v === "string") {
11 return v;
12 }
13 if (typeof v === "boolean" || typeof v === "number") {
14 // let astro:env handle the validation and transformation
15 return v.toString();
16 }
17 return undefined;
18 };