claude-code / mods /diff /hooks /git /probes /is-absolute-path /is-absolute-path.ts
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
c9c900b verified
Raw History Blame Contribute Delete
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)