UNPKG

@carlosv2/glue

Version:

Dependency injection library that stays out of the way

21 lines (20 loc) 794 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Instantiation = void 0; const typescript_1 = __importDefault(require("typescript")); const compilable_1 = require("../compilable"); const { factory } = typescript_1.default; class Instantiation extends compilable_1.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))); } } exports.Instantiation = Instantiation;