@statsig/client-core 0.0.1-beta.20 → 0.0.1-beta.22
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/$_StatsigGlobal.d.ts +2 -1
- package/src/$_StatsigGlobal.js +2 -0
- package/src/StatsigClientBase.js +2 -2
- package/src/StatsigMetadata.js +1 -1
- package/src/UUID.js +4 -0
package/package.json
CHANGED
package/src/$_StatsigGlobal.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { StatsigClientInterface } from "./ClientInterfaces";
|
|
1
2
|
export type StatsigGlobal = {
|
|
2
3
|
[key: string]: unknown;
|
|
3
|
-
instances?:
|
|
4
|
+
instances?: Record<string, StatsigClientInterface>;
|
|
4
5
|
};
|
|
5
6
|
declare global {
|
|
6
7
|
let __STATSIG__: StatsigGlobal | undefined;
|
package/src/$_StatsigGlobal.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
2
4
|
var _a, _b, _c;
|
|
3
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
6
|
const _window = typeof window !== 'undefined' ? window : {};
|
package/src/StatsigClientBase.js
CHANGED
|
@@ -21,8 +21,8 @@ class StatsigClientBase {
|
|
|
21
21
|
this._logger = new EventLogger_1.EventLogger(_sdkKey, this._emit.bind(this), network, options);
|
|
22
22
|
this._errorBoundary = new ErrorBoundary_1.ErrorBoundary(_sdkKey);
|
|
23
23
|
__STATSIG__ = __STATSIG__ !== null && __STATSIG__ !== void 0 ? __STATSIG__ : {};
|
|
24
|
-
const instances = (_c = __STATSIG__.instances) !== null && _c !== void 0 ? _c :
|
|
25
|
-
instances
|
|
24
|
+
const instances = (_c = __STATSIG__.instances) !== null && _c !== void 0 ? _c : {};
|
|
25
|
+
instances[_sdkKey] = this;
|
|
26
26
|
__STATSIG__.instances = instances;
|
|
27
27
|
this.dataAdapter = adapter;
|
|
28
28
|
this.dataAdapter.attach(_sdkKey, options);
|
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 = void 0;
|
|
4
|
-
const SDK_VERSION = '0.0.1-beta.
|
|
4
|
+
const SDK_VERSION = '0.0.1-beta.22';
|
|
5
5
|
let metadata = {
|
|
6
6
|
sdkVersion: SDK_VERSION,
|
|
7
7
|
sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients
|
package/src/UUID.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUUID = void 0;
|
|
4
4
|
function getUUID() {
|
|
5
|
+
if (typeof crypto !== 'undefined' &&
|
|
6
|
+
typeof crypto.randomUUID === 'function') {
|
|
7
|
+
return crypto.randomUUID();
|
|
8
|
+
}
|
|
5
9
|
let d = new Date().getTime();
|
|
6
10
|
let d2 = (typeof performance !== 'undefined' &&
|
|
7
11
|
performance.now &&
|