ga4-export-fixer 0.2.1-dev.0 → 0.2.1-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ga4-export-fixer",
3
- "version": "0.2.1-dev.0",
3
+ "version": "0.2.1-dev.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -332,7 +332,14 @@ ${constants.TABLE_DESCRIPTION_SUFFIX}
332
332
  ${constants.TABLE_DESCRIPTION_DOCUMENTATION_LINK}
333
333
 
334
334
  The last full table refresh was done using this configuration:
335
- ${JSON.stringify(mergedConfig, null, 2)}`;
335
+ ${JSON.stringify(
336
+ Object.fromEntries(
337
+ // don't display the default arrays here, their contents are included in the main arrays via the mergeSQLConfigurations function
338
+ Object.entries(mergedConfig).filter(([key]) => !key.startsWith('default'))
339
+ ),
340
+ null,
341
+ 2
342
+ )}`;
336
343
 
337
344
  // the defaults for the dataform table config
338
345
  const defaultDataformTableConfig = {
package/utils.js CHANGED
@@ -123,16 +123,9 @@ const mergeSQLConfigurations = (defaultConfig, inputConfig = {}) => {
123
123
  continue;
124
124
  }
125
125
 
126
- // Handle arrays: merge with default counterpart if one exists, otherwise overwrite
126
+ // Handle arrays: overwrite with input value (default counterpart merging happens post-loop)
127
127
  if (Array.isArray(defaultValue) && Array.isArray(inputValue)) {
128
- // check if the array has a "default" counterpart
129
- // for example, excludedEvents and defaultExcludedEvents
130
- const defaultKey = 'default' + key.charAt(0).toUpperCase() + key.slice(1);
131
- if (!key.startsWith('default') && defaultKey in result) {
132
- result[key] = mergeUniqueArrays(inputValue, result[defaultKey]);
133
- } else {
134
- result[key] = inputValue;
135
- }
128
+ result[key] = inputValue;
136
129
  continue;
137
130
  }
138
131
 
@@ -153,6 +146,16 @@ const mergeSQLConfigurations = (defaultConfig, inputConfig = {}) => {
153
146
  result[key] = inputValue;
154
147
  }
155
148
 
149
+ // Merge arrays with their default counterparts (e.g. excludedEvents + defaultExcludedEvents)
150
+ // This runs regardless of whether the user provided the array in inputConfig
151
+ for (const key in result) {
152
+ if (!result.hasOwnProperty(key) || key.startsWith('default')) continue;
153
+ const defaultKey = 'default' + key.charAt(0).toUpperCase() + key.slice(1);
154
+ if (defaultKey in result && Array.isArray(result[key]) && Array.isArray(result[defaultKey])) {
155
+ result[key] = mergeUniqueArrays(result[key], result[defaultKey]);
156
+ }
157
+ }
158
+
156
159
  // process configuration date fields
157
160
  // BigQuery SQL statements are excepted
158
161
  // string dates such as '20260101' or '2026-01-01' are processed