MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / parseTokenBudget

Function parseTokenBudget

source code/utils/tokenBudget.ts:23–31  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

21}
22
23export function parseTokenBudget(text: string): number | null {
24 const startMatch = text.match(SHORTHAND_START_RE)
25 if (startMatch) return parseBudgetMatch(startMatch[1]!, startMatch[2]!)
26 const endMatch = text.match(SHORTHAND_END_RE)
27 if (endMatch) return parseBudgetMatch(endMatch[1]!, endMatch[2]!)
28 const verboseMatch = text.match(VERBOSE_RE)
29 if (verboseMatch) return parseBudgetMatch(verboseMatch[1]!, verboseMatch[2]!)
30 return null
31}
32
33export function findTokenBudgetPositions(
34 text: string,

Callers 1

REPLFunction · 0.85

Calls 1

parseBudgetMatchFunction · 0.85

Tested by

no test coverage detected