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/image-url.jpg%20%22Optional%20title%22?q=function&page=1808&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 18895 results for "function"(1263ms)

myApimain.tsx1 match

@stevekrouse•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

groupBymain.tsx5 matches

@stevekrouse•Updated 1 year ago
3 * (c) 2019 Tom Bremmer (https://tbremer.com/) and Chris Ferdinandi (https://gomakethings.com), MIT License,
4 * @param {Array} arr The array to group items from
5 * @param {String|Function} criteria The criteria to group by
6 * @return {Object} The grouped object
7 */
8export function groupBy<A>(arr: A[], criteria: ((a: A) => string) | string) {
9 return arr.reduce(function (obj, item) {
10 // Check if the criteria is a function to run on the item or a property of it
11 var key = typeof criteria === "function" ? criteria(item) : item[criteria];
12
13 // If the key doesn't exist yet, create it

myApimain.tsx1 match

@zachkorner•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApiDeletemain.tsx1 match

@acmu•Updated 1 year ago
2let { nameList } = await import("https://esm.town/v/acmu/nameList");
3
4export async function myApiDelete(name) {
5 if (Array.isArray(nameList)) {
6 nameList = nameList.filter((i) => i !== name);

arenaHelpersmain.tsx2 matches

@korede•Updated 1 year ago
2
3export const arenaHelpers = (async () => {
4 async function requestUserWithChannels(userId: number, opts: {
5 accessToken?: string;
6 authToken?: string;
29 return await response.json();
30 }
31 const resolveChannels = async function (arenaUserCreds) {
32 console.log("DEBUG", "start resolve channels");
33 try {

myApimain.tsx1 match

@spdegabrielle•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

myApimain.tsx1 match

@thejackobrien•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

handleOnboardingUseCasesmain.tsx1 match

@rodrigotello•Updated 1 year ago
3
4// Triggered when someone tells us what they want to use VT for
5export async function handleOnboardingUseCases({ auth, handle, useCases }: {
6 auth: string;
7 handle: string;

myApimain.tsx1 match

@jothsa•Updated 1 year ago
1export function myApi(name) {
2 return "hi " + name;
3}

pollCryptoFearAndGreedIndexmain.tsx1 match

@chrispie•Updated 1 year ago
3import { cryptoFearAndGreedIndex } from "https://esm.town/v/chrispie/cryptoFearAndGreedIndex";
4
5export async function pollCryptoFearAndGreedIndex() {
6 let index = await cryptoFearAndGreedIndex();
7 const date = Date.now();

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
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
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": "*",