@bananalytics/react-native 0.1.0 → 0.1.1
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/context/session.js
CHANGED
|
@@ -67,12 +67,13 @@ class SessionManager {
|
|
|
67
67
|
}
|
|
68
68
|
/** Ends the current session. */
|
|
69
69
|
endSession() {
|
|
70
|
-
if (this.session)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
if (!this.session)
|
|
71
|
+
return;
|
|
72
|
+
const ended = this.session;
|
|
73
|
+
this.session = null;
|
|
74
|
+
this.logger.debug('Session ended', ended.id);
|
|
75
|
+
if (this.onSessionEnd) {
|
|
76
|
+
this.onSessionEnd(ended);
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
startNewSession(timestamp) {
|
package/dist/utils/validation.js
CHANGED
|
@@ -51,7 +51,11 @@ function validateProperties(properties) {
|
|
|
51
51
|
if (key.length > MAX_PROPERTY_KEY_LENGTH) {
|
|
52
52
|
return `property key "${key}" exceeds ${MAX_PROPERTY_KEY_LENGTH} character limit`;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
54
|
+
const value = properties[key];
|
|
55
|
+
if (value === undefined || value === null) {
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const serialized = JSON.stringify(value);
|
|
55
59
|
if (serialized.length > MAX_PROPERTY_VALUE_SIZE) {
|
|
56
60
|
return `property value for key "${key}" exceeds ${MAX_PROPERTY_VALUE_SIZE} byte limit: got ${serialized.length}`;
|
|
57
61
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bananalytics/react-native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Self-hosted, privacy-first analytics SDK for React Native and Expo apps. Funnels, retention, sessions, geography — your server, your data.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|