MCPcopy Create free account
hub / github.com/observablehq/framework / transpileJavaScript

Function transpileJavaScript

src/markdown.ts:67–73  ·  view source on GitHub ↗
(content: string, tag: "ts" | "jsx" | "tsx")

Source from the content-addressed store, hash-verified

65}
66
67function transpileJavaScript(content: string, tag: "ts" | "jsx" | "tsx"): string {
68 try {
69 return transformJavaScriptSync(content, tag);
70 } catch (error: any) {
71 throw new SyntaxError(error.message);
72 }
73}
74
75function getLiveSource(content: string, tag: string, attributes: Record<string, string>): string | undefined {
76 return tag === "js"

Callers 5

renderPageFunction · 0.70
getLiveSourceFunction · 0.70
transpileCodeFunction · 0.70
runTestsFunction · 0.50
transpile-test.tsFile · 0.50

Calls 1

transformJavaScriptSyncFunction · 0.85

Tested by

no test coverage detected