@armco/analytics 0.0.6 → 0.0.8
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/dist/analytics.js +3 -2
- package/package.json +1 -1
package/dist/analytics.js
CHANGED
|
@@ -107,6 +107,7 @@ function getHostProjectName() {
|
|
|
107
107
|
if (!hostProjectName) {
|
|
108
108
|
const packageJson = yield import(packageJsonPath);
|
|
109
109
|
hostProjectName = packageJson.name || null;
|
|
110
|
+
enabled = isEnabled();
|
|
110
111
|
}
|
|
111
112
|
return hostProjectName;
|
|
112
113
|
});
|
|
@@ -125,7 +126,7 @@ function enrichEventData(data) {
|
|
|
125
126
|
user && (data.user = user);
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
+
function isMalformedEvent(data) {
|
|
129
130
|
return !data || !data.eventType;
|
|
130
131
|
}
|
|
131
132
|
export function sendBulkData(data, callback) {
|
|
@@ -198,7 +199,7 @@ function trackEvent(event, data) {
|
|
|
198
199
|
else {
|
|
199
200
|
data = event;
|
|
200
201
|
}
|
|
201
|
-
if (
|
|
202
|
+
if (isMalformedEvent(data)) {
|
|
202
203
|
console.error("Attempting to send empty event, or event missing eventType, failing send...");
|
|
203
204
|
return;
|
|
204
205
|
}
|