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 / diff / hooks / entry-kinds-of / entry-kinds-of.ts
17 lines · 540 BRaw
1import type Git from '../git'
2import type { Host } from '../host'
3
4/**
5 * A directory's entries by name with their own kinds, through the host's
6 * listing (no link followed); null when it cannot be listed.
7 *
8 * @param engine the bound host
9 * @returns the probe (GitDeps `entryKindsOf`)
10 */
11export const entryKindsOf =
12 (engine: Host) =>
13 (dir: string): Promise<ReadonlyMap<string, Git.EntryKind> | null> =>
14 engine.listDir(dir).then(
15 entries => new Map(entries.map(entry => [entry.name, entry.kind])),
16 () => null,
17 )