Function
matches
(
lines: ReadonlyArray<string>,
pattern: ReadonlyArray<string>,
offset: number,
compare: (left: string, right: string) => boolean,
)
Source from the content-addressed store, hash-verified
| 172 | } |
| 173 | |
| 174 | function 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 | |
| 183 | const exact = (left: string, right: string) => left === right |
| 184 | const rstrip = (left: string, right: string) => left.trimEnd() === right.trimEnd() |
Tested by
no test coverage detected