15e4a1bb47603a2f395d0a584db2f6e8b1bfc1b300645ba1b044970780b28a86c7df6ee9ba2a0fb156809bd4213904846e2b98b42eb37cdbd89b8785201e66 772 B

1234567891011121314151617181920
  1. /*---------------------------------------------------------------------------------------------
  2. * Copyright (c) Microsoft Corporation. All rights reserved.
  3. * Licensed under the MIT License. See License.txt in the project root for license information.
  4. *--------------------------------------------------------------------------------------------*/
  5. export class ServiceCollection {
  6. constructor(...entries) {
  7. this._entries = new Map();
  8. for (const [id, service] of entries) {
  9. this.set(id, service);
  10. }
  11. }
  12. set(id, instanceOrDescriptor) {
  13. const result = this._entries.get(id);
  14. this._entries.set(id, instanceOrDescriptor);
  15. return result;
  16. }
  17. get(id) {
  18. return this._entries.get(id);
  19. }
  20. }