MCPcopy Index your code
hub / github.com/massCodeIO/massCode / readNullableString

Function readNullableString

src/main/store/sanitize.ts:19–31  ·  view source on GitHub ↗
(
  source: Record<string, unknown>,
  key: string,
  fallback: string | null,
)

Source from the content-addressed store, hash-verified

17}
18
19export function readNullableString(
20 source: Record<string, unknown>,
21 key: string,
22 fallback: string | null,
23): string | null {
24 const value = source[key]
25
26 if (typeof value === 'string' || value === null) {
27 return value
28 }
29
30 return fallback
31}
32
33export function readNumber(
34 source: Record<string, unknown>,

Callers 2

sanitizePreferencesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected