Skip to content

Commit

Permalink
fix: remove errors when ID not found
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Jul 12, 2024
1 parent 3a9eb18 commit ac8458b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/fragments/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/fragments",
"description": "Simple geometric system built on top of Three.js to display 3D BIM data efficiently.",
"version": "2.1.0",
"version": "2.1.1",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down Expand Up @@ -67,4 +67,4 @@
"peerDependencies": {
"three": "^0.160.1"
}
}
}
11 changes: 4 additions & 7 deletions packages/fragments/src/fragment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ export class Fragment {
* @remarks
* This method updates the visibility of items in the fragment based on the provided visibility flag.
*
* @throws Will throw an error if the instances are not found or if the item IDs are not found in the fragment.
*
* @example
* ```typescript
Expand All @@ -363,7 +362,7 @@ export class Fragment {
if (visible) {
for (const itemID of itemIDs) {
if (!this.ids.has(itemID)) {
throw new Error(`This item doesn't exist here: ${itemID}`);
continue;
}
if (!this.hiddenItems.has(itemID)) {
continue;
Expand All @@ -379,7 +378,7 @@ export class Fragment {
} else {
for (const itemID of itemIDs) {
if (!this.ids.has(itemID)) {
throw new Error(`This item doesn't exist here: ${itemID}`);
continue;
}
if (this.hiddenItems.has(itemID)) {
continue;
Expand All @@ -406,7 +405,6 @@ export class Fragment {
* @param itemIDs - An iterable of item IDs to be affected. If not provided, all items in the fragment will be affected.
* @param override - A boolean indicating whether the original color should be overridden. If true, the original color will be replaced with the new color.
*
* @throws Will throw an error if the fragment doesn't have color per instance or if the item IDs are not found in the fragment.
*
* @example
* ```typescript
Expand All @@ -424,7 +422,7 @@ export class Fragment {
}
for (const itemID of itemIDs) {
if (!this.ids.has(itemID)) {
throw new Error(`This item doesn't exist here: ${itemID}`);
continue;
}
const instances = this.itemToInstances.get(itemID);
if (!instances) {
Expand Down Expand Up @@ -461,7 +459,6 @@ export class Fragment {
*
* @param itemIDs - An iterable of item IDs to be affected. If not provided, all items in the fragment will be affected.
*
* @throws Will throw an error if the fragment doesn't have color per instance or if the item IDs are not found in the fragment.
*
* @example
* ```typescript
Expand All @@ -475,7 +472,7 @@ export class Fragment {
}
for (const itemID of itemIDs) {
if (!this.ids.has(itemID)) {
throw new Error(`This item doesn't exist here: ${itemID}`);
continue;
}
const instances = this.itemToInstances.get(itemID);
if (!instances) {
Expand Down

0 comments on commit ac8458b

Please sign in to comment.