Function
isDisproportionateMatch
(search: string, oldString: string)
Source from the content-addressed store, hash-verified
| 729 | } |
| 730 | |
| 731 | function isDisproportionateMatch(search: string, oldString: string) { |
| 732 | const oldLines = oldString.split("\n").length |
| 733 | const searchLines = search.split("\n").length |
| 734 | if (searchLines >= Math.max(oldLines + 3, oldLines * 2)) return true |
| 735 | if (oldLines === 1) return false |
| 736 | return search.trim().length > Math.max(oldString.trim().length + 500, oldString.trim().length * 4) |
| 737 | } |
Tested by
no test coverage detected