Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=function&page=2127&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 22727 results for "function"(2530ms)

styleSystemmain.tsx2 matches

@tmcw•Updated 1 year ago
3import { Context } from "npm:hono@3.8.1";
4
5export function styleSystem() {
6 function StyleTag() {
7 return (
8 <style

styleSystemmain.tsx2 matches

@tmcw•Updated 1 year ago
3import { Context } from "npm:hono@3.8.1";
4
5export function styleSystem() {
6 function StyleTag() {
7 return (
8 <style

getMaterialsmain.tsx1 match

@tmcw•Updated 1 year ago
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));

getMaterialIdsmain.tsx1 match

@tmcw•Updated 1 year ago
2import { Context } from "npm:hono@3.8.1";
3
4export function getMaterialIds(c: Context | null) {
5 if (!c) return new Set();
6 try {

sortmain.tsx1 match

@tmcw•Updated 1 year ago
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

getCookiemain.tsx1 match

@tmcw•Updated 1 year ago
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)) {

setCookiemain.tsx1 match

@tmcw•Updated 1 year ago
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);

getInflightmain.tsx1 match

@tmcw•Updated 1 year ago
2import { Context } from "npm:hono@3.8.1";
3
4export function getInflight(c: Context) {
5 return InflightCookies.get(c) || new Map();
6}

formatFloatmain.tsx1 match

@tmcw•Updated 1 year ago
24
25// TODO: refactor
26export function formatFloat(a: number) {
27 const intPart = Math.floor(a);
28 const remainder = Math.floor((a - intPart) * 100);

blogREADME.md1 match

@pomdtr•Updated 1 year ago
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));

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 month ago
Simple functional CSS library for Val Town
lost1991
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.