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

Function countCharInString

source code/utils/stringUtils.ts:56–68  ·  view source on GitHub ↗
(
  str: { indexOf(search: string, start?: number): number },
  char: string,
  start = 0,
)

Source from the content-addressed store, hash-verified

54 * (Buffer.indexOf accepts string needles).
55 */
56export function countCharInString(
57 str: { indexOf(search: string, start?: number): number },
58 char: string,
59 start = 0,
60): number {
61 let count = 0
62 let i = str.indexOf(char, start)
63 while (i !== -1) {
64 count++
65 i = str.indexOf(char, i + 1)
66 }
67 return count
68}
69
70/**
71 * Normalize full-width (zenkaku) digits to half-width digits.

Callers 15

renderToolResultMessageFunction · 0.85
getSnippetForTwoFileDiffFunction · 0.85
TaskOutputResultDisplayFunction · 0.85
formatOutputFunction · 0.85
UserPromptMessageFunction · 0.85
generateFileAttachmentFunction · 0.85
ripGrepFileCountFunction · 0.85
extractToolStatsFunction · 0.85
copyOrWriteToFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected