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=49&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 19289 results for "function"(863ms)

email-parserMMSNewsandNotes.tsx1 match

@dratspiker•Updated 4 days ago
1export default async function (e: Email) {
2
3}
GitHub-Release-Notes

GitHub-Release-NotesReleaseNotes.tsx2 matches

@charmaine•Updated 4 days ago
14type SortOption = "category" | "impact" | "chronological";
15
16export function ReleaseNotes({
17 markdown,
18 onMarkdownChange,
48 });
49
50 // Helper function to clean impact indicators from items
51 const cleanImpactIndicators = (item: string): string => {
52 return item.replace(/\*\*(high|medium|low) impact\*\*/gi, "").trim();
GitHub-Release-Notes

GitHub-Release-Notesgithub.ts5 matches

@charmaine•Updated 4 days ago
5 * Implements pagination to fetch all commits
6 */
7export async function fetchCommits(
8 token: string,
9 owner: string,
71 * Fetches a pull request by its number
72 */
73export async function fetchPR(
74 token: string,
75 owner: string,
103 * Fetches pull requests associated with a commit.
104 */
105async function fetchPRsForCommit(
106 token: string,
107 owner: string,
135 * Fetches issues referenced by a commit or PR using GitHub API
136 */
137async function fetchIssueReferences(
138 token: string,
139 owner: string,
215 * Uses GitHub API to find PR and issue references
216 */
217export async function fetchCommitsWithPRs(
218 token: string,
219 owner: string,
GitHub-Release-Notes

GitHub-Release-Notesllm.ts4 matches

@charmaine•Updated 4 days ago
8 * Generates user-facing release notes from commit and PR data
9 */
10export async function generateReleaseNotes(commits: CommitWithPR[]): Promise<{
11 notes: ReleaseNote[];
12 markdown: string;
113 * Process a chunk of commits to generate release notes
114 */
115async function processCommitChunk(
116 commitChunk: any[],
117 chunkIndex: number,
142For impact assessment, use these specific criteria:
143- "high" impact: Major new features that users will love and significantly improve their experience
144- "medium" impact: Nice-to-have new features and substantial improvements to existing functionality
145- "low" impact: Minor improvements and bug fixes that users will notice
146- DO NOT include changes that aren't user-facing, heavy backend changes, or very small fixes
236 * Generate markdown from release notes
237 */
238function generateMarkdownFromNotes(notes: ReleaseNote[]): string {
239 // Group notes by type
240 const groupedNotes: Record<string, ReleaseNote[]> = {

TownieuseUsageStats.ts1 match

@jxnblk•Updated 4 days ago
1import { useEffect } from "https://esm.sh/react@18.2.0?dev";
2
3export function useUsageStats (messages: any[], usages: any[]) {
4 useEffect(() => {
5 if (!messages?.length) return;

TownieuseScrollToBottom.tsx3 matches

@jxnblk•Updated 4 days ago
7 *
8 * @param {Array} dependencies - Array of dependencies that trigger scrolling when changed
9 * @returns {Object} An object containing containerRef and scrollToBottom function
10 */
11export function useScrollToBottomContainer(dependencies = []) {
12 const containerRef = useRef(null);
13
28
29// body scroll version
30export function useScrollToBottom(dependencies = []) {
31 const bottomRef = useRef(null);
32

Townieuser-summary.ts1 match

@jxnblk•Updated 4 days ago
6 * This includes a fallback to inference calls data when usage data is missing
7 */
8export async function getUserSummary() {
9 // First, get the standard grouped data from the usage table
10 const groupedUsageData = await sqlite.execute(`

TownieuseProject.tsx1 match

@jxnblk•Updated 4 days ago
5const FILES_ENDPOINT = "/api/project-files";
6
7export function useProject (projectId: string, branchId?: string) {
8 const { token } = useAuth();
9 const [data, setData] = useState<any>(null);

TownieuseProjects.tsx1 match

@jxnblk•Updated 4 days ago
4const ENDPOINT = "/api/projects-loader";
5
6export function useProjects () {
7 const { token } = useAuth();
8 const [data, setData] = useState<any>(null);

TownieuseLoadingFavicon.ts3 matches

@jxnblk•Updated 4 days ago
1import { useEffect } from "https://esm.sh/react@18.2.0?dev";
2
3function setLoadingFavicon() {
4 document.querySelector('link[rel="icon"]').href = "/favicon-loading.svg";
5}
6function resetFavicon () {
7 document.querySelector('link[rel="icon"]').href = "/favicon.svg";
8}
9
10export function useLoadingFavicon (loading: boolean) {
11 useEffect(() => {
12 if (loading) setLoadingFavicon();

getFileEmail4 file matches

@shouser•Updated 2 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
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": "*",