MCPcopy Create free account
hub / github.com/Noumena-Network/code / getLegacyCompatibleValue

Function getLegacyCompatibleValue

src/services/analytics/names.ts:32–44  ·  view source on GitHub ↗
(
  values: Record<string, T | undefined> | undefined,
  name: string,
)

Source from the content-addressed store, hash-verified

30}
31
32export function getLegacyCompatibleValue<T>(
33 values: Record<string, T | undefined> | undefined,
34 name: string,
35): T | undefined {
36 if (!values) return undefined
37 for (const candidate of getLegacyCompatibleAnalyticsNames(name)) {
38 const value = values[candidate]
39 if (value !== undefined) {
40 return value
41 }
42 }
43 return undefined
44}

Calls 1

Tested by

no test coverage detected