MCPcopy Create free account
hub / github.com/codeaashu/claude-code / hljs

Function hljs

src/native-ts/color-diff/index.ts:35–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33type HLJSApi = typeof hljsNamespace
34let cachedHljs: HLJSApi | null = null
35function hljs(): HLJSApi {
36 if (cachedHljs) return cachedHljs
37 // eslint-disable-next-line @typescript-eslint/no-require-imports
38 const mod = require('highlight.js')
39 // highlight.js uses `export =` (CJS). Under bun/ESM the interop wraps it
40 // in .default; under node CJS the module IS the API. Check at runtime.
41 cachedHljs = 'default' in mod && mod.default ? mod.default : mod
42 return cachedHljs!
43}
44
45import { stringWidth } from '../../ink/stringWidth.js'
46import { logError } from '../../utils/log.js'

Callers 2

detectLanguageFunction · 0.85
highlightLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected