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/$%7Burl%7D?q=function&page=2013&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 30868 results for "function"(5458ms)

Open-ToownieLogin.tsx1 match

@toowired•Updated 2 months ago
2import { useLocalStorage } from "https://esm.sh/react-use?dev&deps=react@18.2.0&react-dom@18.2.0";
3
4export function Login() {
5 const [bearerToken, setBearerToken] = useLocalStorage("bearer", "");
6 const [anthropicApiKey, setAnthropicApiKey] = useLocalStorage("anthropic_api_key", "");

Open-ToownieImageUpload.tsx3 matches

@toowired•Updated 2 months ago
11}
12
13export function ImageUpload({ images, setImages, processFiles }: ImageUploadProps) {
14 const fileInputRef = useRef<HTMLInputElement>(null);
15
79}
80
81// Process files utility function - moved from the component to be reusable
82export const processFiles = async (files: File[], images: (string | null)[], setImages: (images: (string | null)[]) => void) => {
83 // Filter for image files only
124
125// Component to display images in messages
126export function ImagePreview({ images }: { images: string[] }) {
127 const [expandedImage, setExpandedImage] = useState<string | null>(null);
128

Open-ToownieErrorDisplay.tsx1 match

@toowired•Updated 2 months ago
6}
7
8export function ErrorDisplay({ error }: ErrorDisplayProps) {
9 if (!error) return null;
10

Open-ToownieDirectoryTree.tsx3 matches

@toowired•Updated 2 months 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 = [

Open-ToownieCreateBranch.tsx1 match

@toowired•Updated 2 months ago
9}
10
11export function CreateBranch({
12 projectId,
13 bearerToken,

Open-ToownieChat.tsx1 match

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

Open-ToownieChatMessages.tsx1 match

@toowired•Updated 2 months ago
12}
13
14export function ChatMessages({
15 messages,
16 usages,

Open-ToownieChatInput.tsx2 matches

@toowired•Updated 2 months 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 }

Open-ToownieChatHeader.tsx1 match

@toowired•Updated 2 months ago
17}
18
19export function ChatHeader({
20 project,
21 bearerToken,

Open-ToownieBranchControl.tsx1 match

@toowired•Updated 2 months ago
17}
18
19export function BranchControl({
20 projectId,
21 projectName,
tuna

tuna9 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town

getFileEmail4 file matches

@shouser•Updated 1 month ago
A helper function to build a file's email
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.