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 / tests / fixtures / ancestor-of.ts
20 lines · 435 BRaw
1import type { FsAncestor } from 'claude-code'
2
3/**
4 * One instruction file a walk found.
5 *
6 * @param dir the directory the file stands in
7 * @param name the file's name as the walk asked for it
8 * @param content the file's text
9 * @returns the found file
10 */
11export const ancestorOf = (
12 dir: string,
13 name: string,
14 content: string,
15): FsAncestor => ({
16 dir,
17 name,
18 content,
19 parts: [{ path: `${dir}/${name}`, content }],
20})