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

Function tryPush

source code/utils/readFileInRange.ts:150–162  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

148 let truncatedByBytes = false
149
150 function tryPush(line: string): boolean {
151 if (truncateAtBytes !== undefined) {
152 const sep = selectedLines.length > 0 ? 1 : 0
153 const nextBytes = selectedBytes + sep + Buffer.byteLength(line)
154 if (nextBytes > truncateAtBytes) {
155 truncatedByBytes = true
156 return false
157 }
158 selectedBytes = nextBytes
159 }
160 selectedLines.push(line)
161 return true
162 }
163
164 while ((newlinePos = text.indexOf('\n', startPos)) !== -1) {
165 if (lineIndex >= offset && lineIndex < endLine && !truncatedByBytes) {

Callers 1

readFileInRangeFastFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected