MCPcopy Create free account
hub / github.com/codeaashu/claude-code / median

Function median

src/screens/REPL.tsx:311–315  ·  view source on GitHub ↗
(values: number[])

Source from the content-addressed store, hash-verified

309// memory issues when working across many files in large projects
310
311function median(values: number[]): number {
312 const sorted = [...values].sort((a, b) => a - b);
313 const mid = Math.floor(sorted.length / 2);
314 return sorted.length % 2 === 0 ? Math.round((sorted[mid - 1]! + sorted[mid]!) / 2) : sorted[mid]!;
315}
316
317/**
318 * Small component to display transcript mode footer with dynamic keybinding.

Callers 1

REPLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected