MCPcopy Create free account
hub / github.com/WJX20/claude-code / hasRootNode

Function hasRootNode

packages/color-diff-napi/src/index.ts:498–507  ·  view source on GitHub ↗
(emitter: unknown)

Source from the content-addressed store, hash-verified

496// prior `as unknown as` cast hid a version mismatch (_emitter vs emitter,
497// scope vs kind) behind a silent gray fallback.
498function hasRootNode(emitter: unknown): emitter is { rootNode: HljsNode } {
499 return (
500 typeof emitter === 'object' &&
501 emitter !== null &&
502 'rootNode' in emitter &&
503 typeof emitter.rootNode === 'object' &&
504 emitter.rootNode !== null &&
505 'children' in emitter.rootNode
506 )
507}
508
509let loggedEmitterShapeError = false
510

Callers 1

highlightLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected