Skip to content

Commit

Permalink
refactor(discover-features-registry): remove superflous comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Antonio Ghiani committed Apr 12, 2024
1 parent 5344db3 commit 24585d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 0 additions & 10 deletions packages/kbn-discover-features-registry/src/features_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import { BaseFeature } from './types';
export class FeaturesRegistry<Feature extends BaseFeature = BaseFeature> {
private readonly features = new Map<Feature['id'], Feature>();

/**
* Registers a new feature in the registry.
* @param {Feature} feature The actual feature instance to register.
* @throws {Error} If a feature with the same id already exists.
*/
register(feature: Feature): void {
if (this.features.has(feature.id)) {
throw new Error(
Expand All @@ -25,11 +20,6 @@ export class FeaturesRegistry<Feature extends BaseFeature = BaseFeature> {
this.features.set(feature.id, feature);
}

/**
* Retrieves a registered feature by its id.
* @param id The identifier of the feature to retrieve.
* @returns The feature if found, otherwise undefined.
*/
getById<Id extends Feature['id']>(id: Id) {
return this.features.get(id) as Extract<Feature, { id: Id }> | undefined;
}
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4484,6 +4484,10 @@
version "0.0.0"
uid ""

"@kbn/discover-features-registry@link:packages/kbn-discover-features-registry":
version "0.0.0"
uid ""

"@kbn/discover-plugin@link:src/plugins/discover":
version "0.0.0"
uid ""
Expand Down

0 comments on commit 24585d9

Please sign in to comment.