MCPcopy Create free account
hub / github.com/Devographics/Monorepo / computeFeatureUsage

Function computeFeatureUsage

api/src/compute/experience.ts:53–61  ·  view source on GitHub ↗
(buckets: ExperienceBucket[])

Source from the content-addressed store, hash-verified

51}
52
53const computeFeatureUsage = (buckets: ExperienceBucket[]) => {
54 const neverHeardCount = buckets.find(bucket => bucket.id === 'never_heard')?.count ?? 0
55 const knowAboutCount = buckets.find(bucket => bucket.id === 'heard')?.count ?? 0
56 const usageCount = buckets.find(bucket => bucket.id === 'used')?.count ?? 0
57
58 const total = usageCount + neverHeardCount + knowAboutCount
59
60 return ratioToPercentage(usageCount / total)
61}
62
63const computeInterest = (buckets: ExperienceBucket[]) => {
64 const interested = buckets.find(bucket => bucket.id === 'interested')

Callers 1

Calls 1

ratioToPercentageFunction · 0.90

Tested by

no test coverage detected