(content: string)
| 1818 | } |
| 1819 | |
| 1820 | function exceedsLineLimit(content: string): boolean { |
| 1821 | let count = 0 |
| 1822 | for (let i = 0; i < content.length; i++) { |
| 1823 | if (content[i] === "\n") { |
| 1824 | count++ |
| 1825 | if (count > MAX_LINE_COUNT_FOR_DIFF) return true |
| 1826 | } |
| 1827 | } |
| 1828 | return false |
| 1829 | } |
| 1830 | |
| 1831 | function validatePatchContextLines(contextLines: number): asserts contextLines is 1 | 3 | 10 | 25 | 100 { |
| 1832 | if (!FILE_PATCH_CONTEXT_LINES.has(contextLines)) { |