MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / sliceUtf8

Function sliceUtf8

src/utils/tree-sitter.ts:102–105  ·  view source on GitHub ↗
(content: string, startIndex: number, endIndex: number)

Source from the content-addressed store, hash-verified

100}
101
102function sliceUtf8(content: string, startIndex: number, endIndex: number): string {
103 const utf8 = Buffer.from(content, 'utf8');
104 return utf8.subarray(startIndex, endIndex).toString('utf8');
105}
106
107function extractNodeContent(node: Node, content: string): string {
108 const byteSlice = sliceUtf8(content, node.startIndex, node.endIndex);

Callers 1

extractNodeContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected