MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / parseOptionalNonNegativeInt

Function parseOptionalNonNegativeInt

src/cli.ts:1028–1034  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

1026}
1027
1028function parseOptionalNonNegativeInt(value: unknown): number | null {
1029 const parsed = Number.parseInt(String(value ?? ''), 10);
1030 if (!Number.isFinite(parsed) || parsed < 0) {
1031 return null;
1032 }
1033 return parsed;
1034}
1035
1036function parseBooleanEnv(value: unknown, defaultValue = false): boolean {
1037 const normalized = String(value ?? '').trim().toLowerCase();

Calls

no outgoing calls

Tested by

no test coverage detected