sussudio
Version:
An unofficial VS Code Internal API
24 lines (23 loc) • 821 B
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export class ServiceCollection {
_entries = new Map();
constructor(...entries) {
for (const [id, service] of entries) {
this.set(id, service);
}
}
set(id, instanceOrDescriptor) {
const result = this._entries.get(id);
this._entries.set(id, instanceOrDescriptor);
return result;
}
has(id) {
return this._entries.has(id);
}
get(id) {
return this._entries.get(id);
}
}