( values: Record<string, T | undefined> | undefined, name: string, )
| 30 | } |
| 31 | |
| 32 | export 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 | } |
no test coverage detected