From 4859dcee8750a80d402f52986c89f1311f3c8b82 Mon Sep 17 00:00:00 2001 From: prototypa Date: Tue, 30 Aug 2022 11:36:10 -0400 Subject: [PATCH] Rename getAllImages --- src/utils/{getAllImages.js => fetchLocalImages.js} | 2 +- src/utils/findImage.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/utils/{getAllImages.js => fetchLocalImages.js} (82%) 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"