Allow replacing a function/def with a whole bunch of code.

This commit is contained in:
Robin Heggelund Hansen 2021-07-09 09:14:48 +02:00
parent 1e1c7e8eff
commit a3b90e9b12

View File

@ -3,7 +3,7 @@ import ts from 'typescript';
export const ast = (sourceText: string): ts.Node => {
const source = ts.createSourceFile('bla', sourceText, ts.ScriptTarget.ES2018);
return source.statements[0];
return source.statements;
};
export function create(name: string, body: ts.Node): ts.Node {