MCPcopy Create free account
hub / github.com/Effect-TS/effect / writeTempTsconfig

Function writeTempTsconfig

packages/effect/typeperf/run.mjs:43–65  ·  view source on GitHub ↗
(suiteName, subjectName, sourcePath)

Source from the content-addressed store, hash-verified

41const sanitize = (name) => name.replace(/[^a-zA-Z0-9._-]/g, "-")
42
43const writeTempTsconfig = (suiteName, subjectName, sourcePath) => {
44 mkdirSync(tmpDir, { recursive: true })
45 const id = sanitize(`${suiteName}-${subjectName}`)
46 const tsconfigPath = join(tmpDir, `${id}.json`)
47 const tsBuildInfoPath = join(tmpDir, `${id}.tsbuildinfo`)
48 writeJson(tsconfigPath, {
49 extends: effectTsconfigPath,
50 files: [sourcePath],
51 include: [],
52 compilerOptions: {
53 noEmit: true,
54 declaration: false,
55 declarationMap: false,
56 sourceMap: false,
57 plugins: [],
58 rootDir: effectDir,
59 incremental: false,
60 composite: false,
61 tsBuildInfoFile: tsBuildInfoPath
62 }
63 })
64 return tsconfigPath
65}
66
67const readMetric = (output, label, metric) => {
68 const match = output.match(new RegExp(`^${metric}:\\s+(\\d+)$`, "m"))

Callers 1

measureFunction · 0.70

Calls 3

sanitizeFunction · 0.70
writeJsonFunction · 0.70
joinFunction · 0.50

Tested by

no test coverage detected