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 / code-blocks-of / is-within-code-cap.ts
11 lines · 355 BRaw
1import Views from '../../../hooks/views'
2
3/**
4 * Whether a source is one a `Code` element may carry: at most
5 * MAX_CODE_CHARS, counted in UTF-16 units as the engine counts.
6 *
7 * @param source the block's source
8 * @returns true when the source fits
9 */
10export const isWithinCodeCap = (source: string): boolean =>
11 source.length <= Views.MAX_CODE_CHARS