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

Function compareDesc

src/utils/listSessionsImpl.ts:230–233  ·  view source on GitHub ↗

* Sort comparator: lastModified desc, then sessionId desc for stable * ordering across mtime ties.

(a: Candidate, b: Candidate)

Source from the content-addressed store, hash-verified

228 * ordering across mtime ties.
229 */
230function compareDesc(a: Candidate, b: Candidate): number {
231 if (b.mtime !== a.mtime) return b.mtime - a.mtime
232 return b.sessionId < a.sessionId ? -1 : b.sessionId > a.sessionId ? 1 : 0
233}
234
235async function applySortAndLimit(
236 candidates: Candidate[],

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected