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/?q=function&page=107&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 19402 results for "function"(2433ms)

repondiversegetCreations1 match

@elouan•Updated 1 week ago
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 // First, get the row IDs of all rows that are older than 25 hours old
7 const res = await sqlite.execute(`

repondiversegetCreationImage1 match

@elouan•Updated 1 week ago
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const id = url.searchParams.get("id");

repondiversegetCreation1 match

@elouan•Updated 1 week ago
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {
6 const url = new URL(req.url);
7 const id = url.searchParams.get("id");

repondiversedeleteCreation1 match

@elouan•Updated 1 week ago
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - id (number)

repondiverseaddCreation1 match

@elouan•Updated 1 week ago
4import { TABLE_NAME } from "./updateTable";
5
6export default async function(req: Request): Promise<Response> {
7 // body contains:
8 // - title (string)

glastocamindex.ts1 match

@bensomething•Updated 1 week ago
11});
12
13async function main() {
14 try {
15 await agent.login({ identifier: process.env.BLUESKY_USERNAME!, password: process.env.BLUESKY_PASSWORD! });

glastocamtsconfig.json8 matches

@bensomething•Updated 1 week ago
17 // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
18 // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19 // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20 // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21 // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22 // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23 // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
59 // "removeComments": true, /* Disable emitting comments. */
60 // "noEmit": true, /* Disable emitting files from a compilation. */
61 // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
62 // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
63 // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
68 // "newLine": "crlf", /* Set the newline character for emitting files. */
69 // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
70 // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
71 // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
72 // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
86 "noImplicitAny": false, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
87 // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
88 // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
89 // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
90 // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
91 // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
93 // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94 // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95 // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96 // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97 // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98 // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
99 // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */

telegramBotStarterindex.ts4 matches

@asdfg•Updated 1 week ago
1// Main entry point for the Telegram bot
2// This file handles the HTTP endpoint and exports utility functions
3
4import botHandler from "./botFunctions.js";
5
6// Default export - HTTP handler for Telegram webhook
7export default async function(req) {
8 return await botHandler.telegram(req);
9}
10
11// Also export utility functions for manual calls
12export const setupWebhook = botHandler.setupWebhook;
13export const getWebhookInfo = botHandler.getWebhookInfo;

valentinemain.tsx3 matches

@mazizXmaa•Updated 1 week ago
12];
13
14function App() {
15 const [noClicks, setNoClicks] = useState(0);
16 const [isValentine, setIsValentine] = useState(false);
97}
98
99function client() {
100 createRoot(document.getElementById("root")).render(<App />);
101}
102if (typeof document !== "undefined") { client(); }
103
104export default async function server(request: Request): Promise<Response> {
105 return new Response(
106 `

telegramBotStartermessage.tsx3 matches

@asdfg•Updated 1 week ago
11 * Retrieve messages for a specific user from blob storage
12 */
13async function getMessages(userId: string): Promise<Message[]> {
14 try {
15 const messages = await blob.getJSON(`messages:${userId}`) as Message[];
23 * Store a message in the database using Val Town's blob storage
24 */
25export default async function storeMessage(
26 userId: string,
27 userName: string,
55}
56
57// notify admin function

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 3 weeks 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.