MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / parseIntEnv

Function parseIntEnv

src/workspaces/config.ts:163–170  ·  view source on GitHub ↗
(raw: string | undefined, fallback: number, lo: number, hi: number)

Source from the content-addressed store, hash-verified

161}
162
163function parseIntEnv(raw: string | undefined, fallback: number, lo: number, hi: number): number {
164 if (raw === undefined) return fallback;
165 const n = Number.parseInt(raw, 10);
166 if (!Number.isFinite(n)) return fallback;
167 if (n < lo) return lo;
168 if (n > hi) return hi;
169 return n;
170}
171
172/**
173 * Compute the launcher repo root.

Callers 1

loadConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected