()
| 33 | type HLJSApi = typeof hljsNamespace |
| 34 | let cachedHljs: HLJSApi | null = null |
| 35 | function 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 | |
| 45 | import { stringWidth } from '../../ink/stringWidth.js' |
| 46 | import { logError } from '../../utils/log.js' |
no outgoing calls
no test coverage detected