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

Function transformJavaScript

src/javascript/module.ts:257–263  ·  view source on GitHub ↗
(
  source: string,
  loader: "ts" | "jsx" | "tsx",
  sourcePath?: string
)

Source from the content-addressed store, hash-verified

255}
256
257export async function transformJavaScript(
258 source: string,
259 loader: "ts" | "jsx" | "tsx",
260 sourcePath?: string
261): Promise<string> {
262 return (await transform(source, getTransformOptions(loader, sourcePath))).code;
263}
264
265export function transformJavaScriptSync(source: string, loader: "ts" | "jsx" | "tsx", sourcePath?: string): string {
266 return transformSync(source, getTransformOptions(loader, sourcePath)).code;

Callers 1

readJavaScriptFunction · 0.85

Calls 2

transformFunction · 0.85
getTransformOptionsFunction · 0.85

Tested by

no test coverage detected