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 / is-file-at.ts
14 lines · 447 BRaw
1import type { InstructionFile } from 'claude-code'
2
3import { normalSpellingOf } from './normal-spelling-of.js'
4
5/**
6 * Whether an instruction file is the file at a path, however either is
7 * spelled.
8 *
9 * @param file the instruction file
10 * @param path an absolute path
11 * @returns true when both name one path
12 */
13export const isFileAt = (file: InstructionFile, path: string): boolean =>
14 normalSpellingOf(file.path) === normalSpellingOf(path)