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

Function optionalStringRecord

projects/runtime-node/src/pty.ts:74–79  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

72}
73
74function optionalStringRecord(value: unknown): Record<string, string> | undefined {
75 if (value === undefined) return undefined
76 const record = asRecord(value)
77 const entries = Object.entries(record).filter((entry): entry is [string, string] => typeof entry[1] === "string")
78 return Object.fromEntries(entries)
79}
80
81function optionalNumber(value: unknown): number | undefined {
82 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