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 / tests / fixtures / tree / is-drawn.ts
13 lines · 492 BRaw
1/**
2 * Whether `$.ui.render` answered the tree a hook drew, not the engine's own.
3 *
4 * A tree the engine refused (an element it lacks, a text or node budget
5 * outrun) comes back as the engine's own drawing instead, an `engine` node.
6 *
7 * @param tree what `$.ui.render` resolved to
8 * @returns true for a hook's tree, false for the engine's own
9 */
10export const isDrawn = (tree: unknown): boolean =>
11 typeof tree === 'object' &&
12 tree !== null &&
13 Reflect.get(tree, 'type') !== 'engine'