MCPcopy Index your code
hub / github.com/codeaashu/claude-code / indexOfWithin

Function indexOfWithin

src/utils/readEditContext.ts:148–151  ·  view source on GitHub ↗

buf.indexOf bounded to [0, end) without allocating a view.

(buf: Buffer, needle: Buffer, end: number)

Source from the content-addressed store, hash-verified

146
147/** buf.indexOf bounded to [0, end) without allocating a view. */
148function indexOfWithin(buf: Buffer, needle: Buffer, end: number): number {
149 const at = buf.indexOf(needle)
150 return at === -1 || at + needle.length > end ? -1 : at
151}
152
153function countNewlines(buf: Buffer, start: number, end: number): number {
154 let n = 0

Callers 1

scanForContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected