(e3, ...t3)
| 5635 | this._services.set(e3, t3); |
| 5636 | } |
| 5637 | getService(e3) { |
| 5638 | return this._services.get(e3); |
| 5639 | } |
| 5640 | createInstance(e3, ...t3) { |
| 5641 | const i3 = (0, r.getServiceDependencies)(e3).sort(((e4, t4) => e4.index - t4.index)), s3 = []; |
| 5642 | for (const t4 of i3) { |
| 5643 | const i4 = this._services.get(t4.id); |
| 5644 | if (!i4) throw new Error(`[createInstance] ${e3.name} depends on UNKNOWN service ${t4.id}.`); |
| 5645 | s3.push(i4); |
| 5646 | } |
| 5647 | const n2 = i3.length > 0 ? i3[0].index : t3.length; |
| 5648 | if (t3.length !== n2) throw new Error(`[createInstance] First service dependency of ${e3.name} at position ${n2 + 1} conflicts with ${t3.length} static arguments`); |
| 5649 | return new e3(...[...t3, ...s3]); |
| 5650 | } |
no test coverage detected