@statsig/client-core 3.24.2 → 3.24.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statsig/client-core",
3
- "version": "3.24.2",
3
+ "version": "3.24.4",
4
4
  "license": "ISC",
5
5
  "homepage": "https://github.com/statsig-io/js-client-monorepo",
6
6
  "repository": {
package/src/StableID.d.ts CHANGED
@@ -6,3 +6,4 @@ export declare const StableID: {
6
6
  _setCookiesEnabled: (sdkKey: string, cookiesEnabled: boolean) => void;
7
7
  _setDisabled: (sdkKey: string, disabled: boolean) => void;
8
8
  };
9
+ export declare function getCookieName(sdkKey: string): string;
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 === _getCookieName(sdkKey)) {
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] || !document) {
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 = `${_getCookieName(sdkKey)}=${encodeURIComponent(stableID)}; expires=${expiryDate.toUTCString()}; path=/`;
85
+ document.cookie = `${getCookieName(sdkKey)}=${encodeURIComponent(stableID)}; expires=${expiryDate.toUTCString()}; path=/`;
86
86
  }
87
- function _getCookieName(sdkKey) {
87
+ function getCookieName(sdkKey) {
88
88
  return `statsig.stable_id.${(0, CacheKey_1._getStorageKey)(sdkKey)}`;
89
89
  }
90
+ exports.getCookieName = getCookieName;
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "3.24.2";
1
+ export declare const SDK_VERSION = "3.24.4";
2
2
  export type StatsigMetadata = {
3
3
  readonly [key: string]: string | undefined | null;
4
4
  readonly appVersion?: string;
@@ -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.24.2';
4
+ exports.SDK_VERSION = '3.24.4';
5
5
  let metadata = {
6
6
  sdkVersion: exports.SDK_VERSION,
7
7
  sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients