file-entry-cache
Advanced tools
Comparing version 10.0.2 to 10.0.3
@@ -34,3 +34,3 @@ // src/index.ts | ||
var FileEntryCache = class { | ||
_cache = new FlatCache(); | ||
_cache = new FlatCache({ useClone: false }); | ||
_useCheckSum = false; | ||
@@ -186,2 +186,3 @@ _currentWorkingDirectory; | ||
}; | ||
result.meta = this._cache.getKey(result.key) ?? {}; | ||
filePath = this.getAbsolutePath(filePath, { currentWorkingDirectory: options?.currentWorkingDirectory }); | ||
@@ -218,11 +219,15 @@ const useCheckSumValue = options?.useCheckSum ?? this._useCheckSum; | ||
} | ||
result.meta.data = metaCache.data; | ||
if (result.meta.data !== metaCache.data) { | ||
result.changed = true; | ||
} | ||
if (result.meta.data === void 0) { | ||
result.meta.data = metaCache.data; | ||
} | ||
if (metaCache?.mtime !== result.meta?.mtime || metaCache?.size !== result.meta?.size) { | ||
result.changed = true; | ||
this._cache.setKey(result.key, result.meta); | ||
} | ||
if (useCheckSumValue && metaCache?.hash !== result.meta?.hash) { | ||
result.changed = true; | ||
this._cache.setKey(result.key, result.meta); | ||
} | ||
this._cache.setKey(result.key, result.meta); | ||
return result; | ||
@@ -229,0 +234,0 @@ } |
{ | ||
"name": "file-entry-cache", | ||
"version": "10.0.2", | ||
"version": "10.0.3", | ||
"description": "A lightweight cache for file metadata, ideal for processes that work on a specific set of files and only need to reprocess files that have changed since the last run", | ||
@@ -32,8 +32,8 @@ "type": "module", | ||
"devDependencies": { | ||
"@types/node": "^22.9.0", | ||
"@vitest/coverage-v8": "^2.1.4", | ||
"@types/node": "^22.9.3", | ||
"@vitest/coverage-v8": "^2.1.5", | ||
"rimraf": "^6.0.1", | ||
"tsup": "^8.3.5", | ||
"typescript": "^5.6.3", | ||
"vitest": "^2.1.4", | ||
"typescript": "^5.7.2", | ||
"vitest": "^2.1.5", | ||
"xo": "^0.59.3" | ||
@@ -40,0 +40,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50168
896