UNPKG

@lillallol/dic

Version:

My own dependency injection container.

14 lines (13 loc) 576 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateNumberOfDependencies = void 0; const errorMessages_1 = require("../errorMessages"); /** * @description * Throws error if the provided dependencies array has different length than the provided factory. */ function validateNumberOfDependencies(dependencies, factory) { if (factory.length !== dependencies.length) throw Error(errorMessages_1.errorMessages.inconsistentNumberOfDependencies(factory)); } exports.validateNumberOfDependencies = validateNumberOfDependencies;