MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / computeDirection

Function computeDirection

packages/db/src/services/insights/utils.ts:77–86  ·  view source on GitHub ↗
(
  changePct: number,
  threshold = 0.05,
)

Source from the content-addressed store, hash-verified

75 * Determine direction based on change percentage
76 */
77export function computeDirection(
78 changePct: number,
79 threshold = 0.05,
80): 'up' | 'down' | 'flat' {
81 return changePct > threshold
82 ? 'up'
83 : changePct < -threshold
84 ? 'down'
85 : 'flat';
86}
87
88/**
89 * Get end of day timestamp (23:59:59.999) for a given date.

Callers 5

computeManyFunction · 0.90
computeManyFunction · 0.90
computeManyFunction · 0.90
computeManyFunction · 0.90
computeManyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected