@blotoutio/providers-google-analytics-4-sdk 1.22.3 → 1.23.0
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/index.cjs.js +22 -23
- package/index.js +22 -23
- package/index.mjs +22 -23
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -55,28 +55,27 @@ const upsert = (map, key, update, createDefault) => {
|
|
|
55
55
|
return map.set(key, update(currentValue));
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
Object.
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
flattened[objKey] = value;
|
|
58
|
+
const isPrimitive = (value) => value === null ||
|
|
59
|
+
typeof value === 'boolean' ||
|
|
60
|
+
Number.isFinite(value) ||
|
|
61
|
+
typeof value === 'string';
|
|
62
|
+
const isIterable = (value) => !!value && typeof value == 'object';
|
|
63
|
+
const flattenObject = (obj, { prefix = '', keyFormatter = (key) => key, delimiter = '_', } = {}) => {
|
|
64
|
+
const result = {};
|
|
65
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
66
|
+
const keyLabel = prefix + keyFormatter(key);
|
|
67
|
+
if (isPrimitive(value)) {
|
|
68
|
+
result[keyLabel] = value;
|
|
69
|
+
}
|
|
70
|
+
else if (isIterable(value)) {
|
|
71
|
+
Object.assign(result, flattenObject(value, {
|
|
72
|
+
prefix: keyLabel + delimiter,
|
|
73
|
+
keyFormatter,
|
|
74
|
+
delimiter,
|
|
75
|
+
}));
|
|
77
76
|
}
|
|
78
|
-
}
|
|
79
|
-
return
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
80
79
|
};
|
|
81
80
|
|
|
82
81
|
const expand = (str) => str.split(',').flatMap((entry) => {
|
|
@@ -708,7 +707,7 @@ const handleTag = ({ data = {}, eventName, eventId, manifestVariables, }) => {
|
|
|
708
707
|
if (manifestVariables['debug'] === '1') {
|
|
709
708
|
eventData['debug_mode'] = true;
|
|
710
709
|
}
|
|
711
|
-
const rawData = structuredClone(data);
|
|
710
|
+
const rawData = structuredClone(data !== null && data !== void 0 ? data : {});
|
|
712
711
|
if ('items' in eventData) {
|
|
713
712
|
delete rawData['contents'];
|
|
714
713
|
}
|
|
@@ -774,7 +773,7 @@ const tag = ({ data, eventName, manifestVariables, eventId }) => {
|
|
|
774
773
|
}
|
|
775
774
|
return {
|
|
776
775
|
loaded: isLoaded,
|
|
777
|
-
sdkVersion: "1.
|
|
776
|
+
sdkVersion: "1.23.0" ,
|
|
778
777
|
};
|
|
779
778
|
};
|
|
780
779
|
|
package/index.js
CHANGED
|
@@ -56,28 +56,27 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
56
56
|
return map.set(key, update(currentValue));
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
Object.
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
flattened[objKey] = value;
|
|
59
|
+
const isPrimitive = (value) => value === null ||
|
|
60
|
+
typeof value === 'boolean' ||
|
|
61
|
+
Number.isFinite(value) ||
|
|
62
|
+
typeof value === 'string';
|
|
63
|
+
const isIterable = (value) => !!value && typeof value == 'object';
|
|
64
|
+
const flattenObject = (obj, { prefix = '', keyFormatter = (key) => key, delimiter = '_', } = {}) => {
|
|
65
|
+
const result = {};
|
|
66
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
67
|
+
const keyLabel = prefix + keyFormatter(key);
|
|
68
|
+
if (isPrimitive(value)) {
|
|
69
|
+
result[keyLabel] = value;
|
|
70
|
+
}
|
|
71
|
+
else if (isIterable(value)) {
|
|
72
|
+
Object.assign(result, flattenObject(value, {
|
|
73
|
+
prefix: keyLabel + delimiter,
|
|
74
|
+
keyFormatter,
|
|
75
|
+
delimiter,
|
|
76
|
+
}));
|
|
78
77
|
}
|
|
79
|
-
}
|
|
80
|
-
return
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
81
80
|
};
|
|
82
81
|
|
|
83
82
|
const expand = (str) => str.split(',').flatMap((entry) => {
|
|
@@ -709,7 +708,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
709
708
|
if (manifestVariables['debug'] === '1') {
|
|
710
709
|
eventData['debug_mode'] = true;
|
|
711
710
|
}
|
|
712
|
-
const rawData = structuredClone(data);
|
|
711
|
+
const rawData = structuredClone(data !== null && data !== void 0 ? data : {});
|
|
713
712
|
if ('items' in eventData) {
|
|
714
713
|
delete rawData['contents'];
|
|
715
714
|
}
|
|
@@ -775,7 +774,7 @@ var ProvidersGoogleAnalytics4Sdk = (function () {
|
|
|
775
774
|
}
|
|
776
775
|
return {
|
|
777
776
|
loaded: isLoaded,
|
|
778
|
-
sdkVersion: "1.
|
|
777
|
+
sdkVersion: "1.23.0" ,
|
|
779
778
|
};
|
|
780
779
|
};
|
|
781
780
|
|
package/index.mjs
CHANGED
|
@@ -53,28 +53,27 @@ const upsert = (map, key, update, createDefault) => {
|
|
|
53
53
|
return map.set(key, update(currentValue));
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
Object.
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
flattened[objKey] = value;
|
|
56
|
+
const isPrimitive = (value) => value === null ||
|
|
57
|
+
typeof value === 'boolean' ||
|
|
58
|
+
Number.isFinite(value) ||
|
|
59
|
+
typeof value === 'string';
|
|
60
|
+
const isIterable = (value) => !!value && typeof value == 'object';
|
|
61
|
+
const flattenObject = (obj, { prefix = '', keyFormatter = (key) => key, delimiter = '_', } = {}) => {
|
|
62
|
+
const result = {};
|
|
63
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
64
|
+
const keyLabel = prefix + keyFormatter(key);
|
|
65
|
+
if (isPrimitive(value)) {
|
|
66
|
+
result[keyLabel] = value;
|
|
67
|
+
}
|
|
68
|
+
else if (isIterable(value)) {
|
|
69
|
+
Object.assign(result, flattenObject(value, {
|
|
70
|
+
prefix: keyLabel + delimiter,
|
|
71
|
+
keyFormatter,
|
|
72
|
+
delimiter,
|
|
73
|
+
}));
|
|
75
74
|
}
|
|
76
|
-
}
|
|
77
|
-
return
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
78
77
|
};
|
|
79
78
|
|
|
80
79
|
const expand = (str) => str.split(',').flatMap((entry) => {
|
|
@@ -706,7 +705,7 @@ const handleTag = ({ data = {}, eventName, eventId, manifestVariables, }) => {
|
|
|
706
705
|
if (manifestVariables['debug'] === '1') {
|
|
707
706
|
eventData['debug_mode'] = true;
|
|
708
707
|
}
|
|
709
|
-
const rawData = structuredClone(data);
|
|
708
|
+
const rawData = structuredClone(data !== null && data !== void 0 ? data : {});
|
|
710
709
|
if ('items' in eventData) {
|
|
711
710
|
delete rawData['contents'];
|
|
712
711
|
}
|
|
@@ -772,7 +771,7 @@ const tag = ({ data, eventName, manifestVariables, eventId }) => {
|
|
|
772
771
|
}
|
|
773
772
|
return {
|
|
774
773
|
loaded: isLoaded,
|
|
775
|
-
sdkVersion: "1.
|
|
774
|
+
sdkVersion: "1.23.0" ,
|
|
776
775
|
};
|
|
777
776
|
};
|
|
778
777
|
|