mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-21 20:52:12 -03:00
This commit applies consistent code formatting across multiple files, including spacing, indentation, and object destructuring. No functional changes were made; the update improves code readability and maintainability.
30 lines
620 B
JavaScript
30 lines
620 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();
|
|
}
|
|
}
|