Function
equalsSlice
(
source: string[],
target: string[],
start: number,
mapFn: (value: string) => string,
)
Source from the content-addressed store, hash-verified
| 278 | } |
| 279 | |
| 280 | function equalsSlice( |
| 281 | source: string[], |
| 282 | target: string[], |
| 283 | start: number, |
| 284 | mapFn: (value: string) => string, |
| 285 | ): boolean { |
| 286 | if (start + target.length > source.length) { |
| 287 | return false |
| 288 | } |
| 289 | |
| 290 | for (let i = 0; i < target.length; i += 1) { |
| 291 | if (mapFn(source[start + i]!) !== mapFn(target[i]!)) { |
| 292 | return false |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | return true |
| 297 | } |
| 298 | |
| 299 | function findContextCore( |
| 300 | lines: string[], |
Tested by
no test coverage detected