-
-
Notifications
You must be signed in to change notification settings - Fork 836
refactor: improve type declarations by using generics in utils/group
#1375
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
Conversation
@Planeshifter Would you mind reviewing? You might have additional ideas regarding the keys of the output object. |
utils/group
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Hi there! 👋
And thank you for opening your first pull request! We will review it shortly. 🏃 💨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of the collection
elements does not have to match the types of the group elements. For example, we could have a numeric array and a group array of strings denoting the group labels. So we shouldn't use the T
generic for both collections.
In fact, I suggest we enforce that the groups
collection groups should contain only values that are valid property keys
@Planeshifter I have updated the code |
426a9ef
to
fb89077
Compare
refactor: add type constraint for group labels in group function declaration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two suggestions, then this should be ready to land; thanks!
@Planeshifter I have made the required changes |
@rajutkarsh07 Great, thanks! Will merge after CI has passed. |
Resolves #1086
Description
This pull request:
Related Issues
This pull request:
@stdlib/utils/group
#1086Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers