UNPKG

@carlosv2/glue

Version:

Dependency injection library that stays out of the way

14 lines (13 loc) 451 B
import ts from 'typescript'; import { Compilable } from '../compilable.js'; const { factory } = ts; export class Instantiation extends Compilable { constructor(importation, args) { super(); this.importation = importation; this.args = args; } compile(importer) { return factory.createNewExpression(this.importation.compile(importer), undefined, this.args.map(arg => this.compileArg(importer, arg))); } }