From aa01b65f8a6b5ad3a5f870110bb23252f57cfff0 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Wed, 1 May 2024 13:49:39 +0100 Subject: [PATCH] fix: property flattener should ignore heatmap data --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 7e901a2..6845db2 100644 --- a/index.js +++ b/index.js @@ -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) } }