Download mods/diff/tests/fixtures/code-blocks-of/are-contiguous.ts from SaylorTwift/claude-code: direct link, hf CLI and curl.
- Browser
- Download file 588 Bytes
-
https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/tests/fixtures/code-blocks-of/are-contiguous.ts
- Command line
-
hf download hf://SaylorTwift/claude-code/mods/diff/tests/fixtures/code-blocks-of/are-contiguous.ts
-
curl -L -o are-contiguous.ts https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/tests/fixtures/code-blocks-of/are-contiguous.ts
588 Bytes
| import type { ParsedHunk } from './parsed-hunk.js' | |
| /** | |
| * Whether each hunk starts where the one before it ended, on both sides: | |
| * the sub-hunks of one hunk split leave no line out and repeat none. | |
| * | |
| * @param parts the hunks in order | |
| * @returns true when they abut | |
| */ | |
| export const areContiguous = (parts: readonly ParsedHunk[]): boolean => | |
| parts.slice(1).every((part, at) => { | |
| const before = parts[at] | |
| return ( | |
| before !== undefined && | |
| part.oldStart === before.oldStart + before.oldLines && | |
| part.newStart === before.newStart + before.newLines | |
| ) | |
| }) | |