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

Function trimMatch

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

* Check if two arrays of lines match after trimming both sides.

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

Source from the content-addressed store, hash-verified

63 * Check if two arrays of lines match after trimming both sides.
64 */
65function trimMatch(lines: string[], pattern: string[], startIndex: number): boolean {
66 for (let i = 0; i < pattern.length; i++) {
67 if (lines[startIndex + i]?.trim() !== pattern[i]?.trim()) {
68 return false
69 }
70 }
71 return true
72}
73
74/**
75 * Check if two arrays of lines match after Unicode normalization.

Callers 1

seekSequenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected