Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2025-08-19 02:38:00 +02:00
padre 0a6a6b0887
commit 1554a21a1b
Se han modificado 2 ficheros con 94 adiciones y 67 borrados

Ver fichero

@@ -66,6 +66,28 @@ class CacheManager {
return data;
}
async has(packageName, version) {
const key = this.generateKey(packageName, version);
const metadata = await this.loadMetadata();
if (!metadata.entries[key]) {
return false;
}
const entry = metadata.entries[key];
const filePath = path.join(this.cacheDir, entry.file);
// Check if file exists
if (!fs.existsSync(filePath)) {
// Remove stale entry
delete metadata.entries[key];
await this.saveMetadata(metadata);
return false;
}
return true;
}
async store(packageName, version, data) {
const key = this.generateKey(packageName, version);
const metadata = await this.loadMetadata();