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

Function pageContextFilters

apps/api/src/agents/tools/helpers.ts:222–231  ·  view source on GitHub ↗
(
  pageContext: ChatAgentContext['pageContext'],
)

Source from the content-addressed store, hash-verified

220 * numbers that contradict the dashboard.
221 */
222export function pageContextFilters(
223 pageContext: ChatAgentContext['pageContext'],
224): IChartEventFilter[] {
225 const raw = pageContext?.filters?.eventFilters;
226 if (!Array.isArray(raw)) return [];
227 return raw.filter(
228 (f): f is IChartEventFilter =>
229 typeof (f as { name?: unknown })?.name === 'string',
230 );
231}
232
233/**
234 * Compute the immediately-preceding period given a (start, end) range.

Callers 1

base.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected