Skip to content
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

Add an Object.groupBy TypeScript goody #363

Open
miorel opened this issue Aug 21, 2024 · 2 comments
Open

Add an Object.groupBy TypeScript goody #363

miorel opened this issue Aug 21, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers typescript Adventure Pack TypeScript issue

Comments

@miorel
Copy link
Contributor

miorel commented Aug 21, 2024

An Object.groupBy method is being added to JavaScript, but for now this is not available on LeetCode, since it requires Node 21, whereas LeetCode uses Node 20.

We'd like to get access to this function sooner, so let's create our own version!

This issue involves adding another directory within workspaces/adventure-pack/goodies/typescript, named Object.groupBy, with an index.ts for the implementation and an index.test.ts for a test. You can use the Map.groupBy added by #358 for inspiration, this should be very similar.

Note: after adding or updating a goody you will need to run yarn package-goodies:test -u to refresh the snapshot tests.

Please comment with any questions.

@miorel miorel added enhancement New feature or request good first issue Good for newcomers typescript Adventure Pack TypeScript issue labels Aug 21, 2024
@elimanzo
Copy link
Contributor

@miorel Quick question would this issue be the same as #108

@miorel
Copy link
Contributor Author

miorel commented Aug 25, 2024

Not exactly. This one is about replicating the built-in function Object.groupBy, #108 would be about adding a method to iterators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers typescript Adventure Pack TypeScript issue
Projects
None yet
Development

No branches or pull requests

2 participants