We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The custom groupBy return type should be Partial<Record<T[Key], T[]>>
Partial<Record<T[Key], T[]>>
The text was updated successfully, but these errors were encountered:
@ProfessorX737 ahh yea are you talking about the case for something like
const foo: Array<{type: 'a'} | {type: 'b'}> = [{type: 'a'}]; const grouped = groupBy(foo, 'type') grouped.b //sad
I have actually ran into this after making that post and was able to work around it with https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy returning an empty array for all missing keys but it feels wrong
Ill update the post
Sorry, something went wrong.
No branches or pull requests
The custom groupBy return type should be
Partial<Record<T[Key], T[]>>
The text was updated successfully, but these errors were encountered: