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/$%7BsvgDataUrl%7D?q=function&page=1&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 30425 results for "function"(3457ms)

cardamonRecipeForm.tsx1 match

@connnolly•Updated 31 mins ago
9}
10
11export default function RecipeForm({ recipe, onRecipeSaved, onCancel }: RecipeFormProps) {
12 const [formData, setFormData] = useState<Partial<Recipe>>({
13 title: recipe?.title || '',

brokenLinkCrawlercheckLink.tsx1 match

@willthereader•Updated 38 mins ago
1export async function checkLink(link) {
2 const linksMetaData = await fetch(link, {
3 method: "HEAD",

cardamonqueries.ts5 matches

@connnolly•Updated 39 mins ago
3import type { Recipe, Ingredient, RecipeFilters } from "../../shared/types.ts";
4
5export async function createRecipe(recipe: Omit<Recipe, 'id' | 'createdAt' | 'updatedAt'>): Promise<Recipe> {
6 const { ingredients, steps, tags, ...recipeData } = recipe;
7
71}
72
73export async function getRecipeById(id: number): Promise<Recipe | null> {
74 const recipeResult = await sqlite.execute(`
75 SELECT * FROM ${RECIPES_TABLE} WHERE id = ?
114}
115
116export async function getAllRecipes(filters?: RecipeFilters): Promise<Recipe[]> {
117 let query = `SELECT * FROM ${RECIPES_TABLE}`;
118 const params: any[] = [];
158}
159
160export async function updateRecipe(id: number, updates: Partial<Recipe>): Promise<Recipe | null> {
161 const { ingredients, steps, tags, ...recipeData } = updates;
162
221}
222
223export async function deleteRecipe(id: number): Promise<boolean> {
224 const result = await sqlite.execute(`DELETE FROM ${RECIPES_TABLE} WHERE id = ?`, [id]);
225

brokenLinkCrawlermainFunction.tsx1 match

@willthereader•Updated 50 mins ago
1import { checkLink } from "./checkLink.tsx";
2import { urlGetter } from "./urlGetter.tsx";
3async function brokenLinkCheckerMainFuction(url) {
4 const urlList = await urlGetter(url);
5 const checkedLink = await Promise.all(urlList.map(checkLink));

cardamonparse.ts4 matches

@connnolly•Updated 57 mins ago
6const openai = new OpenAI();
7
8// Function to validate and clean recipe data
9function validateAndCleanRecipe(recipe: any): Recipe {
10 // Ensure required fields exist
11 if (!recipe.title || typeof recipe.title !== 'string') {
72}
73
74// Function to convert fractional Unicode characters to decimal values
75function convertFractionsToDecimals(text: string): string {
76 const fractionMap: { [key: string]: string } = {
77 '¼': '0.25',

brokenLinkCrawlerurlGetter.tsx1 match

@willthereader•Updated 1 hour ago
1export async function urlGetter(sourceURl) {
2 const response = await fetch(sourceURl);
3 const html = await response.text();

cardamonRecipeView.tsx1 match

@connnolly•Updated 1 hour ago
10}
11
12export default function RecipeView({ recipe, onEdit, onDelete, onBack }: RecipeViewProps) {
13 const [servingMultiplier, setServingMultiplier] = useState(1);
14 const [deleteConfirm, setDeleteConfirm] = useState(false);

cardamonRecipeList.tsx1 match

@connnolly•Updated 1 hour ago
11}
12
13export default function RecipeList({
14 recipes,
15 onRecipeSelect,

cardamonApp.tsx1 match

@connnolly•Updated 1 hour ago
16}
17
18export default function App() {
19 const [state, setState] = useState<AppState>({
20 view: 'list',

cardamonmigrations.ts1 match

@connnolly•Updated 1 hour ago
4const INGREDIENTS_TABLE = 'ingredients_v1';
5
6export async function runMigrations() {
7 console.log('Running database migrations...');
8
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.