(
images: Map<number, { imageId: number; name: string }>,
imageFiles: Map<string, File>
)
| 131 | * Returns information about missing images and potential causes. |
| 132 | */ |
| 133 | export function findMissingImageFiles( |
| 134 | images: Map<number, { imageId: number; name: string }>, |
| 135 | imageFiles: Map<string, File> |
| 136 | ): { |
| 137 | missingImages: Array<{ imageId: number; name: string }>; |
| 138 | totalImages: number; |
| 139 | totalFiles: number; |
| 140 | } { |
| 141 | const missingImages: Array<{ imageId: number; name: string }> = []; |
| 142 | |
| 143 | for (const image of images.values()) { |
| 144 | const file = getImageFile(imageFiles, image.name); |
| 145 | if (!file) { |
| 146 | missingImages.push({ imageId: image.imageId, name: image.name }); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | return { |
| 151 | missingImages, |
| 152 | totalImages: images.size, |
| 153 | totalFiles: imageFiles.size, |
| 154 | }; |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Look up a mask file for an image. |
no test coverage detected