MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / parsePort

Function parsePort

scripts/dev-extra-backend.mjs:25–36  ·  view source on GitHub ↗
(value, fallback)

Source from the content-addressed store, hash-verified

23const DEFAULT_WAIT_TIMEOUT_MS = 30_000;
24
25function parsePort(value, fallback) {
26 if (value == null || value === "") {
27 return fallback;
28 }
29
30 const parsed = Number.parseInt(value, 10);
31 if (!Number.isInteger(parsed) || parsed <= 0) {
32 throw new Error(`Invalid port: ${value}`);
33 }
34
35 return parsed;
36}
37
38/**
39 * Build a config for an *extra* standalone agent-server that shares the

Callers 1

buildExtraBackendConfigFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected