MCPcopy Index your code
hub / github.com/cameri/nostream / validateInteger

Function validateInteger

src/cli/utils/env-config.ts:115–126  ·  view source on GitHub ↗
(key: string, value: string)

Source from the content-addressed store, hash-verified

113}
114
115const validateInteger = (key: string, value: string): string | undefined => {
116 if (!/^-?\d+$/.test(value.trim())) {
117 return `${key} must be an integer`
118 }
119
120 const parsed = Number(value)
121 if (!Number.isSafeInteger(parsed)) {
122 return `${key} must be a safe integer`
123 }
124
125 return undefined
126}
127
128const validateBoolean = (key: string, value: string): string | undefined => {
129 const normalized = value.trim().toLowerCase()

Callers 1

validateEnvPairFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected