This commit is contained in:
2026-03-18 17:37:24 +01:00
parent f6db3ab866
commit eec0df83cd
79 changed files with 2333 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
import { readdirSync } from "fs";
import grabDirNames from "../../utils/grab-dir-names";
import trimCacheKey from "./trim-cache-key";
export default async function trimAllCache() {
try {
const { BUNEXT_CACHE_DIR } = grabDirNames();
const cached_items = readdirSync(BUNEXT_CACHE_DIR);
for (let i = 0; i < cached_items.length; i++) {
const cached_item = cached_items[i];
if (!cached_item.endsWith(`.meta.json`))
continue;
const cache_key = decodeURIComponent(cached_item.replace(/\.meta\.json/, ""));
const trim_key = await trimCacheKey({
key: cache_key,
});
}
}
catch (error) {
return undefined;
}
}