Skip to content

Commit

Permalink
Merge pull request #114 from ryoppippi/feature/refactor-
Browse files Browse the repository at this point in the history
feat(cache): cosmetic cache validation logic
  • Loading branch information
ryoppippi authored Jun 16, 2024
2 parents 34f3ccc + 0e8b5a3 commit 05645ce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/unplugin-typia/src/core/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ export async function getCache(

const hashComment = await getHashComment(key);

if (data.endsWith(hashComment)) {
return wrap<Data>(data);
/* if data does not end with hashComment, the cache is invalid */
if (!data.endsWith(hashComment)) {
return null;
}

return null;
return wrap<Data>(data);
}

/**
Expand Down

0 comments on commit 05645ce

Please sign in to comment.