Rename getAllImages

This commit is contained in:
prototypa
2022-08-30 11:36:10 -04:00
parent 19b4a25012
commit 4859dcee87
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ const load = async function () {
let _images;
export const getAllImages = async () => {
export const fetchLocalImages = async () => {
_images = _images || load();
return await _images;
};

View File

@ -1,4 +1,4 @@
import { getAllImages } from "~/utils/getAllImages";
import { fetchLocalImages } from "~/utils/fetchLocalImages";
export const findImage = async (imagePath) => {
if (typeof imagePath !== "string") {
@ -13,7 +13,7 @@ export const findImage = async (imagePath) => {
return null;
} // For now only consume images using ~/assets alias (or absolute)
const images = await getAllImages();
const images = await fetchLocalImages();
const key = imagePath.replace("~/", "/src/");
return typeof images[key] === "function"