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 / mtime-of / mtime-of.ts
16 lines · 378 BRaw
1import type { Host } from '../host'
2
3/**
4 * A path's modification time through the host, or null when the path
5 * cannot be read (GitDeps `mtimeOf`).
6 *
7 * @param engine the bound host
8 * @returns the probe
9 */
10export const mtimeOf =
11 (engine: Host) =>
12 (path: string): Promise<number | null> =>
13 engine.stat(path).then(
14 stat => stat.mtimeMs,
15 () => null,
16 )