MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / optionalStringRecord

Function optionalStringRecord

projects/runtime-node/src/process.ts:66–71  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

64}
65
66function optionalStringRecord(value: unknown): Record<string, string> | undefined {
67 if (value === undefined) return undefined
68 const record = asRecord(value)
69 const entries = Object.entries(record).filter((entry): entry is [string, string] => typeof entry[1] === "string")
70 return Object.fromEntries(entries)
71}
72
73function optionalNumber(value: unknown): number | undefined {
74 return typeof value === "number" && Number.isFinite(value) ? value : undefined

Callers

nothing calls this directly

Calls 2

entriesMethod · 0.80
asRecordFunction · 0.70

Tested by

no test coverage detected