MCPcopy Create free account
hub / github.com/WJX20/claude-code / roughTokenCountEstimationForFileType

Function roughTokenCountEstimationForFileType

src/services/tokenEstimation.ts:234–242  ·  view source on GitHub ↗
(
  content: string,
  fileExtension: string,
)

Source from the content-addressed store, hash-verified

232 * let an oversized tool result slip into the conversation.
233 */
234export function roughTokenCountEstimationForFileType(
235 content: string,
236 fileExtension: string,
237): number {
238 return roughTokenCountEstimation(
239 content,
240 bytesPerTokenForFileType(fileExtension),
241 )
242}
243
244/**
245 * Estimates token count for a Message object by extracting and analyzing its text content.

Callers 1

validateContentTokensFunction · 0.85

Calls 2

bytesPerTokenForFileTypeFunction · 0.85

Tested by

no test coverage detected