Skip to content

Conversation

@azech-hqs
Copy link
Contributor

This PR concerns:

  • adding a new isDefault property to entity filter objects
  • set default entity as first element in filtered entity array

@azech-hqs azech-hqs marked this pull request as ready for review October 23, 2023 18:02
const defaultIndex = pathObjects.findIndex((pathObj) => {
return isPathSupported(pathObj, [defaultFilter]);
});
if (defaultIndex < 0 || pathObjects.length < 2) return pathObjects;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the magic number 2? Let's explain the logic

});
if (defaultIndex < 0 || pathObjects.length < 2) return pathObjects;

const tmp = pathObjects[1];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above for the indices

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected the error and added explanatory comment

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.

3 participants