MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getPropertyUserId

Function getPropertyUserId

common/src/util/analytics-sampling.ts:41–57  ·  view source on GitHub ↗
(properties: AnalyticsProperties)

Source from the content-addressed store, hash-verified

39}
40
41function 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
59function splitEnvList(value: string | undefined): Set<string> {
60 return new Set(

Callers 2

isFullTelemetryEnabledFunction · 0.85
getSamplingKeyFunction · 0.85

Calls 1

getStringPropertyFunction · 0.85

Tested by

no test coverage detected