Commit 789da6e
authored
improvement(workspace-API), provide one complete API "hasId" for different scenarios (#9517)
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;
```1 parent 63f48b3 commit 789da6e
File tree
3 files changed
+11
-15
lines changed- scopes
- component/forking
- generator/generator
- workspace/workspace
3 files changed
+11
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
446 | | - | |
| 445 | + | |
447 | 446 | | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
454 | 450 | | |
455 | 451 | | |
456 | 452 | | |
457 | 453 | | |
458 | 454 | | |
459 | 455 | | |
460 | | - | |
| 456 | + | |
461 | 457 | | |
462 | 458 | | |
463 | 459 | | |
| |||
988 | 984 | | |
989 | 985 | | |
990 | 986 | | |
991 | | - | |
| 987 | + | |
992 | 988 | | |
993 | 989 | | |
994 | 990 | | |
| |||
1062 | 1058 | | |
1063 | 1059 | | |
1064 | 1060 | | |
1065 | | - | |
| 1061 | + | |
1066 | 1062 | | |
1067 | 1063 | | |
1068 | 1064 | | |
| |||
1136 | 1132 | | |
1137 | 1133 | | |
1138 | 1134 | | |
1139 | | - | |
| 1135 | + | |
1140 | 1136 | | |
1141 | 1137 | | |
1142 | 1138 | | |
| |||
0 commit comments