MCPcopy Index your code
hub / github.com/liuup/claude-code-analysis / tryPush

Function tryPush

src/utils/readFileInRange.ts:148–160  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

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

Callers 1

readFileInRangeFastFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected