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

Function requiredString

projects/runtime-protocol/src/protocol.ts:423–427  ·  view source on GitHub ↗
(record: Record<string, unknown>, key: string)

Source from the content-addressed store, hash-verified

421}
422
423function requiredString(record: Record<string, unknown>, key: string): RuntimeValidationResult<string> {
424 const value = record[key]
425 if (typeof value !== "string" || value.length < 1) return paramsError(`$.${key}`, `${key} must be a non-empty string`)
426 return { ok: true, value }
427}
428
429export function validateRuntimeRequest(value: unknown): RuntimeValidationResult<RuntimeRequest> {
430 if (!isRecord(value)) return validationError("$", "Runtime request must be an object")

Callers 4

validateRuntimeRecordFunction · 0.70
validateRuntimeIdParamsFunction · 0.70

Calls 1

paramsErrorFunction · 0.70

Tested by

no test coverage detected