Skip to content

Commit

Permalink
refactor: add return type (#1869)
Browse files Browse the repository at this point in the history
* refactor: add return type

* Create early-shoes-listen.md
  • Loading branch information
tdeekens committed Mar 12, 2024
1 parent 35a43e4 commit 6ba8e74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-shoes-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@flopflip/launchdarkly-adapter": patch
---

refactor: add return type
6 changes: 3 additions & 3 deletions packages/launchdarkly-adapter/src/adapter/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function getCache(
};
}

function getCachedFlags(cacheIdentifier: TCacheIdentifiers) {
function getCachedFlags(cacheIdentifier: TCacheIdentifiers): TFlags {
const cacheModule =
cacheIdentifier === cacheIdentifiers.local ? localStorage : sessionStorage;

Expand All @@ -77,10 +77,10 @@ function getCachedFlags(cacheIdentifier: TCacheIdentifiers) {
if (cacheKey && cachedFlags) {
return JSON.parse(cachedFlags);
}

return {};
} catch (error) {}
}

return {};
}

export { CACHE_PREFIX, getCache, getCachedFlags };

0 comments on commit 6ba8e74

Please sign in to comment.