Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement(workspace-API), provide one complete API "hasId" for different scenarios #9517

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

davidfirst
Copy link
Member

Until now we had two APIs in the Workspace aspect:

hasId(componentId: ComponentID): boolean;
exists(componentId: ComponentID, opts: { includeDeleted?: boolean } = {}): boolean;

Both methods check whether a component ID is part of the workspace. The former checks for an exact match, while the latter ignores the version and provides an option to include deleted components. This is obviously confusing because the method names do not clearly indicate the type of comparison being performed.

In this PR, the exists method is deprecated, and hasId is modified (without a breaking change) to include all options:

hasId(componentId: ComponentID, opts?: { includeDeleted?: boolean, ignoreVersion?: boolean }): boolean;

@davidfirst davidfirst merged commit 789da6e into master Feb 5, 2025
10 checks passed
@davidfirst davidfirst deleted the align-has-id-exists-api branch February 5, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants