Files
Comfyui-LayerForge/js/ImageCache.js
Dariusz L 5adc77471f project migration to typescript
Project migration to typescript
2025-07-04 04:22:51 +02:00

24 lines
616 B
JavaScript

import { createModuleLogger } from "./utils/LoggerUtils.js";
const log = createModuleLogger('ImageCache');
export class ImageCache {
constructor() {
this.cache = new Map();
}
set(key, imageData) {
log.info("Caching image data for key:", key);
this.cache.set(key, imageData);
}
get(key) {
const data = this.cache.get(key);
log.debug("Retrieved cached data for key:", key, !!data);
return data;
}
has(key) {
return this.cache.has(key);
}
clear() {
log.info("Clearing image cache");
this.cache.clear();
}
}