MCPcopy Index your code
hub / github.com/nodejs/nodejs.org / getEngine

Function getEngine

packages/rehype-shiki/src/index.mjs:32–41  ·  view source on GitHub ↗

* Creates the appropriate regex engine based on configuration * @param {HighlighterOptions} options - Configuration options

({ wasm = false })

Source from the content-addressed store, hash-verified

30 * @param {HighlighterOptions} options - Configuration options
31 */
32async function getEngine({ wasm = false }) {
33 if (wasm) {
34 const { createOnigurumaEngine } = await import('@shikijs/engine-oniguruma');
35 return createOnigurumaEngine(await import('shiki/wasm'));
36 }
37
38 const { createJavaScriptRegexEngine } =
39 await import('@shikijs/engine-javascript');
40 return createJavaScriptRegexEngine();
41}
42
43/**
44 * Configures and returns transformers based on options

Callers 1

index.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected