@statsig/client-core 3.24.3 → 3.25.0-beta.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/package.json +1 -1
- package/src/ErrorBoundary.js +3 -1
- package/src/StableID.d.ts +1 -0
- package/src/StableID.js +6 -5
- package/src/StatsigMetadata.d.ts +1 -1
- package/src/StatsigMetadata.js +1 -1
package/package.json
CHANGED
package/src/ErrorBoundary.js
CHANGED
|
@@ -160,7 +160,9 @@ function _getStatsigOptionLoggingCopy(options) {
|
|
|
160
160
|
return {};
|
|
161
161
|
}
|
|
162
162
|
const loggingCopy = {};
|
|
163
|
-
Object.
|
|
163
|
+
Object.keys(options).forEach((key) => {
|
|
164
|
+
const option = key;
|
|
165
|
+
const value = options[option];
|
|
164
166
|
const valueType = typeof value;
|
|
165
167
|
switch (valueType) {
|
|
166
168
|
case 'number':
|
package/src/StableID.d.ts
CHANGED
package/src/StableID.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StableID = void 0;
|
|
3
|
+
exports.getCookieName = exports.StableID = void 0;
|
|
4
4
|
const CacheKey_1 = require("./CacheKey");
|
|
5
5
|
const Log_1 = require("./Log");
|
|
6
6
|
const SafeJs_1 = require("./SafeJs");
|
|
@@ -70,20 +70,21 @@ function _loadFromCookie(sdkKey) {
|
|
|
70
70
|
const cookies = document.cookie.split(';');
|
|
71
71
|
for (const cookie of cookies) {
|
|
72
72
|
const [key, value] = cookie.trim().split('=');
|
|
73
|
-
if (key ===
|
|
73
|
+
if (key === getCookieName(sdkKey)) {
|
|
74
74
|
return decodeURIComponent(value);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
return null;
|
|
78
78
|
}
|
|
79
79
|
function _persistToCookie(stableID, sdkKey) {
|
|
80
|
-
if (!COOKIE_ENABLED_MAP[sdkKey] ||
|
|
80
|
+
if (!COOKIE_ENABLED_MAP[sdkKey] || (0, SafeJs_1._getDocumentSafe)() == null) {
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
const expiryDate = new Date();
|
|
84
84
|
expiryDate.setFullYear(expiryDate.getFullYear() + 1);
|
|
85
|
-
document.cookie = `${
|
|
85
|
+
document.cookie = `${getCookieName(sdkKey)}=${encodeURIComponent(stableID)}; expires=${expiryDate.toUTCString()}; path=/`;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function getCookieName(sdkKey) {
|
|
88
88
|
return `statsig.stable_id.${(0, CacheKey_1._getStorageKey)(sdkKey)}`;
|
|
89
89
|
}
|
|
90
|
+
exports.getCookieName = getCookieName;
|
package/src/StatsigMetadata.d.ts
CHANGED
package/src/StatsigMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StatsigMetadataProvider = exports.SDK_VERSION = void 0;
|
|
4
|
-
exports.SDK_VERSION = '3.
|
|
4
|
+
exports.SDK_VERSION = '3.25.0-beta.1';
|
|
5
5
|
let metadata = {
|
|
6
6
|
sdkVersion: exports.SDK_VERSION,
|
|
7
7
|
sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients
|