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=526&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 20384 results for "function"(4476ms)

OpenTownieDirectoryTree.tsx3 matches

@tallesjp•Updated 3 weeks ago
16}
17
18// Helper function to build a tree structure from flat file list
19const buildFileTree = (files: Array<{ path: string; type: string }>): FileNode[] => {
20 const root: FileNode[] = [];
209};
210
211export function DirectoryTree({ files, onSelectionChange }: DirectoryTreeProps) {
212 const [treeData, setTreeData] = useState<FileNode[]>([]);
213 const [checkedState, setCheckedState] = useState<Record<string, boolean>>({});
220 }, [files]);
221
222 // Helper function to convert numbers to words (for small numbers)
223 const numberToWords = (num: number): string => {
224 const words = [

OpenTownieCreateProject.tsx1 match

@tallesjp•Updated 3 weeks ago
2import React, { useEffect, useState } from "https://esm.sh/react@18.2.0?dev";
3
4export function CreateProjectModal({
5 isOpen,
6 onClose,

OpenTownieCreateBranch.tsx1 match

@tallesjp•Updated 3 weeks ago
9}
10
11export function CreateBranch({
12 projectId,
13 bearerToken,

OpenTownieChat.tsx1 match

@tallesjp•Updated 3 weeks ago
11import { processFiles } from "./ImageUpload.tsx";
12
13export function Chat({
14 project,
15 bearerToken,

OpenTownieChatMessages.tsx1 match

@tallesjp•Updated 3 weeks ago
12}
13
14export function ChatMessages({
15 messages,
16 usages,

OpenTownieChatInput.tsx2 matches

@tallesjp•Updated 3 weeks ago
13}
14
15export function ChatInput({
16 input,
17 handleInputChange,
128 onClick={() => {
129 const customStop = (window as any).customStopRef?.current;
130 if (typeof customStop === "function") {
131 customStop();
132 }

OpenTownieChatHeader.tsx1 match

@tallesjp•Updated 3 weeks ago
17}
18
19export function ChatHeader({
20 project,
21 bearerToken,

OpenTownieBranchControl.tsx1 match

@tallesjp•Updated 3 weeks ago
17}
18
19export function BranchControl({
20 projectId,
21 projectName,

OpenTownieApp.tsx4 matches

@tallesjp•Updated 3 weeks ago
6import { Projects } from "./Projects.tsx";
7
8function safeParse(s: string) {
9 try {
10 return JSON.parse(s);
14}
15
16export function App() {
17 const [bearerToken, setBearerToken] = useLocalStorage("bearer", "");
18 const [anthropicApiKey, setAnthropicApiKey] = useLocalStorage("anthropic_api_key", "");
20 const [project, setProject_] = useState(safeParse(projectJSON));
21
22 function setProject(p: any) {
23 setProject_(p);
24 setProjectJSON(JSON.stringify(p));
25 }
26
27 function handleLogout() {
28 setBearerToken("");
29 // Keep the anthropic API key in case the user wants to reuse it

OpenTownieapi.ts1 match

@tallesjp•Updated 3 weeks ago
1// Fetch project files from the backend
2export async function fetchProjectFiles(
3 { bearerToken, projectId, branchId }: { bearerToken: string; projectId: string; branchId?: string },
4) {

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.