Skip to content

Conversation

@alcalyn
Copy link

@alcalyn alcalyn commented Dec 11, 2024

Just starting with MikroOrm.

I found some places where there is no jsdoc not documentation, e.g for those two methods, I had to check source code to know if I need to do if (collection.contains()) before adding an item or not.

Copy link
Member

@B4nan B4nan left a comment

Choose a reason for hiding this comment

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

I believe you will also need to add @inheritDoc on the Collection methods that override those.

Also I am not so sure about your comments there, I would rather describe the purpose of those methods, not their implementation details. e.g. its not about add method being idempotent, the Collection cannot hold duplicates, the fact that we do the contains check is just an implementation detail, it would work the same without it, since the items are stored in a Set internally.

return super.toJSON() as unknown as EntityDTO<TT>[];
}

/**
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be over the set method too. Ideally on all the collection methods that are overriding the arraycollection ones.

Copy link
Author

Choose a reason for hiding this comment

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

set seems not to be overriden in Collection.

Sorry I take time to respond because I was confused, and I'm currently replacing typeorm by mikro-orm, and I want to make sure I understand mikro-orm before adding jsdoc

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