import { generateFactoryCode } from './generate-code' ; import * as ts from 'typescript' ; import { tsquery } from '@phenomnomnominal/tsquery' ; export class TSNodeFactory { public static generateAst ( source ) { const node = tsquery . ast ( source ) ; const fun = new Function ( 'ts' , `return ${ generateFactoryCode ( node ) }` ) ; return fun ( ts ) ; } }