3import { Context } from "npm:hono@3.8.1";
4
5export function styleSystem() {
6 function StyleTag() {
7 return (
8 <style
3import { Context } from "npm:hono@3.8.1";
4
5export function styleSystem() {
6 function StyleTag() {
7 return (
8 <style
3import { Context } from "npm:hono@3.8.1";
4
5export function getMaterials(c: Context | null) {
6 const ids = getMaterialIds(c);
7 return Object.values(materials).filter((mat) => ids.has(mat.id));
2import { Context } from "npm:hono@3.8.1";
3
4export function getMaterialIds(c: Context | null) {
5 if (!c) return new Set();
6 try {
2import { Recipe } from "https://esm.town/v/tmcw/Recipe";
3
4export function sort(recipes: Map<string, Recipe>, materials: Material[]) {
5 const have = new Set(materials.map((m) => m.name));
6
5
6/** Get a cookie from the request or optionally from inflight */
7export function getCookie(c: Context, key: string): string | undefined {
8 const inflight = getInflight(c);
9 if (inflight.has(key)) {
5
6/** Set a cookie and keep track of it inflight */
7export function setCookie(c: Context, key: string, value: string) {
8 const inflight = getInflight(c);
9 inflight.set(key, value);
2import { Context } from "npm:hono@3.8.1";
3
4export function getInflight(c: Context) {
5 return InflightCookies.get(c) || new Map();
6}
24
25// TODO: refactor
26export function formatFloat(a: number) {
27 const intPart = Math.floor(a);
28 const remainder = Math.floor((a - intPart) * 100);
17import { html } from "https://esm.town/v/stevekrouse/html?v=5";
18
19export async function examplePost(req: Request) {
20 const { author, name } = extractValInfo(import.meta.url);
21 return html(await article(author, name));
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.