ga4-export-fixer 0.1.6-dev.6 → 0.1.6-dev.7

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.
Files changed (2) hide show
  1. package/helpers.js +8 -2
  2. package/package.json +1 -1
package/helpers.js CHANGED
@@ -563,8 +563,14 @@ Aggregation
563
563
  * // => SQL expression for the last user_id by event_timestamp.
564
564
  */
565
565
  const aggregateValue = (column, aggregateType, timestampColumn) => {
566
- if (typeof column === 'undefined' || typeof timestampColumn === 'undefined') {
567
- throw new Error("aggregateValue: 'column' and 'timestampColumn' are required parameters and must be defined.");
566
+ if (typeof column === 'undefined') {
567
+ throw new Error("aggregateValue: 'column' is a required parameter and must be defined.");
568
+ }
569
+ if (typeof aggregateType === 'undefined') {
570
+ throw new Error("aggregateValue: 'aggregateType' is a required parameter and must be defined.");
571
+ }
572
+ if ((aggregateType === 'first' || aggregateType === 'last') && typeof timestampColumn === 'undefined') {
573
+ throw new Error(`aggregateValue: 'timestampColumn' is required when aggregateType is '${aggregateType}'.`);
568
574
  }
569
575
 
570
576
  if (aggregateType === 'max') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ga4-export-fixer",
3
- "version": "0.1.6-dev.6",
3
+ "version": "0.1.6-dev.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [