MCPcopy Index your code
hub / github.com/Waishnav/devspace / parsePort

Function parsePort

src/config.ts:32–41  ·  view source on GitHub ↗
(value: string | number | undefined)

Source from the content-addressed store, hash-verified

30}
31
32function parsePort(value: string | number | undefined): number {
33 if (value === undefined || value === "") return 7676;
34
35 const port = Number(value);
36 if (!Number.isInteger(port) || port < 1 || port > 65535) {
37 throw new Error(`Invalid PORT: ${value}`);
38 }
39
40 return port;
41}
42
43function parseAllowedRoots(value: string | string[] | undefined): string[] {
44 if (Array.isArray(value)) {

Callers 1

loadConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected