| 646 | return Object.assign({ name: params.name }, opts) |
| 647 | } |
| 648 | get(name) { |
| 649 | const ctorInfos = this.#services.get(name) |
| 650 | if (!ctorInfos) { |
| 651 | return |
| 652 | } |
| 653 | if (!ServiceContainer.isConstructor(ctorInfos.definition)) { |
| 654 | return ctorInfos.definition |
| 655 | } |
| 656 | if (!ctorInfos.singleton) { |
| 657 | return this._createInstance(ctorInfos) |
| 658 | } |
| 659 | const singletonInstance = this.#singletons.get(name) |
| 660 | if (singletonInstance) { |
| 661 | return singletonInstance |
| 662 | } |
| 663 | const newSingletonInstance = this._createInstance(ctorInfos) |
| 664 | this.#singletons.set(name, newSingletonInstance) |
| 665 | return newSingletonInstance |
| 666 | } |
| 667 | |
| 668 | _getResolvedDependencies(service) { |
| 669 | let classDependencies = [] |