(source: string | ast.SourceFile)
| 33 | } |
| 34 | |
| 35 | const 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 | |
| 47 | const makeSource = (source: string | ast.SourceFile) => { |
| 48 | const sourceFile = makeSourcefile(source) |