Skip to the content

Capsid menu

app/lib/content/wasm.server.ts

10 lines and 1 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.

Functions

The functions of wasm.server.ts
FunctionLinesComplexityCoveredCRAPMutation
instantiate12 to 121No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code

Imports

It imports no other module of this repo. Imported by app/lib/content/load-pipeline.server.ts.

Source

import onigModule from "shiki/onig.wasm";

/**
 * Workers refuse WebAssembly.instantiate() on raw bytes, which is what import("shiki/wasm") does;
 * a statically imported .wasm is already compiled and may be instantiated. Must not import the
 * pipeline itself, or the dynamic import in loadPipeline stops splitting.
 */
const wasm = (globalThis as typeof globalThis & {
  WebAssembly: { instantiate: (m: unknown, i: unknown) => Promise<unknown> };
}).WebAssembly;

export const instantiate = (imports: unknown) => wasm.instantiate(onigModule, imports);