Function
picsumFallback
(seed: string, width = 140, height = 140)
Source from the content-addressed store, hash-verified
| 30 | } |
| 31 | |
| 32 | function picsumFallback(seed: string, width = 140, height = 140): string { |
| 33 | const safe = seed.replace(/[^a-z0-9_-]/gi, "-").slice(0, 40) || "cat"; |
| 34 | return `https://picsum.photos/seed/${encodeURIComponent(safe)}/${width}/${height}`; |
| 35 | } |
| 36 | |
| 37 | function fixBrokenImages(root: HTMLElement): void { |
| 38 | root.querySelectorAll<HTMLImageElement>("img").forEach((img) => { |
Tested by
no test coverage detected