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

Function makeSourcefile

packages/tools/docgen/test/Parser.test.ts:35–45  ·  view source on GitHub ↗
(source: string | ast.SourceFile)

Source from the content-addressed store, hash-verified

33}
34
35const makeSourcefile = (source: string | ast.SourceFile) => {
36 if (Predicate.isString(source)) {
37 const filename = `test.ts`
38 const existing = project.getSourceFile(filename)
39 if (existing) {
40 project.removeSourceFile(existing)
41 }
42 return project.createSourceFile(filename, source)
43 }
44 return source
45}
46
47const makeSource = (source: string | ast.SourceFile) => {
48 const sourceFile = makeSourcefile(source)

Callers 1

makeSourceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected