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

Function trimEndMatch

src/core/tools/apply-patch/seek-sequence.ts:53–60  ·  view source on GitHub ↗

* Check if two arrays of lines match after trimming trailing whitespace.

(lines: string[], pattern: string[], startIndex: number)

Source from the content-addressed store, hash-verified

51 * Check if two arrays of lines match after trimming trailing whitespace.
52 */
53function trimEndMatch(lines: string[], pattern: string[], startIndex: number): boolean {
54 for (let i = 0; i < pattern.length; i++) {
55 if (lines[startIndex + i]?.trimEnd() !== pattern[i]?.trimEnd()) {
56 return false
57 }
58 }
59 return true
60}
61
62/**
63 * Check if two arrays of lines match after trimming both sides.

Callers 1

seekSequenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected