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=1677&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 18558 results for "function"(2302ms)

updateValByIDmain.tsx1 match

@nbbaier•Updated 1 year ago
11}
12
13export function updateValByID({ token, valId, code, name, readme, privacy }: UpdateValArgs): Promise<any> {
14 const body: Record<string, unknown> = {
15 token,

updateValByNamemain.tsx1 match

@nbbaier•Updated 1 year ago
7}
8
9export function updateValByName({ token, code, name }: UpdateValArgs): Promise<any> {
10 const body: Record<string, unknown> = {
11 token,

untitled_tanTickmain.tsx1 match

@hfu•Updated 1 year ago
1export default async function (req: Request): Promise<Response> {
2 return Response.json({
3 type: 'Feature',

notebookmain.tsx2 matches

@pomdtr•Updated 1 year ago
4import mime from "npm:mime@4.0.1";
5
6export function extractFiles(markdown: string): Record<string, string> {
7 const fileRegex = /^```(\w+)\s*(.*)\s*\n([\s\S]*?)```/gm;
8 const files: Record<string, string> = {};
18}
19
20export default async function(req: Request) {
21 const { pathname, search } = new URL(req.url);
22 const params = new URLSearchParams(search);

logMessagemain.tsx4 matches

@willthereader•Updated 1 year ago
3 const allowedLogLevels = ["error", "debug", "info", "warn"];
4
5 function logMessage(level, message) {
6 // console.log("logMessage function called");
7 // Check if the specified log level is allowed
8 if (allowedLogLevels.includes(level)) {
16 }
17
18 return logMessage; // Return the logMessage function for usage
19})();
20
21// Export the logMessage function for use in other modules
22export { logMessage };
23

constructReadTangleUrlmain.tsx1 match

@willthereader•Updated 1 year ago
1import { logMessage } from "https://esm.town/v/willthereader/logMessage";
2
3// Immediately invoked function that exports a function generating a URL as a string,
4// which fetches all comments from an article associated with the provided post_id.
5export const constructReadTangleUrl = (() => {

date_me_docs_tablemain.tsx2 matches

@skyehersh•Updated 1 year ago
17];
18
19function renderCell(header, row) {
20 let data = row[header];
21 if (header === "Name") {
31}
32
33export async function docs_table() {
34 const docs = await getDocs();
35 return (

dataTableScriptmain.tsx1 match

@skyehersh•Updated 1 year ago
6const styleEl = document.getElementById("style");
7
8DataTable.ext.search.push(function(settings, data, dataIndex) {
9 let min = parseInt(minEl.value, 10);
10 let max = parseInt(maxEl.value, 10);

getThreadsActivitymain.tsx3 matches

@stevekrouse•Updated 1 year ago
11});
12
13async function getKnownThreads() {
14 const result = await db.select().from(threadsTbl);
15 return result.reduce((r, { id, last_message_id }) => {
19}
20
21async function getNewThreads() {
22 const resp = await fetch(`https://discord.com/api/guilds/${guild}/threads/active`, {
23 headers: {
34}
35
36export async function getThreadsActivity(
37 token: string,
38 guild: string,

dataTableScriptmain.tsx1 match

@stevekrouse•Updated 1 year ago
4const desiredGenderEl = document.getElementById("desired-gender");
5
6DataTable.ext.search.push(function(settings, data, dataIndex) {
7 let min = parseInt(minEl.value, 10);
8 let max = parseInt(maxEl.value, 10);

getFileEmail4 file matches

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

tuna8 file matches

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