23 ...await import("https://deno.land/std/testing/mock.ts"),
24 } as const,
25 async function should_reject_after_last_attempt(
26 {
27 dlock,
44 });
45 },
46 async function should_reject_ttl_of_0(
47 { dlock, id, ttl, fetchStub, assertMatch, assertRejects },
48 ) {
50 assertMatch(err.message, /ttl/);
51 },
52 async function should_return_lock_on_successful_request(
53 { dlock, deadline, fetchStub, assertFalse, assertEquals },
54 ) {
63 },
64 // runs into endless loop!
65 async function skip_should_reject_when_id_is_locked(
66 { dlock, id, ttl, deadline, fetchStub, assertRejects, assertEquals },
67 ) {
1import { state as state2 } from "https://esm.town/v/abc3354/state";
2
3export const counter = async function () {
4 const [state, setState] = await state2("abc3354/counter", {
5 count: 0,
1export function testReceive(req, res) {
2 res.send("ok");
3}
1export function myApi(name) {
2 console.email("yay " + name);
3 return "hi :)" + name;
2import { convertCurrency } from "https://esm.town/v/frankdilo/convertCurrency";
3
4export async function emailMeExchangeRate() {
5 const rate = await convertCurrency("eur");
6 const formattedRate = formatCurrency(rate, 3, "EUR");
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 return "hi " + name;
3}
1export async function downloadMega(req, res) {
2 const { File } = await import("npm:megajs");
3 if (!req.query.url) {
1import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=3";
2
3export async function airquality(interval: Interval) {
4 const location = "brooklyn navy yard"; // <-- change to place, city, or zip code
5 const data = await easyAQI({ location });
1export function myApi(name) {
2 return "hi " + name;
3}
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",