securityos/node_modules/next/dist/esm/server/load-manifest.js

18 lines
481 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
import { readFileSync } from "fs";
const cache = new Map();
export function loadManifest(path, shouldCache = true) {
const cached = shouldCache && cache.get(path);
if (cached) {
return cached;
}
const manifest = JSON.parse(readFileSync(path, "utf8"));
if (shouldCache) {
cache.set(path, manifest);
}
return manifest;
}
export function clearManifestCache(path) {
return cache.delete(path);
}
//# sourceMappingURL=load-manifest.js.map