@lillallol/dic
Version:
My own dependency injection container.
37 lines (36 loc) • 1.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateDependencyGraph = exports.namesFactory = exports.printDependencyGraph = exports.Dic = void 0;
const Dic_1 = require("./Dic/Dic");
const printDependencyGraph_1 = require("./printDependencyTree/printDependencyGraph");
const NAMES_1 = require("./NAMES/NAMES");
const validateDependencyGraph_1 = require("./validateDependencyGraph/validateDependencyGraph");
/**
* @description
* Dependency injection container constructor.
*/
exports.Dic = Dic_1.Dic;
/**
* @description
* It returns a string representation of the dependency graph starting from the
* provided abstraction.
*/
exports.printDependencyGraph = printDependencyGraph_1.printDependencyGraph;
/**
* @description
* Provide `TYPES` to get back an identity function that provides intellisense
* for the keys of `TYPES`. This function can be used to have refactor-able
* names in the specification of unit tests.
*/
exports.namesFactory = NAMES_1.namesFactory;
/**
* @description
* It throws error when:
*
* * the dependency graph of the provided entry abstractions
* does not use all the registered abstractions
* * `TYPES` has extra or missing abstractions
* * there are cycles in the dependency graph
*
*/
exports.validateDependencyGraph = validateDependencyGraph_1.validateDependencyGraph;