1import { h as h2 } from "https://esm.town/v/tmcw/h";
2
3export function h(tagName: string, attrsPlus?: any, ...children: any[]) {
4 if (!attrsPlus) attrsPlus = {};
5 if (attrsPlus.isEl || typeof attrsPlus === "string")
28 .join("");
29 const attrsToEmit = Object.entries(attrsPlus).reduce((acc: any, [k, v]) => {
30 if (k.startsWith("on") && typeof v === "function") return acc; // Skip events
31 if (v === null || v === undefined) return acc; // Skip null/undefined
32 if (typeof v === "function") v = v(); // Allow dynamic stuff (continue to rest of function)
33 if (k === "innerHTML") innerHtml = String(v);
34 else if (k === "innerText") innerHtml = text2Html(String(v));
1import { jsJamMessages } from "https://esm.town/v/stevekrouse/jsJamMessages";
2
3export function jsJamHTML(req, res) {
4 res.send(`<h1>${JSON.stringify(jsJamMessages)}</h1>`);
5}
1export function question() {
2 return "hello";
3}
28
29 console.log(
30 `average e2e user function time: ${(
31 userFuncTimes.reduce((a, b) => a + b, 0) / count
32 ).toFixed(0)}ms (fastest was ${userFuncTimes
1export function double(x: number) {
2 return 2 * x;
3}
21`;
22 const formClass = "p-2 group min-h-screen animate-all bg-pink-50";
23 function parseCookies(cookie: string) {
24 const out: Record<string, string> = {};
25 const c = cookie.split(";");
31 return out;
32 }
33 function getResults(hasVoted: boolean) {
34 return html`<html>
35 ${head}
1import { twitterAPIDown } from "https://esm.town/v/stevekrouse/twitterAPIDown";
2
3export async function twitterAPIDownAlert() {
4 if (twitterAPIDown.down)
5 console.email(
3import { hnLatestPosts } from "https://esm.town/v/stevekrouse/hnLatestPosts";
4
5export async function hnFollowPollJobError({ lastRunAt }: Interval) {
6 try {
7 let posts = await hnLatestPosts({
1import { newRSSItems } from "https://esm.town/v/stevekrouse/newRSSItems?v=6";
2
3export async function pollRSSFeeds() {
4 return Object.entries({
5 mine: "https://macwright.com/rss.xml",
3import { verifyAPIAuth } from "https://esm.town/v/stevekrouse/verifyAPIAuth";
4
5export async function exampleAuthApi(arg1, arg2, auth) {
6 let { handle } = await verifyAPIAuth(auth);
7 if (handle) {