MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / everyLineHasLineNumbers

Function everyLineHasLineNumbers

src/integrations/misc/extract-text.ts:163–166  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

161// Checks if every line in the content has line numbers prefixed (e.g., "1 | content" or "123 | content")
162// Line numbers must be followed by a single pipe character (not double pipes)
163export function everyLineHasLineNumbers(content: string): boolean {
164 const lines = content.split(/\r?\n/) // Handles both CRLF (carriage return (\r) + line feed (\n)) and LF (line feed (\n)) line endings
165 return lines.length > 0 && lines.every((line) => /^\s*\d+\s+\|(?!\|)/.test(line))
166}
167
168/**
169 * Strips line numbers from content while preserving the actual content.

Callers 4

executeMethod · 0.90
handlePartialMethod · 0.90
applyDiffMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected