MCPcopy Create free account
hub / github.com/anomalyco/opencode / matches

Function matches

packages/core/src/patch.ts:174–181  ·  view source on GitHub ↗
(
  lines: ReadonlyArray<string>,
  pattern: ReadonlyArray<string>,
  offset: number,
  compare: (left: string, right: string) => boolean,
)

Source from the content-addressed store, hash-verified

172}
173
174function matches(
175 lines: ReadonlyArray<string>,
176 pattern: ReadonlyArray<string>,
177 offset: number,
178 compare: (left: string, right: string) => boolean,
179) {
180 return pattern.every((line, index) => compare(lines[offset + index]!, line))
181}
182
183const exact = (left: string, right: string) => left === right
184const rstrip = (left: string, right: string) => left.trimEnd() === right.trimEnd()

Callers 1

seekFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected