Moved nice tools from fgo-ta over

This commit is contained in:
Firq 2024-01-05 01:12:19 +01:00
parent e406bd8764
commit 7ed78bceff
Signed by: Firq
GPG key ID: 3ACC61C8CEC83C20
10 changed files with 72 additions and 41 deletions
src/utils

5
src/utils/tools.ts Normal file
View file

@ -0,0 +1,5 @@
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;
}