(properties: AnalyticsProperties)
| 39 | } |
| 40 | |
| 41 | function getPropertyUserId(properties: AnalyticsProperties): string | undefined { |
| 42 | const direct = |
| 43 | getStringProperty(properties, 'userId') ?? |
| 44 | getStringProperty(properties, 'user_id') ?? |
| 45 | getStringProperty(properties, 'distinct_id') |
| 46 | if (direct) { |
| 47 | return direct |
| 48 | } |
| 49 | |
| 50 | const user = properties?.user |
| 51 | if (user && typeof user === 'object') { |
| 52 | const id = (user as { id?: unknown }).id |
| 53 | return typeof id === 'string' && id.trim() ? id : undefined |
| 54 | } |
| 55 | |
| 56 | return undefined |
| 57 | } |
| 58 | |
| 59 | function splitEnvList(value: string | undefined): Set<string> { |
| 60 | return new Set( |
no test coverage detected