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 / strings-of.ts
11 lines · 377 BRaw
1import { childrenOf } from './children-of.js'
2
3/**
4 * Every string child under a rendered tree node, depth-first in drawing
5 * order: what the engine counts against its text caps.
6 *
7 * @param node an element or a string
8 * @returns the strings
9 */
10export const stringsOf = (node: unknown): string[] =>
11 typeof node === 'string' ? [node] : childrenOf(node).flatMap(stringsOf)