MCPcopy
hub / github.com/callstack/agent-device / readOptional

Function readOptional

src/utils/parsing.ts:18–24  ·  view source on GitHub ↗
(
  record: Record<string, unknown>,
  key: string,
  parse: (value: unknown) => T | undefined,
)

Source from the content-addressed store, hash-verified

16}
17
18function readOptional<T>(
19 record: Record<string, unknown>,
20 key: string,
21 parse: (value: unknown) => T | undefined,
22): T | undefined {
23 return parse(record[key]);
24}
25
26function readNullable<T>(
27 record: Record<string, unknown>,

Callers 2

readOptionalStringFunction · 0.85
readDeviceTargetFunction · 0.85

Calls 1

parseFunction · 0.70

Tested by

no test coverage detected