MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / optionalFiniteNumber

Function optionalFiniteNumber

projects/runtime-node/src/validation.ts:62–68  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

60}
61
62export function optionalFiniteNumber(key: string): ParamCheck {
63 return (record) => {
64 const value = record[key]
65 if (value !== undefined && (typeof value !== "number" || !Number.isFinite(value))) return paramsError(`$.${key}`, `${key} must be a finite number`)
66 return null
67 }
68}
69
70export function requiredPositiveInteger(key: string): ParamCheck {
71 return (record) => {

Calls 1

paramsErrorFunction · 0.70

Tested by

no test coverage detected