5 lines
242 B
TypeScript
5 lines
242 B
TypeScript
export function plsLoadImage(record: Record<string, () => Promise<{default: ImageMetadata}>>, path: string) {
|
|
const loadedImage = record[path]?.();
|
|
if (!loadedImage) throw new Error("Asset was not found:" + path);
|
|
return loadedImage;
|
|
}
|