MCPcopy Index your code
hub / github.com/msgbyte/tianji / transformTypescriptCode

Function transformTypescriptCode

src/server/utils/vm/utils.ts:8–33  ·  view source on GitHub ↗
(sourceCode: string)

Source from the content-addressed store, hash-verified

6 * @NOTICE: this fetaure has memory leak issue, temp remove it.
7 */
8export async function transformTypescriptCode(sourceCode: string) {
9 // Commented as its maybe have memory leak issue
10 // const res = await swcTransform(sourceCode, {
11 // jsc: {
12 // parser: {
13 // syntax: 'typescript',
14 // tsx: false,
15 // },
16 // target: 'esnext',
17 // },
18 // module: {
19 // type: 'es6',
20 // },
21 // minify: false,
22 // });
23
24 // return res.code;
25 const res = await esbuildTransform(sourceCode, {
26 loader: 'ts',
27 format: 'esm',
28 target: 'esnext',
29 minify: false,
30 });
31
32 return res.code;
33}

Callers 1

runCodeInIVMFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected