2import { dynamicImport } from "https://esm.town/v/easrng/dynamicImport";
3
4export async function getCaller() {
5 if (arguments[0])
6 return;
13 );
14 const realGetStore = AsyncLocalStorage.prototype.getStore;
15 AsyncLocalStorage.prototype.getStore = function (...a) {
16 asyncLocalStorage = this;
17 return realGetStore.call(this, ...a);
26 //
27 // i tried caching the asyncLocalStorage,
28 // but it seemingly gets replaced with null at the end of the function call
29 (getCaller2 as any)(true);
30 AsyncLocalStorage.prototype.getStore = realGetStore;
2
3// Listen to webhooks from PaperMC
4export async function paperMCListener(request) {
5 await handlePaperMCEvent(request);
6}
1import { valTownInspirationEmail } from "https://esm.town/v/rodrigotello/valTownInspirationEmail?v=79";
2
3export async function valTownDailyInspo() {
4 return await valTownInspirationEmail();
5}
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function emailRandomJoke() {
4 async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1export async function assert(a, b, message?: string) {
2 const { default: { isEqual } } = await import("npm:lodash");
3 if (!isEqual(a, b)) {
1export function myApi(name) {
2 return "hi " + name;
3}
2
3export let getWttr = async ({ location }) => {
4 function convertBlobToDataUrl(blob) {
5 return new Promise((resolve, reject) => {
6 const reader = new FileReader();
Simple functional CSS library for Val Town
A helper function to build a file's email
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.