MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / asOneOf

Function asOneOf

graph-ui/src/agents/agent-preference.ts:82–84  ·  view source on GitHub ↗
(value: unknown, allowed: readonly T[], fallback: T)

Source from the content-addressed store, hash-verified

80}
81
82function asOneOf<T>(value: unknown, allowed: readonly T[], fallback: T): T {
83 return allowed.includes(value as T) ? (value as T) : fallback;
84}
85
86function asBoolean(value: unknown, fallback: boolean): boolean {
87 return typeof value === 'boolean' ? value : fallback;

Callers 1

clampAgentsPreferenceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected