Skip to content

Conversation

@the5thbeatle
Copy link
Contributor

Summary

Updates the return type of groupBy to reflect that properties need not exist in the output but that if they do, their value has at least length 1. It prevents users from having to suppress unnecessary condition warnings when trying to safely access properties in groupBy results.

Changes

  • Wraps groupBy return type with Partial
  • Changes values in groupBy return type from T[] to [T, ...T[]]

Comments

The compat function is still using Record type here instead of Partial<Record>

@vercel
Copy link

vercel bot commented Oct 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
es-toolkit Ready Ready Preview Comment Oct 16, 2025 4:45am

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.

1 participant