diff --git a/packages/unplugin-typia/src/core/cache.ts b/packages/unplugin-typia/src/core/cache.ts index e55df0be..3d92be3b 100644 --- a/packages/unplugin-typia/src/core/cache.ts +++ b/packages/unplugin-typia/src/core/cache.ts @@ -51,11 +51,12 @@ export async function getCache( const hashComment = await getHashComment(key); - if (data.endsWith(hashComment)) { - return wrap(data); + /* if data does not end with hashComment, the cache is invalid */ + if (!data.endsWith(hashComment)) { + return null; } - return null; + return wrap(data); } /**