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

Function assertAllowedKeys

packages/runtime-host/src/protocol/usage-pricing.ts:1121–1129  ·  view source on GitHub ↗
(
  record: Record<string, unknown>,
  allowed: ReadonlySet<string>,
  label: string,
)

Source from the content-addressed store, hash-verified

1119}
1120
1121function assertAllowedKeys(
1122 record: Record<string, unknown>,
1123 allowed: ReadonlySet<string>,
1124 label: string,
1125): void {
1126 if (Object.keys(record).some((field) => !allowed.has(field))) {
1127 throw invalidProtocolFrame(`Unknown ${label} field`);
1128 }
1129}
1130
1131function assertOptionalExactKeys(
1132 record: Record<string, unknown>,

Callers 7

decodeLlmUsageQueryFunction · 0.70
decodeToolUsageQueryFunction · 0.70
decodeUsageBucketFunction · 0.70
decodeLlmUsageLogFunction · 0.70
decodeToolUsageLogFunction · 0.70
decodeToolResultSummaryFunction · 0.70
assertOptionalExactKeysFunction · 0.70

Calls 3

invalidProtocolFrameFunction · 0.85
keysMethod · 0.80
hasMethod · 0.65

Tested by

no test coverage detected