mirror of
https://github.com/anthropics/claude-code.git
synced 2026-10-31 07:53:02 +08:00
# Conflicts: # mods/diff/hooks/register.ts # mods/diff/hooks/views/detail/code-blocks-of/code-blocks-of.ts # mods/diff/tests/fixtures/git-in.ts # mods/diff/tests/fixtures/in-repository.ts # mods/diff/tests/fixtures/index.ts # mods/telemetry/tests/fixtures/index.ts
12 lines
355 B
TypeScript
12 lines
355 B
TypeScript
import Views from '../../../hooks/views'
|
|
|
|
/**
|
|
* Whether a source is one a `Code` element may carry: at most
|
|
* MAX_CODE_CHARS, counted in UTF-16 units as the engine counts.
|
|
*
|
|
* @param source the block's source
|
|
* @returns true when the source fits
|
|
*/
|
|
export const isWithinCodeCap = (source: string): boolean =>
|
|
source.length <= Views.MAX_CODE_CHARS
|