INNER CODE UNIT · TypeScript

img

ParthJadhav/app-store-screenshots · skills/app-store-screenshots/template/src/lib/image-cache.ts:44

export function img(path: string | undefined): string {
  if (!path) return "";
  if (path.startsWith("data:")) return path;
  if (failed.has(path)) return "";
  return cache.get(path) || path;
}

export function setImage(path: string, dataUrl: string) {
  cache.set(path, dataUrl);
  failed.delete(path);
}

export function didFail(path: string | undefined): boolean {
  if (!path) return false;
  if (path.startsWith("data:")) return false;
  return failed.has(path);
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…