MCPcopy Create free account
hub / github.com/apache/maka / requireBoundedString

Function requireBoundedString

packages/runtime-host/src/protocol/client-capability.ts:975–980  ·  view source on GitHub ↗
(value: unknown, label: string, maxLength: number)

Source from the content-addressed store, hash-verified

973}
974
975function requireBoundedString(value: unknown, label: string, maxLength: number): string {
976 if (typeof value !== 'string' || value.length > maxLength) {
977 throw invalidProtocolFrame(`Invalid ${label}`);
978 }
979 return value;
980}
981
982function requireCanonicalBase64(value: unknown, label: string, maxLength: number): string {
983 const data = requireBoundedString(value, label, maxLength);

Callers 2

decodeContentBlockFunction · 0.85
requireCanonicalBase64Function · 0.85

Calls 1

invalidProtocolFrameFunction · 0.85

Tested by

no test coverage detected