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

Function normalizeEventField

packages/db/src/services/chart.service.ts:87–95  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

85// returned unchanged; callers must guard with `isKnownEventField` before
86// inlining into SQL.
87export function normalizeEventField(name: string): string {
88 if (EVENT_FIELD_ALIASES[name]) {
89 return EVENT_FIELD_ALIASES[name]!;
90 }
91 if (EVENT_UTM_BARE_COLUMNS.has(name)) {
92 return `properties.__query.${name}`;
93 }
94 return name;
95}
96
97// Returns true if `name` resolves to something we can inline into SQL safely:
98// a known top-level events column, a properties / profile / group path, a

Callers 5

chart.tsFile · 0.90
isKnownEventFieldFunction · 0.85
getSelectPropertyKeyFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected