diff --git a/src/utils/getAllImages.js b/src/utils/fetchLocalImages.js similarity index 82% rename from src/utils/getAllImages.js rename to src/utils/fetchLocalImages.js index f93be65..850f676 100644 --- a/src/utils/getAllImages.js +++ b/src/utils/fetchLocalImages.js @@ -8,7 +8,7 @@ const load = async function () { let _images; -export const getAllImages = async () => { +export const fetchLocalImages = async () => { _images = _images || load(); return await _images; }; diff --git a/src/utils/findImage.js b/src/utils/findImage.js index 73fa47e..fe48151 100644 --- a/src/utils/findImage.js +++ b/src/utils/findImage.js @@ -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"