MCPcopy
hub / github.com/claude-code-best/claude-code / firstLineOf

Function firstLineOf

src/utils/stringUtils.ts:44–47  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

42 * Used for shebang detection in diff rendering.
43 */
44export function firstLineOf(s: string): string {
45 const nl = s.indexOf('\n')
46 return nl === -1 ? s : s.slice(0, nl)
47}
48
49/**
50 * Counts occurrences of `char` in `str` using indexOf jumps instead of

Callers 5

loadRejectionDiffFunction · 0.85
loadDiffDataFunction · 0.85
execCommandHookFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected