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

Function readOptionalNumberArray

src/main/store/sanitize.ts:56–70  ·  view source on GitHub ↗
(
  source: Record<string, unknown>,
  key: string,
)

Source from the content-addressed store, hash-verified

54}
55
56export function readOptionalNumberArray(
57 source: Record<string, unknown>,
58 key: string,
59): number[] | undefined {
60 const value = source[key]
61
62 if (
63 !Array.isArray(value)
64 || value.some(item => typeof item !== 'number' || !Number.isFinite(item))
65 ) {
66 return undefined
67 }
68
69 return [...value]
70}
71
72export function readEnum<T extends string>(
73 source: Record<string, unknown>,

Callers 2

sanitizeDonationsFunction · 0.90
sanitizeAppStoreFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected