Skip to content

Commit

Permalink
fix: property flattener should ignore heatmap data
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed May 1, 2024
1 parent 94d231f commit aa01b65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ async function processEvent(event, { config }) {
return event
}

const propertyDenyList = ['$elements', '$elements_chain', '$groups', '$active_feature_flags', '$heatmap_data']

const flattenProperties = (props, sep, nestedChain = []) => {
let newProps = {}
for (const [key, value] of Object.entries(props)) {
if (key === '$elements' || key === '$elements_chain' || key === '$groups' || key === '$active_feature_flags') {
if (propertyDenyList.includes(key)) {
// Hide 'internal' properties used in event processing
} else if (key === '$set') {
newProps = { ...newProps, $set: { ...props[key], ...flattenProperties(props[key], sep) } }
Expand Down

0 comments on commit aa01b65

Please sign in to comment.