Download mods/diff/hooks/git/probes/is-absolute-path/is-absolute-path.ts from SaylorTwift/claude-code: direct link, hf CLI and curl.
- Browser
- Download file 357 Bytes
-
https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/hooks/git/probes/is-absolute-path/is-absolute-path.ts
- Command line
-
hf download hf://SaylorTwift/claude-code/mods/diff/hooks/git/probes/is-absolute-path/is-absolute-path.ts
-
curl -L -o is-absolute-path.ts https://huggingface.co/SaylorTwift/claude-code/resolve/main/mods/diff/hooks/git/probes/is-absolute-path/is-absolute-path.ts
357 Bytes
| /** | |
| * Whether a line `rev-parse --path-format=absolute` printed is an absolute | |
| * path (POSIX or drive-letter), and so neither relative nor an echoed flag. | |
| * | |
| * @param line one line of rev-parse output | |
| * @returns whether it names an absolute path | |
| */ | |
| export const isAbsolutePath = (line: string) => | |
| line.startsWith('/') || /^[A-Za-z]:[\\/]/.test(line) | |