Function
diffAddsOrRemovesSymbol
(diff: string, name: string, kind: "def" | "class")
Source from the content-addressed store, hash-verified
| 40 | } |
| 41 | |
| 42 | function diffAddsOrRemovesSymbol(diff: string, name: string, kind: "def" | "class"): boolean { |
| 43 | const pattern = new RegExp(`^[+-]${kind}\\s+${name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*[(:]`, "m"); |
| 44 | return pattern.test(diff); |
| 45 | } |
| 46 | |
| 47 | function hasAnchorBodyEdit(diff: string): boolean { |
| 48 | const lines = diff.split("\n").slice(1); |
Tested by
no test coverage detected