Skip to content

Commit

Permalink
fix(core): fix value.lifeSpan is undefined (#129)
Browse files Browse the repository at this point in the history
Co-authored-by: Burak Tasci <burak.tasci@deliveryhero.com>
  • Loading branch information
joejordanbrown and fulls1z3 authored Mar 10, 2020
1 parent 6c6cc04 commit c7fb378
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@ngx-cache/core/src/cache.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class CacheService {
const normalized = CacheService.normalizeKey(key);
const cached = this.cache.getItem(normalized);

if (cached) {
if (Object.entries(cached).length !== 0 && cached.constructor === Object) {
if (CacheService.validateValue(cached)) {
return cached.data;
} else {
Expand All @@ -81,7 +81,7 @@ export class CacheService {
const normalized = CacheService.normalizeKey(key);
const cached = this.cache.getItem(normalized);

if (cached) {
if (Object.entries(cached).length !== 0 && cached.constructor === Object) {
if (CacheService.validateValue(cached)) {
return cached;
} else {
Expand Down

0 comments on commit c7fb378

Please sign in to comment.