@flopflip/launchdarkly-adapter 13.3.2 → 13.3.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.
@@ -6,5 +6,5 @@ declare function getCache(cacheIdentifier: TCacheIdentifiers, cacheKey: LDContex
6
6
  get(): any;
7
7
  unset(): any;
8
8
  }>;
9
- declare function getCachedFlags(cacheIdentifier: TCacheIdentifiers): any;
9
+ declare function getCachedFlags(cacheIdentifier: TCacheIdentifiers): TFlags;
10
10
  export { CACHE_PREFIX, getCache, getCachedFlags };
@@ -88,7 +88,8 @@ async function getCache(cacheIdentifier, cacheKey) {
88
88
  }
89
89
  function getCachedFlags(cacheIdentifier) {
90
90
  const cacheModule = cacheIdentifier === types.cacheIdentifiers.local ? localStorage : sessionStorage;
91
- const referenceToCachedFlags = cacheModule.getItem(FLAGS_REFERENCE_KEY);
91
+ const flagReferenceKey = [CACHE_PREFIX, FLAGS_REFERENCE_KEY].join('/');
92
+ const referenceToCachedFlags = cacheModule.getItem(flagReferenceKey);
92
93
  if (referenceToCachedFlags) {
93
94
  try {
94
95
  const cacheKey = JSON.parse(referenceToCachedFlags);
@@ -96,9 +97,9 @@ function getCachedFlags(cacheIdentifier) {
96
97
  if (cacheKey && cachedFlags) {
97
98
  return JSON.parse(cachedFlags);
98
99
  }
99
- return {};
100
100
  } catch (error) {}
101
101
  }
102
+ return {};
102
103
  }
103
104
 
104
105
  var _adapterState = /*#__PURE__*/_classPrivateFieldLooseKey("adapterState");
@@ -418,7 +419,7 @@ class LaunchDarklyAdapter {
418
419
  const adapter = new LaunchDarklyAdapter();
419
420
  adapterUtilities.exposeGlobally(adapter);
420
421
 
421
- const version = "13.3.2";
422
+ const version = "13.3.4";
422
423
 
423
424
  exports["default"] = adapter;
424
425
  exports.getCachedFlags = getCachedFlags;
@@ -88,7 +88,8 @@ async function getCache(cacheIdentifier, cacheKey) {
88
88
  }
89
89
  function getCachedFlags(cacheIdentifier) {
90
90
  const cacheModule = cacheIdentifier === types.cacheIdentifiers.local ? localStorage : sessionStorage;
91
- const referenceToCachedFlags = cacheModule.getItem(FLAGS_REFERENCE_KEY);
91
+ const flagReferenceKey = [CACHE_PREFIX, FLAGS_REFERENCE_KEY].join('/');
92
+ const referenceToCachedFlags = cacheModule.getItem(flagReferenceKey);
92
93
  if (referenceToCachedFlags) {
93
94
  try {
94
95
  const cacheKey = JSON.parse(referenceToCachedFlags);
@@ -96,9 +97,9 @@ function getCachedFlags(cacheIdentifier) {
96
97
  if (cacheKey && cachedFlags) {
97
98
  return JSON.parse(cachedFlags);
98
99
  }
99
- return {};
100
100
  } catch (error) {}
101
101
  }
102
+ return {};
102
103
  }
103
104
 
104
105
  var _adapterState = /*#__PURE__*/_classPrivateFieldLooseKey("adapterState");
@@ -418,7 +419,7 @@ class LaunchDarklyAdapter {
418
419
  const adapter = new LaunchDarklyAdapter();
419
420
  adapterUtilities.exposeGlobally(adapter);
420
421
 
421
- const version = "13.3.2";
422
+ const version = "13.3.4";
422
423
 
423
424
  exports["default"] = adapter;
424
425
  exports.getCachedFlags = getCachedFlags;
@@ -59,7 +59,8 @@ async function getCache(cacheIdentifier, cacheKey) {
59
59
  }
60
60
  function getCachedFlags(cacheIdentifier) {
61
61
  const cacheModule = cacheIdentifier === cacheIdentifiers.local ? localStorage : sessionStorage;
62
- const referenceToCachedFlags = cacheModule.getItem(FLAGS_REFERENCE_KEY);
62
+ const flagReferenceKey = [CACHE_PREFIX, FLAGS_REFERENCE_KEY].join('/');
63
+ const referenceToCachedFlags = cacheModule.getItem(flagReferenceKey);
63
64
  if (referenceToCachedFlags) {
64
65
  try {
65
66
  const cacheKey = JSON.parse(referenceToCachedFlags);
@@ -67,9 +68,9 @@ function getCachedFlags(cacheIdentifier) {
67
68
  if (cacheKey && cachedFlags) {
68
69
  return JSON.parse(cachedFlags);
69
70
  }
70
- return {};
71
71
  } catch (error) {}
72
72
  }
73
+ return {};
73
74
  }
74
75
 
75
76
  var _adapterState = /*#__PURE__*/_classPrivateFieldLooseKey("adapterState");
@@ -389,6 +390,6 @@ class LaunchDarklyAdapter {
389
390
  const adapter = new LaunchDarklyAdapter();
390
391
  exposeGlobally(adapter);
391
392
 
392
- const version = "13.3.2";
393
+ const version = "13.3.4";
393
394
 
394
395
  export { adapter as default, getCachedFlags, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flopflip/launchdarkly-adapter",
3
- "version": "13.3.2",
3
+ "version": "13.3.4",
4
4
  "description": "A adapter around the LaunchDarkly client for flipflop",
5
5
  "main": "dist/flopflip-launchdarkly-adapter.cjs.js",
6
6
  "module": "dist/flopflip-launchdarkly-adapter.esm.js",
@@ -27,10 +27,10 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@babel/runtime": "7.24.0",
30
- "@flopflip/adapter-utilities": "13.3.2",
31
- "@flopflip/localstorage-cache": "13.3.2",
32
- "@flopflip/sessionstorage-cache": "13.3.2",
33
- "@flopflip/types": "13.3.2",
30
+ "@flopflip/adapter-utilities": "13.3.4",
31
+ "@flopflip/localstorage-cache": "13.3.4",
32
+ "@flopflip/sessionstorage-cache": "13.3.4",
33
+ "@flopflip/types": "13.3.4",
34
34
  "debounce-fn": "4.0.0",
35
35
  "launchdarkly-js-client-sdk": "3.1.4",
36
36
  "lodash": "4.17.21",