Migrate toClout
This commit is contained in:
@@ -2,4 +2,5 @@ import {MetricsClient} from '#/analytics/metrics/client'
|
||||
import {type Events} from '#/analytics/metrics/types'
|
||||
|
||||
export type {Events as Metrics} from '#/analytics/metrics/types'
|
||||
export * from '#/analytics/metrics/utils'
|
||||
export const metrics = new MetricsClient<Events>()
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
export function toClout(n: number | null | undefined): number | undefined {
|
||||
if (n == null) {
|
||||
return undefined
|
||||
} else {
|
||||
return Math.max(0, Math.round(Math.log(n)))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user