@statsig/client-core 2.2.0-beta.1 → 2.2.0-beta.5
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
CHANGED
package/src/StatsigClientBase.js
CHANGED
|
@@ -28,6 +28,7 @@ class StatsigClientBase {
|
|
|
28
28
|
(options === null || options === void 0 ? void 0 : options.disableStorage) && StorageProvider_1.Storage._setDisabled(true);
|
|
29
29
|
(options === null || options === void 0 ? void 0 : options.initialSessionID) &&
|
|
30
30
|
SessionID_1.StatsigSession.overrideInitialSessionID(options.initialSessionID, sdkKey);
|
|
31
|
+
(options === null || options === void 0 ? void 0 : options.storageProvider) && StorageProvider_1.Storage._setProvider(options.storageProvider);
|
|
31
32
|
this._sdkKey = sdkKey;
|
|
32
33
|
this._options = options !== null && options !== void 0 ? options : {};
|
|
33
34
|
this.overrideAdapter = (_a = options === null || options === void 0 ? void 0 : options.overrideAdapter) !== null && _a !== void 0 ? _a : null;
|
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 = '2.2.0-beta.
|
|
4
|
+
exports.SDK_VERSION = '2.2.0-beta.5';
|
|
5
5
|
let metadata = {
|
|
6
6
|
sdkVersion: exports.SDK_VERSION,
|
|
7
7
|
sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients
|
package/src/StorageProvider.d.ts
CHANGED
package/src/StorageProvider.js
CHANGED
|
@@ -5,6 +5,7 @@ const Log_1 = require("./Log");
|
|
|
5
5
|
const SafeJs_1 = require("./SafeJs");
|
|
6
6
|
const inMemoryStore = {};
|
|
7
7
|
const _inMemoryProvider = {
|
|
8
|
+
_isProviderReady: () => null,
|
|
8
9
|
_getProviderName: () => 'InMemory',
|
|
9
10
|
_getItem: (key) => inMemoryStore[key] ? inMemoryStore[key] : null,
|
|
10
11
|
_setItem: (key, value) => {
|
|
@@ -22,6 +23,7 @@ try {
|
|
|
22
23
|
win.localStorage &&
|
|
23
24
|
typeof win.localStorage.getItem === 'function') {
|
|
24
25
|
_localStorageProvider = {
|
|
26
|
+
_isProviderReady: () => null,
|
|
25
27
|
_getProviderName: () => 'LocalStorage',
|
|
26
28
|
_getItem: (key) => win.localStorage.getItem(key),
|
|
27
29
|
_setItem: (key, value) => win.localStorage.setItem(key, value),
|
|
@@ -48,6 +50,7 @@ function _inMemoryBreaker(get) {
|
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
exports.Storage = {
|
|
53
|
+
_isProviderReady: () => { var _a; return (_a = _current._isProviderReady()) !== null && _a !== void 0 ? _a : null; },
|
|
51
54
|
_getProviderName: () => _current._getProviderName(),
|
|
52
55
|
_getItem: (key) => _inMemoryBreaker(() => _current._getItem(key)),
|
|
53
56
|
_setItem: (key, value) => _current._setItem(key, value),
|