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 / views / sections / present / present.ts
13 lines · 422 BRaw
1import type { RenderElement } from 'claude-code'
2
3/**
4 * The children that are there: nulls dropped, so a part may answer null for
5 * "nothing to draw" and the parent lists it all the same.
6 *
7 * @param children elements or nulls
8 * @returns the elements
9 */
10export const present = (
11 children: readonly (RenderElement | null)[],
12): RenderElement[] =>
13 children.filter((child): child is RenderElement => child !== null)