I was able to get my page to work by type checking my items array.
export function getCollection(name) {
let collection;
if(name === "all"){
collection = getAllProducts();
} else {
collection = collections[name];
}
const type = typeof collection.items[0];
if (type === "string") {
const items = collection.items;
const map = items.map((x) => getImage(x));
collection.items = map;
}
return collection;
The page works but I'm still baffled by this.