MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / envInt

Function envInt

server/src/config.ts:18–26  ·  view source on GitHub ↗
(name: string, fallback: number)

Source from the content-addressed store, hash-verified

16}
17
18function envInt(name: string, fallback: number): number {
19 const raw = process.env[name];
20 if (raw === undefined) return fallback;
21 const parsed = parseInt(raw, 10);
22 if (isNaN(parsed) || parsed < 0) {
23 throw new Error(`Invalid ${name}: "${raw}" (must be a non-negative integer)`);
24 }
25 return parsed;
26}
27
28/**
29 * Get database configuration from environment variables

Callers 1

getDatabaseConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected