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

Function optionalBoolean

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

Source from the content-addressed store, hash-verified

52}
53
54export function optionalBoolean(key: string): ParamCheck {
55 return (record) => {
56 const value = record[key]
57 if (value !== undefined && typeof value !== "boolean") return paramsError(`$.${key}`, `${key} must be a boolean`)
58 return null
59 }
60}
61
62export function optionalFiniteNumber(key: string): ParamCheck {
63 return (record) => {

Callers 2

Calls 1

paramsErrorFunction · 0.70

Tested by

no test coverage detected