MCPcopy
hub / github.com/subquery/subql / validate

Function validate

packages/node-core/src/utils/project.ts:28–31  ·  view source on GitHub ↗
(x: any)

Source from the content-addressed store, hash-verified

26
27export async function getValidPort(argvPort?: number): Promise<number> {
28 const validate = (x: any) => {
29 const p = parseInt(x);
30 return isNaN(p) ? null : p;
31 };
32
33 const port = validate(argvPort) ?? (await findAvailablePort(DEFAULT_PORT));
34 if (!port) {

Callers 1

getValidPortFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected