1
2
3
4
5
6
7
8
import { getMaterialIds } from "https://esm.town/v/tmcw/getMaterialIds";
import { materials } from "https://esm.town/v/tmcw/materials";
import { Context } from "npm:hono@3.8.1";
export function getMaterials(c: Context | null) {
const ids = getMaterialIds(c);
return Object.values(materials).filter((mat) => ids.has(mat.id));
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
v4
November 16, 2023