1 | "use strict";
|
2 | const DI = require('./di');
|
3 | const exports_1 = require('../core/exports');
|
4 | let repoSource = function (target) {
|
5 | let repo;
|
6 | if (!target) {
|
7 | return null;
|
8 | }
|
9 | Object.keys(exports_1.repositoryMap())
|
10 | .forEach(x => {
|
11 |
|
12 | var path;
|
13 | if (target.prototype) {
|
14 | path = target.prototype.path;
|
15 | }
|
16 | else if (target['default']) {
|
17 | path = target['default'].prototype.path;
|
18 | }
|
19 | if (path === x) {
|
20 | repo = exports_1.repositoryMap()[x].repo;
|
21 | }
|
22 |
|
23 |
|
24 |
|
25 | });
|
26 | return repo;
|
27 | };
|
28 | DI.Container.addSource(repoSource);
|
29 | exports.Container = DI.Container;
|
30 |
|
31 |
|