MCPcopy Index your code
hub / github.com/callstack/agent-device / optionalBoolean

Function optionalBoolean

src/commands/command-input.ts:412–419  ·  view source on GitHub ↗
(record: Record<string, unknown>, key: string)

Source from the content-addressed store, hash-verified

410}
411
412function optionalBoolean(record: Record<string, unknown>, key: string): boolean | undefined {
413 const value = record[key];
414 if (value === undefined) return undefined;
415 if (typeof value !== 'boolean') {
416 throw new Error(`Expected ${key} to be a boolean.`);
417 }
418 return value;
419}
420
421export function requiredEnum<const T extends readonly string[]>(
422 record: Record<string, unknown>,

Callers 1

readCommonInputFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…