spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / agents-md / hooks / frames / normal-spelling-of.ts
9 lines · 399 BRaw
1/**
2 * A path with one separator spelling and no trailing separator, so two
3 * spellings of one path compare equal (`C:/repo/x` and `C:\repo\x`).
4 *
5 * @param path an absolute path as a walk or the model spelled it
6 * @returns the path with `/` for every separator, no trailing one
7 */
8export const normalSpellingOf = (path: string): string =>
9 path.replaceAll('\\', '/').replace(/(?<=.)\/+$/, '')